paparazzi-devel
[Top][All Lists]
Advanced

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

Re: [Paparazzi-devel] Use of State Variables in Flight Plan Exceptions


From: Gautier Hattenberger
Subject: Re: [Paparazzi-devel] Use of State Variables in Flight Plan Exceptions
Date: Thu, 03 Sep 2015 22:00:42 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.8.0

Hi,

The easiest trick is to do this in the header section at the beginning of the flight plan:

<header>
#define GroundSpeed() (*stateGetHorizontalSpeedNorm_f())
</header>

and the use GroundSpeed() in the blocks.

On the long term, we already discussed I think that all state interface functions should finally return structures or simple types and not pointers, especially for RTOS integration where mutex would be used.

Gautier

Le 03/09/2015 10:50, Felix Ruess a écrit :
Hi Luke,

in general you can use the state interface functions like you would expect, e.g.:
<exception cond="stateGetPositionEnu_f()->z > 2.0" deroute="Standby"/>

However for the ground speed it is a bit more tricky, since it returns a pointer to the variable and dereferencing makes the flight plan parser barf:
<exception cond="*stateGetHorizontalSpeedNorm_f() > 15.0" deroute="Standby"/>

@Gautier, any good idea on how to circumvent this?

I guess it would make sense to change the functions that return a single float or int (like stateGetHorizontalSpeedNorm_f) to return the value and not pointer...

Cheers, Felix

On Wed, Sep 2, 2015 at 4:35 AM, Luke Ionno <address@hidden> wrote:

Hello,

I’m sure this is a pretty simple thing to do, but how does one go about using values from state.h in flight plan exceptions?  In particular, I’m interested in using ground speed above/below certain thresholds to trigger particular flight-plan blocks.  Could somebody provide an example of how this would be done?

Thanks!

-Luke


_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel




_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel


reply via email to

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