[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Paparazzi-devel] Re: Flight plan altitude data.

From: David Conger
Subject: Re: [Paparazzi-devel] Re: Flight plan altitude data.
Date: Fri, 18 Jun 2010 08:17:55 -0700

Maybe way more explanation for anyone but me but I thought I would add what I concluded from the code alone:
I found this in the code  (sw/airborne/booz/booz2_navigation.h):
/** Time in s since the entrance in the current block */
#define NavBlockTime() (block_time)

The same statement is in sw/airborne/common_nav.h

Looking at how it's used:
<while cond="LessThan(NavBlockTime(), 3)"/>

I concluded it returned a value "Time" in seconds since the start of execution of the current block. Read about blocks here:

Even more:
So, say you want to as was said below have GPS position stabilize. How could you do it? You could have a "block" of code around the GPS initialization and have it wait in there instead of executing quickly and moving on. By waiting 10 seconds (or more you can modify the 10 to 15 or 20 or ? ) you can give the GPS time to stabilize. The code from the Generic flight plan looks like:
          <block name="Wait GPS">
                  <set value="1" var="kill_throttle"/>
                  <while cond="!GpsFixValid()"/>
          <block name="Geo init">
                  <while cond="LessThan(NavBlockTime(), 10)"/>
                  <call fun="NavSetGroundReferenceHere()"/>

The first part has a while conditional. The loop is around the GpsFixValid not being true. Once true the wile will not be valid and move on to the next step in the code....which is another while where the condition for the while the "Geo init" block has not run for 10 seconds. So until Geo init has executed for 10 seconds the code will not continue. Basically just saying once this code is started wait 10 seconds. Or in shell scripting sleep=10 

You could probably use this in things like circle a waypoint for 20 seconds or survey for 300 seconds by just using variations. ..however I do not see in the code anywhere this statement being used any differently. Always:
<while cond="LessThan(NavBlockTime(), 10)"/> with the only variable the test value (10 or in some cases a 1).

This is all just what I concluded from looking in the code so I welcome anyone who wrote this correcting me so I can learn. 

I do have these questions:
 - I see there is a <while cond="LessThan(), X)"/> ... is there also "GreaterThan" ? I only see LessThan() 
 - Is this logic possible in all blocks or does only the statement as used work? Can you have different blocks execute for a set amount of time in this way? 

I suppose I can simply try it myself in the simulator :)


On Jun 18, 2010, at 1:20 AM, address@hidden wrote:

That statement waits for 10 seconds to let the GPS position stabilize before setting the coordinates and height of the Home waypoint.
Hope this helps.
Regards, Mark
From: address@hidden [mailto:address@hidden On Behalf OfHelge Walle
Sent: Thursday, 17 June 2010 8:57 PM
To: address@hidden
Subject: [Paparazzi-devel] Re: Flight plan altitude data.
Thanks a lot, Thomas !

I followed your advice, and this works just fine in Paparazzi.

I compared the elevation data to places in my area with known height above sea level, and they are good to within a few meters from my local maps and also to what the gps says.

These data also made me understand how AGL works.

Still I would be interested in some understanding of the <while cond="LessThan(NavBlockTime(), 10)"/> statement, if anyone could enlighten this.



looks like original data from USGS doesn't cover your area. 
But you can download - unzip, cd P3, bzip2 *,mv * $PAPAHOMEDIR/data/srtm and try again.
Good luck.


Am 16.06.2010 23:07, schrieb Helge Walle:
I live at   lat0=60.381221   lon0=5.152867 in Norway. I can not find any SRTM data for the area where I live.
I am working to understand the altitude data in the flight plan, and also the "AGL" value in the GCS. I have searched through the mailing list for explanations; found some, but still I have a way to go.
The following is part of my current flight plan:

<block name="Geo init">
<while cond="LessThan(NavBlockTime(), 10)"/>
<call fun="NavSetGroundReferenceHere()"/>
<call fun="NavSetWaypointHere(WP_HOME)"/>
<set value="ground_alt" var="waypoints[WP_TD].a"/>
<set value="ground_alt+10" var="waypoints[WP_AF].a"/>

Does the statement <while cond="LessThan(NavBlockTime(), 10)"/> specify the time of determining "ground_alt" ?
How is this statement explained ?
How is "AGL" in the GCS computed? Is it the altitude given by the GPS minus "ground_alt" ?
Is "Alt" in the GCS the altitude given by the GPS at any time ?

Thank you for any help,

Best regards,
Helge Walle.

Paparazzi-devel mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]