[Top][All Lists]

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

Re: [Paparazzi-devel] While condition with stage_time not working as exp

From: Simon Wilks
Subject: Re: [Paparazzi-devel] While condition with stage_time not working as expected
Date: Mon, 9 May 2011 21:35:42 +0200

Hi Gautier,

I see :) So what I was trying to do was instruct the aircraft to fly a route from A to B so it would be lined up with a target, call the bomb drop routine (in this case a servo that will press the camera button). This basically all works fine only the time between the servo activating the shutter button and the photo being taken is long enough that the aircraft will already be banking to turn back to the next waypoint (in this case Standby).

What I wanted was to be able to issue the bomb drop command and tell the plane to continue on its way using its current heading retaining it's current attitude, etc. 

Now that I have said "attitude" I tried using the <attitude> directive and it seems to have done the job:

<go approaching_time="0" from="A" hmode="route" vmode="glide" wp="B"/>
<set value="MAX_PPRZ" var="ap_state->commands[COMMAND_SHUTTER]"/>
<set value="MIN_PPRZ" var="ap_state->commands[COMMAND_SHUTTER]"/>
<attitude roll="0.0" alt="flight_altitude" until="stage_time > 6" vmode="alt"/>
<go approaching_time="0" wp="C"/>

I guess to do any better than this I would need to write my own nav function?


On Mon, May 9, 2011 at 5:28 PM, Gautier Hattenberger <address@hidden> wrote:

It is actually not possible that this code ever worked. The init_stage is called at each loop in the while cond="5 > stage_time", so stage_time is reseted each time. This is not a bug, children of while are stages, so if you have no child, you spend 0s in each of them...
What do you need to do ?


On 09/05/2011 10:41, Simon Wilks wrote:

I have tried using the following example (taken directly from the Paparazzi user's guide) and can't get it to work. 

<while cond="TRUE"> 
 <go wp="A"/> 
 <go wp="B"/> 
 <go wp="C"/> 
 <while cond="5 > stage_time"/>

What I have observed in the simulation is that it flies to A and B and at each point the stage time displayed in the GCS resets to zero and starts counting again as expected. As it hits C the stage time is again reset to zero and then while delay loop is hit, however, the stage time in GCS remains at zero and the plane happily keeps flying straight ahead until it hits the max allowed distance from home.

I was using Paparazzi code that was a couple of months old but synced to the latest today without any change in behavior.


_______________________________________________ Paparazzi-devel mailing list address@hidden

Paparazzi-devel mailing list

reply via email to

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