[Top][All Lists]

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

Re: [Paparazzi-devel] Maximum speed?

From: Ori Pessach
Subject: Re: [Paparazzi-devel] Maximum speed?
Date: Tue, 14 Apr 2015 07:12:44 -0600

I'm still not clear on why all of the logic is in a generated header file... Was there a good reason for that?

On Tue, Apr 14, 2015 at 3:56 AM, Felix Ruess <address@hidden> wrote:
Hi Ori,

Well, a static inline function in a header file like that is essentially like a macro.
As I wrote before guidance_h_SetMaxSpeed is only there to adhere to the generated settings handler naming convention and used as an alias for gh_set_max_speed.
The compiler will inline and optimize this, so it is basically the same as if the generated settings functions would directly call gh_set_max_speed.
Could have been done using "#define guidance_h_SetMaxSpeed gh_set_max_speed" to the same effect...

To include a header file:
#include "guidance/guidance_h.h"

See also

Cheers, Felix

On Mon, Apr 6, 2015 at 5:13 PM, Ori Pessach <address@hidden> wrote:
guidance_h_SetMaxSpeed() isn't a macro. It's an inline function, and it's declared static in a header file, which is not a great idea. In fact, putting all of the autopilot code in a header file is an odd choice...

How do I go about including a header from a flightplan, anyway?


On Mon, Mar 23, 2015 at 3:30 PM, Felix Ruess <address@hidden> wrote:
The guidance_h_SetMaxSpeed() macro is basically only there to adhere to the naming convention for settings handlers.
You should be able to simply call gh_set_max_speed(speed) directly from your flightplan (but you probably need to include the header).

On Thu, Mar 12, 2015 at 3:35 PM, Ori Pessach <address@hidden> wrote:
This doesn't work as the code is currently written. guidance_h_SetMaxSpeed() is declared static (in a header file, no less) and the header isn't included in the generated header file that gets compiled into the autopilot firmware, so compilation fails because the reference to guidance_h_SetMaxSpeed() ends up being non-static.

Removing the static modifier gets the code to compile, but that's not ideal. 

The correct way to deal with this is to get the generated code to include the header file where guidance_h_SetMaxSpeed() is declared, but it doesn't seem like it's intended to be part of an official API (if one even exists...)

I have to wonder why the autopilot logic is generated into a header file. That seems like an odd (and potentially bad) choice. Is there a good reason for that?


On Sun, Mar 8, 2015 at 2:38 PM, Sergey Krukowski <address@hidden> wrote:
Afaik, the idea was to use the function guidance_h_SetMaxSpeed:
Not sure however it there any other convenience functions for that.

Best Regards,

The wiki has very little to say about setting the maximum speed:

Basically, nothing.

Is there a way to set the speed of travel between waypoints in a flightplan
for a rotorcraft?



Paparazzi-devel mailing list

Paparazzi-devel mailing list

Paparazzi-devel mailing list

Paparazzi-devel mailing list

Paparazzi-devel mailing list

reply via email to

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