ardupilot/libraries
Lucas De Marchi 62c2f737d5 AP_HAL_Linux: fix setting RT priorities
LinuxScheduler::init() was not really working as it should. This was the
result of "ps -Leo class,rtprio,wchan,comm | grep ArduCopter":

FF      12 futex_ ArduCopter.elf
FF      12 usleep ArduCopter.elf
FF      12 hrtime ArduCopter.elf
FF      12 poll_s ArduCopter.elf
FF      12 hrtime ArduCopter.elf
FF      12 hrtime ArduCopter.elf

As can be seen all the threads run with the same priority, the one of the main
thread. There were basically 2 mistakes:

	1) pthread_attr_setschedpolicy() needs to be called before
	   pthread_attr_setschedparam(). Otherwise the latter will just return
	   an error and not set the priority

	2) pthread_create() defaults to ignore the priority and inherit the
	   it from the parent thread. pthread_attr_setinheritsched() needs to
	   be called to change the behavior to PTHREAD_EXPLICIT_SCHED. See
	   pthread_attr_setinheritsched(3) for an example program to test the
	   behaviors.

Also, it's undefined behavior to call pthread_attr_init() several times on the
same pthread_attr_t. Although we could reutilize the same attribute without
calling  pthread_attr_init() again, lets refactor the code a little bit, so all
the pthread calls are in a single place. Then also call pthread_attr_destroy()
when we are done.
2015-04-14 09:17:20 +10:00
..
AC_AttitudeControl AC_AttControl_Heli: remove RATE_RP_MAX, RATE_Y_MAX 2015-04-09 20:19:54 +09:00
AC_Fence AC_Fence: fix prearm check 2015-03-18 21:25:47 +09:00
AC_PID AC_PID: more protection against NaN and Inf 2015-04-09 20:19:55 +09:00
AC_Sprayer AC_Sprayer: remove example sketch 2015-03-13 16:40:54 +09:00
AC_WPNav AC_WPNav: remove example sketch 2015-03-13 16:40:57 +09:00
AP_ADC AP_ADC: added ADS1115 support 2015-02-12 12:57:45 +11:00
AP_ADC_AnalogSource AP_ADC_AnalogSource: avoid some float conversion warnings 2014-07-08 20:26:37 +10:00
AP_AHRS AP_AHRS: Fix bug preventing EKF from initialising 2015-04-10 11:07:42 +09:00
AP_Airspeed AP_Airspeed: fixed example build 2015-03-14 20:00:15 +11:00
AP_Arming AP_Arming: accept accel/gyro if OK in last 10 seconds 2015-03-31 15:37:24 -07:00
AP_Baro AP_Baro: load only HIL backend for hil_mode 2015-03-13 22:52:55 +11:00
AP_BattMonitor BattMon_SMBus_PX4: read capacity 2015-04-11 14:10:22 +09:00
AP_BoardConfig AP_BoardConfig: added BRD_SBUS_OUT parameter 2015-02-11 18:35:34 +11:00
AP_Buffer AP_Buffer: change pop_front to return a bool if successful 2014-10-20 08:26:14 +11:00
AP_Camera AP_Camera: removed use of mavlink_check_target() 2014-12-11 12:32:24 +09:00
AP_Common AP_Common: added HomeState enum from copter 2015-02-21 10:13:17 +11:00
AP_Compass AP_Compass: show compass count in example 2015-03-14 20:00:29 +11:00
AP_Curve AP_Curve: remove virtual from method declarations 2014-02-10 17:28:11 +09:00
AP_Declination AP_Declination: fixed example build 2014-08-13 22:11:30 +10:00
AP_EPM EPM: add params for pwm levels add re-grab feature 2014-09-17 21:13:37 +09:00
AP_Frsky_Telem FrSkyTelem: integrate Serial Manager instance 2015-04-01 14:59:18 -07:00
AP_GPS GPS: integrate Serial Manager instance 2015-04-01 14:59:20 -07:00
AP_HAL AP_HAL: allow for default parameter override for PX4 and SITL 2015-04-04 09:01:40 -07:00
AP_HAL_AVR HAL_AVR: fixed example build 2015-02-09 13:08:45 +11:00
AP_HAL_AVR_SITL HAL_SITL: use pthread barriers for synthetic clock synchronisation 2015-04-13 06:05:55 +10:00
AP_HAL_Empty HAL_Empty: added dummy millis64() and micros64() 2014-08-20 07:59:21 +10:00
AP_HAL_FLYMAPLE AP_Baro: split into frontend/backend 2015-01-09 11:50:54 +11:00
AP_HAL_Linux AP_HAL_Linux: fix setting RT priorities 2015-04-14 09:17:20 +10:00
AP_HAL_PX4 HAL_PX4: recover 12k of ram from USB buffers 2015-03-27 15:08:52 -07:00
AP_HAL_VRBRAIN HAL_VRBrain: call parent Util constructor 2015-02-11 20:57:28 +11:00
AP_InertialNav AP_InertialNav: Add method to return EKF height above ground estimate 2015-04-10 11:07:27 +09:00
AP_InertialSensor AP_InertialSensor: check for zero delta_velocity dt 2015-04-03 15:10:47 -07:00
AP_L1_Control AP_L1_Control: fixed uTurn-wobble 2015-04-08 15:21:02 -07:00
AP_LandingGear LandingGear: command_mode becomes enum 2015-01-07 11:58:22 +09:00
AP_Limits AP_Limits: convert to using StorageManager 2014-08-13 18:46:43 +10:00
AP_Math AP_Math: add conversions to and from 3-1-2 euler angles 2015-04-07 21:20:51 -07:00
AP_Menu AP_Menu: fixed example build 2014-08-13 22:12:08 +10:00
AP_Mission Mission: support do-mount-control 2015-03-21 21:52:19 +09:00
AP_Motors Motors: Use _motor_to_channel_map in tricopter consistently. 2015-04-09 11:43:22 +09:00
AP_Mount AP_Mount: fixed for new GIMBAL_REPORT message 2015-04-06 16:42:23 -07:00
AP_NavEKF AP_NavEKF: Fix bug allowing terrain to be above vehicle position 2015-04-11 15:51:08 +09:00
AP_Navigation AP_Navigation: added a turn_distance() method with turn_angle 2014-06-05 09:33:42 +10:00
AP_Notify Notify: ToneAlarm fix to stopping continuous tones 2015-04-13 17:44:45 +09:00
AP_OpticalFlow AP_OpticalFlow: Add parameter to compensate for flow sensor yaw angle 2015-04-10 11:07:31 +09:00
AP_Parachute AP_Parachute.cpp: Typo correction. 2015-02-13 16:16:10 +09:00
AP_Param AP_Param: allow a HAL_PARAM_DEFAULTS_PATH to override defaults 2015-04-04 09:01:40 -07:00
AP_PerfMon PerfMon: fix example sketch 2015-01-28 17:15:49 +09:00
AP_Progmem AP_Progmem: only AVR uses progmem 2013-09-28 21:24:02 +10:00
AP_Rally Rally: reduce distance limit to 300m for copter 2015-01-06 15:55:47 +09:00
AP_RangeFinder AP_RangeFinder: use RNGFND_OFFSET for distance offset in PWM and I2C 2015-04-04 17:03:00 -07:00
AP_RCMapper AP_RCMapper: Added warning to RCMAP_THROTTLE 2014-06-17 21:04:19 +10:00
AP_Relay Relay: param descr match labels for Pixhawk 2014-11-15 12:49:02 -08:00
AP_Scheduler Scheduler: fix example sketch 2015-01-28 17:15:51 +09:00
AP_SerialManager AP_SerialManager: use protocol_match in find_baudrate 2015-04-08 09:14:31 -07:00
AP_ServoRelayEvents ServoRelayEvents: init members to resolve compiler warning 2014-08-14 11:27:35 +09:00
AP_SpdHgtControl AP_SpdHgtControl: added get_land_sinkrate() 2014-12-15 21:51:07 +11:00
AP_TECS AP_TECS: added TECS_LAND_PMAX 2015-03-19 14:46:41 +11:00
AP_Terrain AP_Terrain: fixed a warning 2014-10-22 18:27:20 +11:00
AP_Vehicle AP_Vehicle: expose LAND_FLARE_SEC in vehicle parameters for fixed wing 2015-03-15 13:52:34 +11:00
APM_Control APM_Control: raise default IMAX to 3000 2015-02-19 16:15:33 +11:00
APM_OBC APM_OBC: added heartbeat() method 2014-09-24 12:02:38 +10:00
APM_PI APM_PI: fixed indent-tabs-mode 2013-05-30 09:54:53 +10:00
DataFlash DataFlash: example no longer builds with APM2 2015-03-26 06:32:00 -07:00
doc Checking these in makes the libraries too bulky. We need to host them somewhere. 2011-01-04 06:22:02 +00:00
Filter Filter: LowPassFilter gets another div-by-zero check 2015-04-01 10:34:28 -07:00
GCS_Console GCS_Console: fixed example build 2014-08-13 21:48:36 +10:00
GCS_MAVLink GCS_MAVLink: regenerate without mavlink_frame_char changes 2015-04-06 16:43:02 -07:00
PID PID: fixed example build 2014-08-13 22:12:24 +10:00
RC_Channel RC_Channel: fixed usage of _reverse to be consistent 2015-02-18 12:47:56 +11:00
SITL SITL: added SIM_GPSDRIFTALT simulation control 2015-02-21 08:32:49 +11:00
StorageManager StorageManager: cope with a wider range of storage sizes 2014-08-13 21:35:26 +10:00