paparazzi-devel
[Top][All Lists]
Advanced

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

Re: [Paparazzi-devel] possible error in nav_catapult code


From: Gautier Hattenberger
Subject: Re: [Paparazzi-devel] possible error in nav_catapult code
Date: Sun, 12 Jun 2016 22:24:51 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0

Hi,

The init function is called at startup (see module xml file) so you don't have to call it from the flight plan (the 'call' instruction requires to return a boolean, that's why you have the error). If you still want to re-init the module from the flight plan, use the 'call_once' instruction instead.

Gautier


Le 12/06/2016 18:49, hendrixgr . a écrit :
I think there is a mistake inside the nav_catapult.c and .h files because i get an error about not proper use of a void function.
Since all functions in the flight plan should return something i think that the below function:
void nav_catapult_init(void)
{

  nav_catapult.status           = NAV_CATAPULT_UNINIT;
  nav_catapult.timer            = 0;
  nav_catapult.accel_threshold  = NAV_CATAPULT_ACCELERATION_THRESHOLD;
  nav_catapult.motor_delay      = NAV_CATAPULT_MOTOR_DELAY;
  nav_catapult.heading_delay    = NAV_CATAPULT_HEADING_DELAY;
  nav_catapult.initial_pitch    = NAV_CATAPULT_INITIAL_PITCH;
  nav_catapult.initial_throttle = NAV_CATAPULT_INITIAL_THROTTLE;

}

should be:

bool nav_catapult_init(void)
{

  nav_catapult.status           = NAV_CATAPULT_UNINIT;
  nav_catapult.timer            = 0;
  nav_catapult.accel_threshold  = NAV_CATAPULT_ACCELERATION_THRESHOLD;
  nav_catapult.motor_delay      = NAV_CATAPULT_MOTOR_DELAY;
  nav_catapult.heading_delay    = NAV_CATAPULT_HEADING_DELAY;
  nav_catapult.initial_pitch    = NAV_CATAPULT_INITIAL_PITCH;
  nav_catapult.initial_throttle = NAV_CATAPULT_INITIAL_THROTTLE;

return(FALSE);
}

Of course the function declaration in the header file should be corrected also.
BTW it works very well in simulation but i am about to find out if it works in real life also
this week.
Chris



_______________________________________________
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]