Menu

#15 Reg: Set Altitude at each waypoint (in scripts/c3104.xml)

None
open
Config file (1)
4
2017-03-11
2011-11-07
No

Hi,

may i know the paramter to set altitude of each waypoint in c3104.xml in scripts for C310 flight.

i felt "hydro/alt-agl-ft" parameter is correct for altitude set @ each waypoint.
eg:

<event name="Head to first waypoint">
<condition>position/h-agl-ft ge 800</condition>



</event>
<event name="Second waypoint">
<condition>position/h-agl-ft ge 1200</condition>



</event>

Kindly correct me if am wrong & thanks in advance.

Regards,
KrishnaRao Veeramachaneni.

Discussion

  • KrishnaRao Veeramachaneni

    We are eagerly waiting for answer of this question.. i appreciate helping hand to answer this issue.

     
  • Jon S. Berndt

    Jon S. Berndt - 2012-03-14

    There is no property names, "hydro/alt-agl-ft". In the script c3104.xml (as it is currently written in our JSBSim CVS repository) there is this line in the first event:

      <set name="ap/altitude_setpoint" action="FG_EXP" value="1000.0" tc="10.0"/>
    

    This sets the altitude setpoint. You would need to reset this property when the new waypoint is set. I don't know what the "hydro" prefix is on some of the properties. I don't have that in my version of the script.

    I hope this helps. Let me know if you need more help, or ask further questions on the mailing list.

     
  • KrishnaRao Veeramachaneni

    I appreciate Berndt firstly for the quick response.

    Here am working on waypoint navigation.

    Departure airport : denvar
    Arrival airport : eagles

    Am using the c3104.xml (Script) file with below configuration


    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="http://jsbsim.sourceforge.net/JSBSimScript.xsl"?>
    <runscript xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://jsbsim.sf.net/JSBSimScript.xsd" name="C172-01A takeoff run">


    <run start="0.0" end="5400" dt="0.02">

    <event name="Start engine">
    <description>
    Start engine and set initial heading and waypoints, turn on heading-hold mode.
    </description>
    <condition>simulation/sim-time-sec ge 0.25</condition>

      <set name="fcs/mixture-cmd-norm[0]" value="1"/>
     <!-- <set name="fcs/mixture-cmd-norm[1]" value="1"/> -->
      <set name="fcs/advance-cmd-norm[0]" value="1.0"/>
     <!-- <set name="fcs/advance-cmd-norm[1]" value="1.0"/> -->
      <set name="fcs/advance-cmd-norm[0]" value="1.0"/>
     <!-- <set name="fcs/advance-cmd-norm[1]" value="1.0"/> -->
    
      <set name="fcs/throttle-cmd-norm" value="1.0" action="FG_RAMP" tc ="0.5"/>
    <set name="propulsion/magneto_cmd" value="3"/>
      <set name="propulsion/starter_cmd" value="1"/>
      <set name="ap/altitude_setpoint" action="FG_RAMP" value="6352.0" tc="10.0"/>
      <set name="ap/attitude_hold" value="0"/>
      <set name="guidance/target_wp_latitude_rad" value="0.695906"/>
      <set name="guidance/target_wp_longitude_rad" value="-1.823184"/>
    






    <notify/>
    </event>

    <event name="Set altitude for 1,000 ft.">
      <condition>velocities/vc-fps ge 145.0</condition>
      <set name="ap/altitude_hold" value="1"/>
      <notify/>
    </event>
    
    <event name="Raise landing gear">
      <condition>position/h-agl-ft  ge  40</condition>
      <set name="gear/gear-cmd-norm" value="0"/>
      <notify/>
    </event>
    
    <event name="Head to first waypoint">
      <description>
        Set heading hold to selected waypoint (setpoint) instead of
        previously specified heading when altitude surpasses 800 feet.
      </description>
      <condition>position/h-agl-ft  ge  800</condition>
      <set name="ap/heading-setpoint-select" value="1"/>
      <set name="ap/active-waypoint" value="1"/>
      <notify>
        <property>guidance/wp-distance</property>
    <property>position/h-agl-ft </property>
    <property>position/h-sl-ft </property>
    </notify>
    </event>
    

    <event name="Terminate">
    <description>
    When the aircraft arrives back at Ellington Field (fifth waypoint)
    then terminate the simulation.
    </description>
    <condition>
    guidance/wp-distance lt 100
    ap/active-waypoint eq 10
    </condition>

    <notify/>
    </event>

    <event name="Landing (Last) WayPoint (Eagles Airport)">
      <description>
        When aircraft approaches towards eagles airport
      </description>
      <condition>
        guidance/wp-distance lt 1000
        ap/active-waypoint eq 9
      </condition>
      <set name="guidance/target_wp_latitude_rad" value="0.691898967"/>
      <set name="guidance/target_wp_longitude_rad" value="-1.865835147"/>
      <set name="ap/altitude_setpoint" value="6540.0"/>
      <set name="ap/active-waypoint" value="10"/>
      <notify>
        <property>guidance/wp-distance</property>
    <property>position/h-agl-ft </property>
    <property>position/h-sl-ft </property>
      </notify>
    </event>
    
    <event name="Set Ninth waypoint">
      <description>
        Way point before the eagles airport
      </description>
      <condition>
        guidance/wp-distance lt 100
        ap/active-waypoint eq 8
      </condition>
      <set name="guidance/target_wp_latitude_rad" value="0.692346662"/>
      <set name="guidance/target_wp_longitude_rad" value="-1.862933537"/>
      <set name="ap/altitude_setpoint" value="6949.0"/>
      <set name="ap/active-waypoint" value="9"/>
      <notify>
        <property>guidance/wp-distance</property>
    <property>position/h-agl-ft </property>
    <property>position/h-sl-ft </property>
      </notify>
    </event>
    
    <event name="Set Eighth waypoint">
      <description>
        Eighth waypoint from the devar airport
      </description>
      <condition>
       guidance/wp-distance lt 12000
        ap/active-waypoint eq 7
      </condition>
      <set name="guidance/target_wp_latitude_rad" value="0.692426656"/>
      <set name="guidance/target_wp_longitude_rad" value="-1.862391757"/>
        <set name="ap/altitude_setpoint" value="7149.0"/>
      <set name="ap/active-waypoint" value="8"/>
      <notify>
        <property>guidance/wp-distance</property>
    <property>position/h-agl-ft </property>
    <property>position/h-sl-ft </property>
      </notify>
    </event>
    
    <event name="Set Seventh waypoint">
      <description>
        Seventh waypoint from the devar airport
      </description>
      <condition>
        guidance/wp-distance lt 100
        ap/active-waypoint eq 6
      </condition>
      <set name="guidance/target_wp_latitude_rad" value="0.692670275"/>
      <set name="guidance/target_wp_longitude_rad" value="-1.860742784"/>
      <set name="ap/altitude_setpoint" value="7549.0"/>
      <set name="ap/active-waypoint" value="7"/>
      <notify>
        <property>guidance/wp-distance</property>
    <property>position/h-agl-ft </property>
    <property>position/h-sl-ft </property>
      </notify>
    </event>
    
    <event name="Set Sixth waypoint">
      <description>
        Sixth Way Point from the devar airport
      </description>
      <condition>
        guidance/wp-distance lt 100
        ap/active-waypoint eq 5
      </condition>
      <set name="guidance/target_wp_latitude_rad" value="0.692773904"/>
      <set name="guidance/target_wp_longitude_rad" value="-1.860044653"/>
      <set name="ap/altitude_setpoint" value="7949.0"/>
      <set name="ap/active-waypoint" value="6"/>
      <notify>
        <property>guidance/wp-distance</property>
        <property>position/h-agl-ft </property>
        <property>position/h-sl-ft </property>
      </notify>
    </event>
    
    <event name="Set Fifth waypoint">
      <description>
        When the distance to the fourth waypoint (northeast end of Galveston
        Island) is less than 100 feet, then set the last waypoint
      </description>
      <condition>
        guidance/wp-distance lt 100
        ap/active-waypoint eq 4
      </condition>
      <set name="guidance/target_wp_latitude_rad" value="0.694439"/>
      <set name="guidance/target_wp_longitude_rad" value="-1.85935"/>
      <set name="ap/altitude_setpoint" value="8249.0"/>
      <set name="ap/active-waypoint" value="5"/>
      <notify>
        <property>guidance/wp-distance</property>
    <property>position/h-agl-ft </property>
    <property>position/h-sl-ft </property>
    <property>guidance/wp-distance </property>
      </notify>
    </event>
    
    <event name="Set fourth waypoint">
      <description>
        When the distance to the third waypoint (southwest end of Galveston
        Island) is less than 800 feet, then set the fourth waypoint
        (northeast end of Galveston Island).
      </description>
      <condition>
        guidance/wp-distance lt 800
        ap/active-waypoint eq 3
      </condition>
      <set name="guidance/target_wp_latitude_rad" value="0.698177"/>
      <set name="guidance/target_wp_longitude_rad" value="-1.857772"/>
      <set name="ap/altitude_setpoint" value="8349.0"/>
      <set name="ap/active-waypoint" value="4"/>
      <notify>
        <property>guidance/wp-distance</property>
    <property>position/h-agl-ft </property>
    <property>position/h-sl-ft </property>
      </notify>
    </event>
    
    <event name="Set third waypoint">
      <description>
        When the distance to the second waypoint (Hobby Airport) is less than
        500 feet, then set the third waypoint.
      </description>
      <condition>
        guidance/wp-distance lt 500
        ap/active-waypoint eq 2
      </condition>
      <set name="guidance/target_wp_latitude_rad" value="0.721481"/>
      <set name="guidance/target_wp_longitude_rad" value="-1.845178"/>
     <set name="ap/altitude_setpoint" value="9249.0"/>
      <set name="ap/active-waypoint" value="3"/>
      <notify>
        <property>guidance/wp-distance</property>
     <property>position/h-agl-ft </property>
     <property>position/h-sl-ft</property>
      </notify>
    </event>
    
    <event name="Set second waypoint">
      <description>
        When the distance to the first waypoint is less than
        700 feet, then set the second waypoint.
      </description>
      <condition>
        guidance/wp-distance lt 700
        ap/active-waypoint eq 1
      </condition>
      <set name="guidance/target_wp_latitude_rad" value="0.711482"/>
      <set name="guidance/target_wp_longitude_rad" value="-1.833783"/>
      <set name="ap/altitude_setpoint" value="1500.0"/>
      <set name="ap/altitude_hold" value="0"/>
    
      <set name="ap/active-waypoint" value="2"/>
      <notify>
        <property>guidance/wp-distance</property>
    <property>position/h-agl-ft </property>
      <property>position/h-sl-ft</property>
      </notify>
    
    </event>
    

    </run>
    </runscript>


    Here issue is after second way-point, am unable to reach the third way point (using altitude of 9249 ft).

    Reason: Tail Skid is happening & flight is crashing.

    Can you help me out, to solve this problem.

    Thanks in advance.

    Regards,
    KrishnaRao Veeramachaneni.

     
  • Bertrand Coconnier

    Ticket moved from /p/jsbsim/bugs/104/

     

Log in to post a comment.