Commit Graph

10592 Commits

Author SHA1 Message Date
Lucas De Marchi 2a953c4e35 AP_HAL_Linux: add missing casts
These errors were all over the VideoIn.cpp file:

libraries/AP_HAL_Linux/VideoIn.cpp: In member function 'bool Linux::VideoIn::allocate_buffers(uint32_t)':
libraries/AP_HAL_Linux/VideoIn.cpp:107:15: error: invalid conversion from 'uint32_t {aka unsigned int}' to 'v4l2_memory' [-fpermissive]
     rb.memory = _memtype;
               ^
libraries/AP_HAL_Linux/VideoIn.cpp: In member function 'bool Linux::VideoIn::set_format(uint32_t*, uint32_t*, uint32_t*, uint32_t*, uint32_t*)':
libraries/AP_HAL_Linux/VideoIn.cpp:169:14: error: invalid conversion from 'int' to 'v4l2_buf_type' [-fpermissive]
     fmt.type = V4L2_CAP_VIDEO_CAPTURE;
              ^

Add proper casts to fix the compilation.
2015-12-18 17:56:06 +11:00
Lucas De Marchi ba5dd88a0b AP_HAL_Linux: move mt9v117 patches inside class
Let it be a static const member instead of defining it in a header. The
problem with the header is that it will generate conflicting symbols
when more than 1 compilation unit includes it.
2015-12-18 17:56:06 +11:00
Julien BERAUD a32738fd5f AP_OpticalFlow: Update test declaration
Declare a dummy vehicle to get a dummy ahrs. No problem since this code
is not used apart from compilation. Needed to declare an optical flow.
2015-12-18 17:56:06 +11:00
Julien BERAUD 780104dc9c GCS_MAVLink: Fix build
Optical Flow definition is needed
2015-12-18 17:56:06 +11:00
Julien BERAUD 924a94633d AP_AHRS: Fix build
Due to interdependancy between optical flow and AHRS, it is not possible
to include full class definition which rely on each other
2015-12-18 17:56:06 +11:00
Julien BERAUD 6f55f3734c AP_HAL_Linux: Add optflow declaration
Add an empty driver for boards that are not bebop
2015-12-18 17:56:05 +11:00
Lucas De Marchi 8b21dc9b22 AP_OpticalFlow: follow coding style
- use pragma once
 - sort headers
 - add missing header - always include what you are using in the header
2015-12-18 17:56:05 +11:00
Julien BERAUD c5cca02bc8 AP_OpticalFlow: Add support for onboard optflow
Onboard Optical flow needs to have access to the ahrs to get
correct gyro values.
Therefore the constructor takes the ahrs as a param like it is done
for other classes that need to have access to these datas
2015-12-18 17:56:05 +11:00
Julien BERAUD eccef24fa7 AP_HAL: Add optical flow params for bebop
Params that are necessary for optical flow
2015-12-18 17:56:05 +11:00
Julien BERAUD f13cd00e59 AP_HAL_Linux: Update namespace and private
Add new interfaces for optical flow
2015-12-18 17:56:05 +11:00
Lucas De Marchi 83c50e12ca AP_HAL_Linux: OpticalFlow_Onboard: follow coding style
- Remove commented out defines
 - Sort headers
 - Remove ifdef for HAL_BOARD_SUBTYPE_LINUX_BEBOP inside the same ifdef
 - Use AP_HAL::panic() instead of perror
 - AP_HAL::panic() message doesn't take a '\n' and there's no return
   statement after a call to this function
 - Fix pointer placement
 - Use pragma once
 - Don't initialize members to 0, it's already the default behavior of
   our custom allocator
2015-12-18 17:56:05 +11:00
Julien BERAUD ea89308d90 AP_HAL_Linux: Add Onboard Optical Flow interface
Implementation of AP_HAL::OpticalFlow for an embedded camera sensor

There is the possibility to record video and also the gyro datas in order
to process the video off-board and debug possible issues.
2015-12-18 17:56:05 +11:00
Lucas De Marchi db5f49f49f AP_HAL_Linux: Flow_PX4: follow coding style
- Replace tabs with spaces
 - Sort headers
 - Fix curly braces placement
 - Use pragma once
2015-12-18 17:56:05 +11:00
Julien BERAUD 0476e698af AP_HAL_Linux: Flow_PX4 interface
Implementation of the PX4 flow algorithm for ardupilot.
Based on the original PX4 Flow code, it has diverged a lot.
I have kept the license header since it is required.
I have removed all the unused and dead code on current implementation,
modified the code to make it clearer, re-indented it and changed
the way some params are calculated. It has been tested on PC and
on board and showed results that I assumed were OK. No optical flow
Loiter tests have been undertaken since it requires a Sonar which will
be added soon.

Limitations :
Some parts were written in ARM assembly and I rewrote them very naively
to get them to be more easily portable. A simple optimisation would be
to re-introduce assembly code for ARM as a separate asm file with
methods for fixed resolutions that would reduce a lot the amount of
calculation and memory read/writes. Then writing a version in NEON
assembly would even be more optimised and then maybe an Intel version.
2015-12-18 17:56:05 +11:00
Lucas De Marchi c75704bde3 AP_HAL_Linux: VideoIn: follow coding style and minor fixes
- No need to if/else if just returning
 - Sort includes
 - Fix missing space in log message
 - When closing the fd, set it to -1. It's better to later fail the
   operation than to operate on another random file descriptor
 - Add some spaces to improve readability
 - Use pragma once
 - Do not initialize members to zero, it's already the behavior for our
   custom allocator
2015-12-18 17:56:05 +11:00
Julien BERAUD 25df4d03ff AP_HAL_Linux: Add support for Video Input
VideoIn class is created that allows to setup a v4l2 interface
and capture buffers. I is based on yavta utility by Laurent Pinchart
and has been tested only on the bebop, though yavta works on any linux
platform.
2015-12-18 17:56:04 +11:00
Lucas De Marchi 24d20f89c4 AP_HAL_Linux: make CameraSensor follow coding style
- Replace tabs with spaces
 - Sort includes
 - No need to ifdef Linux inside AP_HAL_Linux
 - Use early returns on error rather than a chain o if/else
 - Use pragma once
 - No need to initialize class members to 0, it's already our default
   behavior
2015-12-18 17:56:04 +11:00
Julien BERAUD c84d9bf702 AP_HAL_Linux: Add support for mt9v117 camera
The camera sensor is connected on i2c bus for config
and on a parallel bus on the main SoC.
Currently, the i2c driver remains userland, but this is intended to
change in the future. The v4l2_subdev part is the way to go in the future
and it is the mainline way of configuring i2c camera sensors on Linux.
Currently only the max framerate is supported because it is the one that
is to be used on the bebop optical flow.
2015-12-18 17:56:04 +11:00
Julien BERAUD 736f78a7a2 AP_HAL_VRBRAIN: add empty optical flow
No onboard optical flow on VRBRAIN
2015-12-18 17:56:04 +11:00
Julien BERAUD d8bcb36530 AP_HAL_SITL: add empty optical flow
No embedded optical flow on sitl
2015-12-18 17:56:04 +11:00
Julien BERAUD c0f65ff6e1 AP_HAL_PX4: add empty optical flow
No onboard optical flow on PX4
2015-12-18 17:56:04 +11:00
Lucas De Marchi 0e29a7193a AP_HAL_FLYMAPLE: replace tabs with spaces in HAL_FLYMAPLE_Class 2015-12-18 17:56:04 +11:00
Lucas De Marchi d08d7ce125 AP_HAL_FLYMAPLE: fix indentation 2015-12-18 17:56:04 +11:00
Julien BERAUD c114ad2b95 AP_HAL_FLYMAPLE: add empty optflow driver
no embedded optical flow on flymaple
2015-12-18 17:56:04 +11:00
Lucas De Marchi e825eb12f5 AP_HAL_Empty: follow coding style
- Add some spaces
 - Use pragma once
 - Remove ; from method implementation
 - Remove unneeded return
2015-12-18 17:56:04 +11:00
Lucas De Marchi b3a751a199 AP_HAL_Empty: sort include headers 2015-12-18 17:56:03 +11:00
Julien BERAUD d14f4104ea AP_HAL_Empty: add support for OpticalFlow
Void driver
2015-12-18 17:56:03 +11:00
Lucas De Marchi c7668479bb AP_HAL: follow coding style 2015-12-18 17:56:03 +11:00
Julien BERAUD 2b681f2f13 AP_HAL: Add support for an Optflow driver
This is meant to be used for onboard optical flow
2015-12-18 17:56:03 +11:00
Tom Pittenger d003e24189 AP_ADSB: fix unit conversion 2015-12-18 13:49:47 +09:00
José Roberto de Souza 63e1d0753e AP_Notify: Add a new RGBLed implementation that works over RCOutput
To be used in boards that uses the same PWM chip to generate signal to
control motors and the status led.
2015-12-16 08:18:17 +11:00
José Roberto de Souza d74bd533c8 AP_Math: Add function to convert frequency to/from microseconds 2015-12-16 08:18:17 +11:00
José Roberto de Souza 38575dd87a AP_Math: Fix parameter name in nsec_to_hz() 2015-12-16 08:18:17 +11:00
Julien BERAUD a27d7f8a93 AP_InertialSensor_MPU6000: Fix FIFO reset
Change the sequence. Previous sequence was sometimes causing failure
to initialize the IMU.
2015-12-16 08:16:10 +11:00
Andrew Tridgell 0a36503742 HAL_Linux: fixed a bug with UDP packetisation
this fixes a bug where we would send UDP MAVLink packets larger than 300 bytes
2015-12-14 18:27:11 +11:00
Jonathan Challinger 0a701088d4 AP_Math: fix bug in Quaternion::operator*= 2015-12-14 11:15:33 +09:00
Peter Barker 326e68544c DataFlash: remove unused functions 2015-12-10 10:45:51 +09:00
Julien BERAUD bbf146197c RCOutput_Bebop : Update motor order
Newer esc firmware versions on bebop 1 and all the versions on bebop 2
have a different order for the motors in the i2c frame sent to the
esc contoller. This commit adds support for both versions by reading
the firmware version of the esc, using GET_INFO frame
2015-12-09 20:48:26 +09:00
Randy Mackay c8661f804f AC_AttControl: reduce compiler warnings by fixing member init order
Also increased _dt's default to 400hz (no functional change)
2015-12-09 20:04:42 +09:00
Randy Mackay 02eda4dcab AC_AttControl: remove comment, fix formatting 2015-12-09 20:04:32 +09:00
Jonathan Challinger 3c4d226b64 AC_WPNav: call renamed functions in AC_AttitudeControl 2015-12-09 19:58:50 +09:00
Jonathan Challinger e8345fbaab AC_AttitudeControl: rename getters for attitude target and attitude error 2015-12-09 19:58:48 +09:00
Jonathan Challinger 3a06edcee3 AC_AttitudeControl: rename local variable to match naming convention 2015-12-09 19:58:46 +09:00
Jonathan Challinger 846ee7d2af AC_AttitudeControl: fix regression in angular velocity controller 2015-12-09 19:58:45 +09:00
Jonathan Challinger b8223771d3 AC_AttitudeControl: properly protect sqrt_controller from nonpositive acceleration limits 2015-12-09 19:58:44 +09:00
Jonathan Challinger 162d2a9112 AC_AttitudeControl: naming changes in response to Leonard's review 2015-12-09 19:58:42 +09:00
Jonathan Challinger a48f201a04 AC_AttitudeControl: comment changes in response to Paul's review 2015-12-09 19:58:41 +09:00
Jonathan Challinger 0baf86c485 AC_AttitudeControl: fixup more names 2015-12-09 19:58:39 +09:00
Jonathan Challinger 41e580e53a AC_AttitudeControl: add input_att_quat_bf_ang_vel and use for ACRO 2015-12-09 19:58:38 +09:00
Jonathan Challinger 5919e95635 AC_AttitudeControl: add input_ prefix to input shaper functions 2015-12-09 19:58:36 +09:00
Jonathan Challinger bba360ea2b AC_AttitudeControl: correct bugs found in review 2015-12-09 19:58:35 +09:00
Jonathan Challinger 9208003aab AC_AttitudeControl: remove unused variable 2015-12-09 19:58:34 +09:00
Jonathan Challinger f8c709478a AC_AttitudeControl: quaternion acro controller 2015-12-09 19:58:33 +09:00
Jonathan Challinger 8b886bc479 AC_AttitudeControl: minor comment changes and reorganization 2015-12-09 19:58:32 +09:00
Jonathan Challinger edda7e4e1e AC_AttitudeControl: keep _att_target_euler_deriv_rads updated in euler_angle_roll_pitch_yaw 2015-12-09 19:58:31 +09:00
Jonathan Challinger 1afab89991 AC_AttitudeControl: extensive renaming and recommenting 2015-12-09 19:58:29 +09:00
Jonathan Challinger 06c8457efd AC_AttitudeControl: rename and modify frame_conversion functions to follow conventions 2015-12-09 19:58:27 +09:00
Jonathan Challinger 7330de86e5 AC_AttitudeControl: change internals to use radians instead of centidegrees 2015-12-09 19:58:26 +09:00
Jonathan Challinger fff275fd99 AP_Math: add wrap_2PI 2015-12-09 19:58:25 +09:00
Tom Pittenger 37054d9571 SITL: update units for new adsb mavlink msg 2015-12-09 14:36:30 +11:00
Tom Pittenger 87fccce9e2 AP_ADSB: update units for new mavlink msg 2015-12-09 14:36:30 +11:00
Tom Pittenger 40a84f0589 GCS_MAVLink: recompiled common.xml for adsb 2015-12-09 14:36:29 +11:00
Tom Pittenger 0026b56f0a GCS_MAVLink: updated adsb mavlink msg - remove floats
- convert altitude from float m/s to int32 mm/s
- convert velocities from float m/s to uint16 cm/s
2015-12-09 14:36:29 +11:00
Tom Pittenger decac5cb15 AP_ADSB: delete furthest when buffer is full
- added lowest/highest_threat tracking. This is currently defined as 2D distance. Room for improvement to make it 3D and be flight vector based instead of distance
- when trying to add a vehicle but  the buffer is full, overwrite the lowest_threat/furthest
- added basic THREAT enum of high/low which means in or our of the 200m radius. Room for improvement here.
2015-12-09 14:35:20 +11:00
Tom Pittenger 7236b48518 SITL: compiler warning: double to float demotion
- replace atof() with strtof() for the correct return time
2015-12-08 14:54:58 +09:00
Tom Pittenger 48ae0d645d AP_HAL_SITL: compiler warning: float to double promotion
- replace atof() with strtof() for the correct return time
2015-12-08 14:54:43 +09:00
Lucas De Marchi 4f012b2b32 AP_HAL_Empty: sort namespace classes 2015-12-08 11:12:14 +11:00
Lucas De Marchi a9def97344 AP_HAL_VRBRAIN: rename AP_HAL_Empty instances 2015-12-08 11:12:14 +11:00
Lucas De Marchi c72f812944 AP_HAL_SITL: rename AP_HAL_Empty instances 2015-12-08 11:12:14 +11:00
Lucas De Marchi 503533c6fe AP_HAL_PX4: rename AP_HAL_Empty instances 2015-12-08 11:12:14 +11:00
Lucas De Marchi 6011eefb55 AP_HAL_Linux: rename AP_HAL_Empty instances 2015-12-08 11:12:14 +11:00
Lucas De Marchi 2ffb08b9ca AP_HAL_Empty: remove prefix from classes
Like was done for AP_HAL_Linux in 2ac96b9 ("AP_HAL_Linux: remove prefix
from AP_HAL_Linux classes"), remove the "Empty" prefix from class names
since we are already inside the Empty namespace.
2015-12-08 11:12:14 +11:00
Lucas De Marchi f69208d47d AP_HAL: remove state leftover from SPIDeviceDriver
This was previously used to allow to save a state in a SPIDriver so we
could synchronize the initialization of AP_Compass and
AP_InertialSensor.

It was only used by MPU9250 and is not used anymore since the move to
AuxiliaryBus initialization and it's not used anymore since c3dae6f
("AP_InertialSensor: MPU9250: Remove methods not used anymore")
2015-12-08 11:10:23 +11:00
Lucas De Marchi 27dafa8f1b AP_HAL_Linux: remove state leftover from SPIDeviceDriver
This was previously used to allow to save a state in a SPIDriver so we
could synchronize the initialization of AP_Compass and
AP_InertialSensor.

It was only used by MPU9250 and is not used anymore since the move to
AuxiliaryBus initialization and it's not used anymore since c3dae6f
("AP_InertialSensor: MPU9250: Remove methods not used anymore")
2015-12-08 11:10:23 +11:00
Peter Barker 7900359fac DataFlash: LOG_FILE_BUFSIZE sets buffer size for DataFlash_File 2015-12-08 10:59:57 +11:00
Tom Pittenger c118130dda DataFlash: fixed mispelling
@param label was different than everywhere else that did not use plurl
2015-12-08 08:23:07 +09:00
Robert Lefebvre 59a44008d7 AP_RPM: Move timeout check into synthetic quality check. 2015-12-08 08:25:19 +11:00
Robert Lefebvre fd106b20c7 AP_RPM: Add Minimum Quality Parameter 2015-12-08 08:25:19 +11:00
Robert Lefebvre 1f8b90e876 AP_RPM: Move filter step outside of min/max rpm check 2015-12-08 08:25:19 +11:00
Robert Lefebvre f04668307d AP_RPM: Add Minimum RPM parameter 2015-12-08 08:25:18 +11:00
Robert Lefebvre 968599b795 AP_RPM: Add Signal Quality synthetic method. 2015-12-08 08:25:18 +11:00
Robert Lefebvre 77877ba5fc ModeFilter: Add get() method and support for Float type 2015-12-08 08:25:18 +11:00
Robert Lefebvre a08fa50fda AP_RPM: Add enabled() method to check if sensor is enabled 2015-12-08 08:25:18 +11:00
Michael Oborne 1c1eea6119 AP_GPS_SBF: add sd logging by default, improve init 2015-12-07 21:56:44 +09:00
Michael Oborne 0bcc6e324a AP_GPS_SBF: formatting fixes 2015-12-07 21:56:42 +09:00
Tom Pittenger f8b0a6a977 AP_Math: compiler warnings - undeclared function 2015-12-07 16:05:00 +09:00
Tom Pittenger 103af93ec3 AP_Math: compiler warnings - float compare to constant (zero) 2015-12-07 16:04:59 +09:00
Tom Pittenger 41746733fe AP_Common: remove crazy #define float double
- not creating a warning buuuuuut this is just sooooo bad that it must be nuked on the spot
2015-12-07 15:50:07 +09:00
Tom Pittenger 4e3864049a DataFlash: compile warning - float to double promotion 2015-12-07 15:50:03 +09:00
Tom Pittenger 4ee2fb6c7a Filter: compiler warnings - unused template <double> 2015-12-07 15:50:00 +09:00
Tom Pittenger 0aa0380db8 AP_Compass: compiler warnings - float to float compare and bool cast 2015-12-07 15:49:58 +09:00
Gustavo Jose de Sousa 3035fb282d DataFlash: fix example 2015-12-07 15:42:04 +09:00
Robert Lefebvre 3a13db9333 AP_MotorsHeli: Add more parameter checks. 2015-12-07 14:51:42 +09:00
Andrew Tridgell 58f0abaf4c AC_AttitudeControl: fixed one usage of zero accel limits
in other places zero accel limit means no limit
2015-12-07 13:43:14 +09:00
Andrew Tridgell 78e9b0a4e3 HAL_PX4: check for servo counts changing after boot
this copes with changes to BRD_PWM_COUNT
2015-12-06 14:19:28 +11:00
Lucas De Marchi 5678ae54db AP_ADC_AnalogSource: remove unused library 2015-12-03 13:32:45 +11:00
Lucas De Marchi cee770f5f7 StorageManager: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:44 +11:00
Lucas De Marchi e8e48fd8e0 RC_Channel: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:44 +11:00
Lucas De Marchi 9f0ff6ec24 GCS_MAVLink: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:44 +11:00
Lucas De Marchi f584543ea1 DataFlash: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:44 +11:00
Lucas De Marchi c59490677d AP_Scheduler: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:44 +11:00
Lucas De Marchi fb24056ca9 AP_RangeFinder: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:44 +11:00
Lucas De Marchi 1ba22398a5 AP_OpticalFlow: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:44 +11:00
Lucas De Marchi a4213166ae AP_Notify: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:44 +11:00
Lucas De Marchi f1de9c25fe AP_Mount: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:43 +11:00
Lucas De Marchi c9d1456a66 AP_Motors: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:43 +11:00
Lucas De Marchi 3818a8a703 AP_Mission: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:43 +11:00
Lucas De Marchi f5c03c786d AP_Math: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:43 +11:00
Lucas De Marchi e1d90c78d8 AP_InertialSensor: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:43 +11:00
Lucas De Marchi fe5d6f2d49 AP_HAL_PX4: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:43 +11:00
Lucas De Marchi a1c3912bd8 AP_HAL: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:43 +11:00
Lucas De Marchi 2b5417046b AP_GPS: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:43 +11:00
Lucas De Marchi 0bcbcd07cc AP_Compass: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:42 +11:00
Lucas De Marchi 0a1dbab24e AP_BattMonitor: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:42 +11:00
Lucas De Marchi 5b1769cd2b AP_Baro: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:42 +11:00
Lucas De Marchi 7c78955591 AP_Airspeed: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:42 +11:00
Lucas De Marchi 2b26a2eebe AP_AHRS: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:42 +11:00
Lucas De Marchi 247195512f AC_PID: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:42 +11:00
Andrew Tridgell 3a3394ce36 HAL_AVR: fixed branch URL for AVR 2015-12-03 13:28:51 +11:00
Andrew Tridgell 3fcda53d11 GCS_MAVLink: regenerated headers 2015-12-03 13:21:52 +11:00
Peter Barker 4f1a7c6427 DataFlash: remove use of AddLogFormats 2015-12-03 13:21:52 +11:00
Peter Barker 0f9e7a905d AP_GPS: remove use of AddLogFormats 2015-12-03 13:21:52 +11:00
Peter Barker 0ca07e5245 DataFlash: DataFlash-over-MAVLink support 2015-12-03 13:21:51 +11:00
Peter Barker 31b8432545 GCS_MAVLink: add remote logging messages 2015-12-03 13:21:51 +11:00
Peter Barker faabe0b83d DataFlash: support multiple simultaneous backends 2015-12-03 13:21:51 +11:00
Peter Barker 121967d1b1 DataFlash: factor log structures into LogStructures.h (no functional change 2015-12-03 13:21:51 +11:00
Michael du Breuil 2f97f9f416 AP_GPS: Fix incorrect values docstring on RAW_DATA 2015-12-03 10:17:22 +09:00
Gustavo Jose de Sousa eef784fbe6 AP_Math: add benchmark for matrix multiplication 2015-12-03 07:54:31 +11:00
Gustavo Jose de Sousa 4266e924d0 AP_Math: add unit test for vector rotations
This unit test already shows that rotation is wrong for
ROTATION_YAW_293_PITCH_68_ROLL_90.
2015-12-03 07:54:31 +11:00
Caio Marcelo de Oliveira Filho 6e7b73610d waf: add waf support 2015-12-03 07:54:30 +11:00
Lucas De Marchi 6d7678d2a3 AP_HAL_PX4: fix passing callback to member function
This is the same approach as done for AP_HAL_Linux in e3d78b8 ("AP_HAL_Linux:
fix passing callback to member function"). It fixes the following warnings:

ardupilot/libraries/AP_HAL_PX4/Scheduler.cpp: In member function 'virtual void PX4::PX4Scheduler::init(void*)':
ardupilot/libraries/AP_HAL_PX4/Scheduler.cpp:55:95: warning: converting from 'void* (PX4::PX4Scheduler::*)()' to 'pthread_startroutine_t {aka void* (*)(void*)}' [-Wpmf-conversions]
  pthread_create(&_timer_thread_ctx, &thread_attr, (pthread_startroutine_t)&PX4::PX4Scheduler::_timer_thread, this);
                                                                                               ^
ardupilot/libraries/AP_HAL_PX4/Scheduler.cpp:65:94: warning: converting from 'void* (PX4::PX4Scheduler::*)()' to 'pthread_startroutine_t {aka void* (*)(void*)}' [-Wpmf-conversions]
  pthread_create(&_uart_thread_ctx, &thread_attr, (pthread_startroutine_t)&PX4::PX4Scheduler::_uart_thread, this);
                                                                                              ^
ardupilot/libraries/AP_HAL_PX4/Scheduler.cpp:75:92: warning: converting from 'void* (PX4::PX4Scheduler::*)()' to 'pthread_startroutine_t {aka void* (*)(void*)}' [-Wpmf-conversions]
  pthread_create(&_io_thread_ctx, &thread_attr, (pthread_startroutine_t)&PX4::PX4Scheduler::_io_thread, this);
                                                                                            ^
ardupilot/libraries/AP_HAL_PX4/Scheduler.cpp:85:100: warning: converting from 'void* (PX4::PX4Scheduler::*)()' to 'pthread_startroutine_t {aka void* (*)(void*)}' [-Wpmf-conversions]
     pthread_create(&_storage_thread_ctx, &thread_attr, (pthread_startroutine_t)&PX4::PX4Scheduler::_storage_thread, this);

ardupilot/libraries/AP_HAL_PX4/NSHShellStream.cpp: In member function 'void PX4::NSHShellStream::start_shell()':
ardupilot/libraries/AP_HAL_PX4/NSHShellStream.cpp:83:99: warning: converting from 'void (PX4::NSHShellStream::*)()' to 'pthread_startroutine_t {aka void* (*)(void*)}' [-Wpmf-conversions]
     pthread_create(&shell_thread_ctx, &thread_attr, (pthread_startroutine_t)&PX4::NSHShellStream::shell_thread, this);
                                                                                                   ^
2015-12-03 07:51:08 +11:00
Lucas De Marchi 036eb21c09 AP_HAL: remove init() method with unused argument 2015-12-02 14:49:12 -02:00
Lucas De Marchi bf24d0ef31 AP_HAL_VRBRAIN: use init() method without arguments
Override the init() method from parent class that doesn't have a
parameter since it's not used here.
2015-12-02 14:49:12 -02:00
Lucas De Marchi 4c82c535cc AP_HAL_SITL: use init() method without arguments
Override the init() method from parent class that doesn't have a
parameter since it's not used here.
2015-12-02 14:49:11 -02:00
Lucas De Marchi 0c3733601b AP_HAL_PX4: use init() method without arguments
Override the init() method from parent class that doesn't have a
parameter since it's not used here.
2015-12-02 14:49:11 -02:00
Lucas De Marchi 2439826c19 AP_HAL_Linux: use init() method without arguments
Override the init() method from parent class that doesn't have a
parameter since it's not used here.
2015-12-02 14:49:11 -02:00
Lucas De Marchi 0514aadaec AP_HAL_FLYMAPLE: use init() method without arguments
Override the init() method from parent class that doesn't have a
parameter since it's not used here.
2015-12-02 14:49:11 -02:00
Lucas De Marchi 00f17466a8 AP_HAL_Empty: use init() method without arguments
Override the init() method from parent class that doesn't have a
parameter since it's not used here.
2015-12-02 14:49:11 -02:00
Lucas De Marchi 6bc07da0ee AP_HAL: use init() method without arguments
Override the init() method from parent class that doesn't have a
parameter since it's not used here.
2015-12-02 14:42:37 -02:00
Lucas De Marchi 6b1c5e6f72 AP_HAL: add init() method without argument
The argument in init() is not used by any implementation. Add a second
method without it so the HAL implementation can used it instead. Later
the unused method will be removed.
2015-12-02 14:21:58 -02:00
Tom Pittenger f60f0e80c3 AP_ADSB: update msg sizeof comment 2015-12-01 17:15:49 -08:00
Tom Pittenger 55f84e9c05 SITL: update ADSB for squawk 2015-12-01 17:13:02 -08:00
Tom Pittenger c0c3500d06 GCS_MAVLink: regenerate headers 2015-12-01 17:12:20 -08:00
Tom Pittenger 5a9e632ace GCS_MAVLink: added squawk to ADSB_vehicle msg 2015-12-01 17:11:44 -08:00
Lucas De Marchi 49abb78372 AP_HAL_Linux: fix warning due to derived PWM_Sysfs
PWM_Sysfs derives from PWM_Sysfs_Base which was not update to have a
virtual destructor. Make PWM_Sysfs_Base's constructor virtual.
2015-12-02 10:43:43 +11:00
Lucas De Marchi 8eee888b3e AP_Baro: BMP085: move data-ready macro to a method 2015-12-02 10:40:50 +11:00
Lucas De Marchi c5e97129c1 AP_Baro: BMP085: follow coding style
- Spacing changes and variable renames to follow coding style
 - No need to initialize variables to 0, it's already done by our
   global new operator.
2015-12-02 10:40:50 +11:00
Lucas De Marchi 81a298c9c8 AP_Baro: reduce header scope
We don't need to expose to other libraries how each backend is
implemented. AP_Baro.h is the main header, included by other libraries.

Instead of including each backend in the main header, move them to where
they are needed. Additionally standardize the order and how we include
the headers.

The advantages are:
	- Internals of each backend is not exposed outside of the
	  library
	- Faster incremental builds since we don't need to recompile
	  whoever includes AP_Baro.h because a backend changed
2015-12-02 10:40:50 +11:00
Lucas De Marchi 30f631de8f AP_Baro: MS5637: fix CRC check
The configuration of MS5637 is different from MS5611 in 2 ways:

    - The PROM is of 112 bytes rather than 128
    - The CRC is located in the first MSB of the first word, not the
      last one

For CRC calculation we also need to zero out the last (missing) word.

This renames _check_crc() to _read_prom(), which returns false when the
PROM doesn't contain valid data. It also makes it virtual so MS5637 can
override it. This also moves the PROM read to be all in the same place
rather than split between the CRC field and coefficient fields. Finally
calculate_crc() is renamed to crc4() to be shorter and add info on what
it does.
2015-12-02 10:38:09 +11:00
José Roberto de Souza 7457588d7c AP_Baro: Move initialisation code from MS56XX constructor to init()
On MS5637 we will need to override the method to read and calculate the
PROM's crc. Thus we need a 2-phase init.

It also makes the constructor of AP_Baro_MS56XX protected since only the
derived classes should instantiate the base one.
2015-12-02 10:38:09 +11:00
José Roberto de Souza 29791c9cec AP_Baro: Make _check_crc more readable 2015-12-02 10:38:09 +11:00
Lucas De Marchi fef364e4e8 AP_TECS: avoid comparison between signed and unsigned 2015-12-01 16:28:18 -02:00
Lucas De Marchi aa9168e0e9 AP_Math: remove unused maxf() 2015-12-01 16:28:18 -02:00
Lucas De Marchi 798b743660 AP_NavEKF: use MAX() instead of maxf() 2015-12-01 16:28:18 -02:00
Lucas De Marchi 6f88fba8e5 AP_Math: remove unused minf() 2015-12-01 16:28:18 -02:00
Lucas De Marchi e0a0514c79 AP_Math: turn MIN/MAX macros into inline functions
The problem with the current MIN/MAX macros is that they evaluate twice
the arguments. For example, these cases provide unintended results:

	// a is incremented twice
	a = MIN(a++, b);
	// foo() with side-effects
	a = MIN(foo(), b);

The alternative implementation here was provided by Daniel Frenzel using
template function. It doesn't have type safety as std::min and std::max,
but adding type safety would mean to check case by case what would be a
reasonable type and add proper casts. Here the arguments for MIN and MAX
can have different types and the return type is deduced from the
expression in the function.

Inspecting the current callers no place was found with the unintended
results above, but some in which now we don't calculate twice the
parameters will benefit from this new version. Examples:

	float velocity_max = MIN(_pos_control.get_speed_xy(), safe_sqrt(0.5f*_pos_control.get_accel_xy()*_radius));

	float acro_level_mix = constrain_float(1-MAX(MAX(abs(roll_in), abs(pitch_in)), abs(yaw_in))/4500.0, 0, 1)*ahrs.cos_pitch()

	accel_x_cmss = (GRAVITY_MSS * 100) * (-(_ahrs.cos_yaw() * _ahrs.sin_pitch() / MAX(_ahrs.cos_pitch(),0.5f)) - _ahrs.sin_yaw() * _ahrs.sin_roll() / MAX(_ahrs.cos_roll(),0.5f));

	track_leash_slack = MIN(_track_leash_length*(leash_z-track_error_z)/leash_z, _track_leash_length*(leash_xy-track_error_xy)/leash_xy);

	RC_Channel_aux::move_servo(RC_Channel_aux::k_sprayer_pump, MIN(MAX(ground_speed * _pump_pct_1ms, 100 *_pump_min_pct),10000),0,10000);
2015-12-01 16:28:18 -02:00
Lucas De Marchi 2591261af6 Global: rename min and max macros to uppercase
The problem with using min() and max() is that they conflict with some
C++ headers. Name the macros in uppercase instead. We may go case by
case later converting them to be typesafe.

Changes generated with:

	git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)max(/\1MAX(/g'
	git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)min(/\1MIN(/g'
2015-12-01 16:28:09 -02:00
Andrew Tridgell 1e8c391024 AP_AHRS: fixed float exception on start in SITL
zero DCM matrix
2015-12-01 15:19:45 +11:00
Lucas De Marchi d19c5035b6 Global: Rename printf format attribute
As commented in 8218140 ("AP_Common: add scanf format macro"), "FORMAT"
was a bad name for this macro since there's also the scanf. Rename to
FMT_PRINTF to follow the scanf name.
2015-12-01 07:22:12 +11:00
Andrew Tridgell 520b9de48a HAL_PX4: expose do_transfer() in API 2015-12-01 07:18:25 +11:00
Andrew Tridgell 44c280e9fb AP_HAL: fixed typo in do_transfer declaration 2015-12-01 07:18:10 +11:00
Julien BERAUD 88236821c0 AP_HAL_Linux: Adapt Heat_Pwm to use PWM_Sysfs
Only compiled on Bebop, the constructor will need to be modified to
pass the pwm chip number and to create a PWM_Sysfs instead of a PWM_Sysfs_Bebop
in case it is used on a mainline linux board
2015-12-01 07:07:26 +11:00
Julien BERAUD 0fa362ff5c AP_Notify: Fix GPIO declaration for Linux boards
Currently, the default behaviour on linux boards tries to
write LED gpios with fixed values among them. There is no way
to declare that there are no LED GPIOs.
This commit moves the declaration of the LED Gpios in AP_HAL_Boards.h
and makes AP_Notify do nothing if no LED gpio was declared
2015-12-01 07:07:26 +11:00
Julien BERAUD 8c4803af10 AP_HAL_Linux: GPIO Sysfs for Bebop
copied from minlure implementation
2015-12-01 07:07:26 +11:00
Julien BERAUD 2136866594 AP_HAL_Linux: fix I2CDriver indentation
Tabs to spaces
2015-12-01 07:07:26 +11:00
Julien BERAUD af6bbb806e AP_HAL: add do_transfer method to I2CDriver
Needed in linux HAL
2015-12-01 07:07:26 +11:00
Julien BERAUD 26163b6640 AP_HAL_Linux: Add do_transfer method to i2c driver
Method needed for mt9v117 camera sensor
2015-12-01 07:07:26 +11:00
Lucas De Marchi 04f601d42f AP_HAL_Linux: PWM_Sysfs: minor changes to Bebop/mainline integration
- Make error path in constructor shorter and earlier. It's calling
    panic() so there's no reason to do anything else

  - We don't need to check variable for NULL when calling free()

  - Change set/get_polarity to use a virtual function; this allows us
    not to fail silently if _polarity_path is NULL for PWM_Sysfs.
    PWM_Sysfs_Bebop just overrides this method and implement an empty
    version.
2015-12-01 07:07:25 +11:00
Julien BERAUD 8733f34ce1 AP_HAL_Linux: PWM_Sysfs for bebop
Modify existing class to create a PWM_Sysfs_Base class and derive it for
Bebop and Pwm_Sysfs (mainline kernel)

use asprintf for path allocation since it doesn't cost so much and is done
only at startup
Note that the constructor of the 2 classes : PWM_Sysfs and PWM_Sysfs_Bebop
allocate the paths and the constructor and desctuctor of class PWM_Sysfs_Base
frees them.
only keep in memory the paths that are needed later, i.e free _export_path,
_duty_path. The remaining path are freed in the destructor
2015-12-01 07:07:25 +11:00
Andrew Tridgell 52f2fce1d5 RC_Channel: prevent float exception with bad RCn_MIN/MAX/TRIM
thanks to Michael for finding this
2015-11-30 21:53:54 +11:00
Andrew Tridgell 335e621932 HAL_PX4: cope with PX4 header changes 2015-11-27 18:54:31 +11:00
Andrew Tridgell ea38448372 AP_Relay: don't default to using two PWMs as relays on FMUv4 2015-11-27 18:54:31 +11:00
Andrew Tridgell 155e82c1b3 HAL_PX4: fixed PWM output for FMUv4 2015-11-27 18:54:31 +11:00
Andrew Tridgell c34100f6a2 GCS_MAVLink: support FMUv4 2015-11-27 18:54:30 +11:00
Andrew Tridgell 774e257a88 AP_InertialSensor: support FMUv4 2015-11-27 18:54:30 +11:00
Andrew Tridgell 9835043dd5 HAL_PX4: support FMUv4 2015-11-27 18:54:30 +11:00
Andrew Tridgell 8739c55d27 AP_Common: added ID for FMUv4 2015-11-27 18:54:30 +11:00
Andrew Tridgell 6dd45998f4 AP_BattMonitor: support FMUv4 2015-11-27 18:54:30 +11:00
Andrew Tridgell d8ee9feaac AC_AttitudeControl: fixed external tail gyro with no flybar
this sets up the tail pass-through for acro mode
2015-11-27 15:24:41 +09:00
Andrew Tridgell 47b9f6598a AP_Motors: allow change to heli rotor speed controls while armed
this helps a lot with tuning for gas helis
2015-11-27 15:12:03 +09:00
Randy Mackay 9e74222a3a ADSB: minor update to parameter descriptions
Also minor format fixes
2015-11-27 15:02:22 +09:00
Andrew Tridgell e80ca592c4 AP_ADSB: update for new message format 2015-11-26 10:25:33 +11:00
Andrew Tridgell 2804434596 SITL: update ADSB for new format 2015-11-26 10:25:18 +11:00
Andrew Tridgell 76209de08e GCS_MAVLink: regenerate headers 2015-11-26 10:25:08 +11:00
Andrew Tridgell 2c7bfc7984 GCS_MAVLink: update ADSB_VEHICLE message 2015-11-26 10:24:56 +11:00
Paul Riseborough ddb7d92fc8 AP_NavEKF2: Fix timing jitter in airspeed fusion
The airspeed observation buffer was only being checked when new data arrived instead of every frame which introduced some timing jitter. The buffer is now checked every filer update step.
The duplication and inconsistent naming of booleans used to indicate availability f data has been fixed.
2015-11-26 09:22:03 +11:00
Luis Vale Gonçalves 5e290daac5 GCS_MAVLink: libraries_Text_revision
text revision of messages
2015-11-26 08:10:15 +11:00
Luis Vale Gonçalves f02e13b107 AP_Terrain: libraries_Text_revision
text revision of messages
2015-11-26 08:10:15 +11:00
Luis Vale Gonçalves 40caec8afb AP_NavEKF: libraries_Text_revision
text revision of messages
2015-11-26 08:10:14 +11:00
Luis Vale Gonçalves e9ba768bae AP_Arming: libraries_Text_revision
text revision of messages
2015-11-26 08:08:58 +11:00
Andrew Tridgell ce1b68cce8 AP_ADSB: ensure stack allocation Location is initialised 2015-11-23 19:48:57 +11:00
Andrew Tridgell f9e865ef5e AP_ADSB: don't disable ADSB permanently on init fail
we may be low on memory on only this boot
2015-11-23 19:47:30 +11:00
Tom Pittenger 426e40d30e AP_ADSB: new ADS-B library support
- contains a list of ADS-B vehicles
- does threat analysis and sets a flag when threat is found
- dynamically allocated database, consumes 40*25 =1kB of RAM when param ADSB_ENABLE = 1
2015-11-23 19:45:40 +11:00
Tom Pittenger bb4f0783ad AP_HAL_SITL: created ADS-B simulator to generate additional ghost aircraft within SITL
- The values are very aggressive, you'll come into contact with another aircraft very soon
- Credit goes to Tridge for this work
- This also allows hardware attached via UART to feed real aircraft into the simulator

This feature is enabled with the following command:
sim_vehicle -A --adsb
2015-11-23 19:45:40 +11:00
Tom Pittenger f88de986bc SITL: created ADSB simulator to generate additional ghost aircraft within SITL
The values are very aggressive, you'll come into contact with another aircraft very soon
Credit goes to Tridge for this work

This feature is enabled with the following command:
sim_vehicle -A --adsb
2015-11-23 19:45:40 +11:00
Tom Pittenger 4b5af2d726 GCS_MAVLink: files generated from new ADSB_VEHICLE msg 2015-11-23 19:45:40 +11:00
Tom Pittenger af93c8da4e GCS_MAVLink: new mavlink msg ADSB_VEHICLE 2015-11-23 19:45:40 +11:00
Siddharth Purohit and Paul Riseborough 3014eb4001 AP_NavEKF2: Rework measurement buffer refactor
These changes were pair coded an tested by Siddharth Purohit and Paul Riseborough

Fix indexing errors
Move buffer code into a separate file
Split observer and IMU/output buffers and remove duplicate sample time
Optimise observation buffer search
Reduce maximum allowed fusion age to 100 msec
2015-11-23 19:42:06 +11:00
Siddharth Bharat Purohit b3c8dcee34 AP_NavEKF2: measurement buffer refactor 2015-11-23 19:34:50 +11:00
Andrew Tridgell 77a67d73e7 SITL: fill in RPM from JSBSim 2015-11-23 14:30:47 +11:00
Andrew Tridgell 45ea2a9b68 AP_RPM: added a SITL RPM backend 2015-11-23 14:30:42 +11:00
Andrew Tridgell 223ce2b6aa SITL: allow FDM models to provide voltage, current and RPM 2015-11-23 13:46:27 +11:00
Andrew Tridgell 7a5c4ec65d HAL_SITL: use battery info from FDM if available 2015-11-23 13:31:29 +11:00
Andrew Tridgell 8b456be8c6 SITL: added battery voltage and rpm to SITL state 2015-11-23 13:31:09 +11:00
Andrew Tridgell 585e6dabb8 SITL: FDM structure is no longer a network protocol structure
remove unused fields and change comments
2015-11-23 13:25:00 +11:00
Andrew Tridgell a6ef064950 HAL_SITL: removed support for the old FDM protocol
we are now fully converted to the new C++ based SITL system
2015-11-23 13:21:33 +11:00
Andrew Tridgell 9cdd5f3944 AP_InertialSensor: catch NAN errors in accel and gyro filters 2015-11-22 17:30:29 +11:00
Andrew Tridgell 5b7f2a3de3 Filter: added reset method on vector filters 2015-11-22 17:30:29 +11:00
Andrew Tridgell b3e6129fd4 AP_AHRS: added EKF type 10 for SITL
this bypasses all attitude and position estimators and uses the SITL
state directly. It can be used for when the SITL backend cannot
provide perfect sensor data
2015-11-22 17:30:28 +11:00
Andrew Tridgell 7b38f2185f AP_AHRS: use the right DCM matrix for right EKF
this fixes a bug where the EKF2 DCM matrix would be used for
get_dcm_matrix() when EKF1 was active
2015-11-20 18:34:08 +11:00
Caio Marcelo de Oliveira Filho 01665282f7 AP_HAL_VRBRAIN: Remove unused extern declaration for HALs 2015-11-20 16:32:57 +09:00
Caio Marcelo de Oliveira Filho bb165d8a4c AP_HAL_SITL: Remove unused extern declaration for HALs 2015-11-20 16:32:45 +09:00
Caio Marcelo de Oliveira Filho c43474fbf4 AP_HAL_PX4: Remove unused extern declaration for HALs 2015-11-20 16:32:32 +09:00
Caio Marcelo de Oliveira Filho 6773e18bc4 AP_HAL_Linux: Remove unused extern declaration for HALs 2015-11-20 16:32:17 +09:00
Caio Marcelo de Oliveira Filho d9a3876851 AP_HAL_FLYMAPLE: Remove unused extern declaration for HALs 2015-11-20 16:32:00 +09:00
Caio Marcelo de Oliveira Filho ee542aac8b AP_HAL_Empty: Remove unused extern declaration for HALs
These are "left-overs" from how things worked before commit
"AP_HAL: make code not depend on concrete HAL
implementations". The real declaration now lives inside get_HAL() function.

Use the opportunitiy to change the files to use "#pragma once".
2015-11-20 16:30:45 +09:00
Andrew Tridgell 1ee7963edb AP_ADC: fixed example build 2015-11-20 17:33:17 +11:00
Andrew Tridgell 7375f395f9 AP_RPM: added optional PWM logging 2015-11-20 17:02:46 +11:00
Caio Marcelo de Oliveira Filho cbaa57c7be AP_HAL_VRBRAIN: remove unused functions 2015-11-20 12:36:54 +09:00
Caio Marcelo de Oliveira Filho 783db23a0f AP_HAL_SITL: remove unused functions 2015-11-20 12:36:42 +09:00
Caio Marcelo de Oliveira Filho 1de0e0a5a6 AP_HAL_PX4: remove unused functions 2015-11-20 12:36:34 +09:00
Caio Marcelo de Oliveira Filho e0a6d83457 AP_HAL_LINUX: remove unused functions 2015-11-20 12:36:25 +09:00
Caio Marcelo de Oliveira Filho f3cc27e04a AP_HAL_FLYMAPLE: remove unused functions 2015-11-20 12:36:18 +09:00
Caio Marcelo de Oliveira Filho 420dfc7ce2 AP_HAL_Empty: remove unused functions 2015-11-20 12:36:10 +09:00
Caio Marcelo de Oliveira Filho c5fc0deee9 AP_HAL_Scheduler: remove unused functions
Getting the time elapsed and panic are now functions in AP_HAL, so
remove them from HAL class interface and it's implementations.
2015-11-20 12:36:00 +09:00
Caio Marcelo de Oliveira Filho d343bfdc6c SITL: use millis/micros/panic functions 2015-11-20 12:35:50 +09:00
Caio Marcelo de Oliveira Filho e839892524 PID: use millis/micros/panic functions 2015-11-20 12:35:42 +09:00
Caio Marcelo de Oliveira Filho a096c2b72c GCS_MAVLink: use millis/micros/panic functions 2015-11-20 12:35:34 +09:00
Caio Marcelo de Oliveira Filho 51a6455ac0 Filter: use millis/micros/panic functions 2015-11-20 12:35:25 +09:00
Caio Marcelo de Oliveira Filho 578b31e7f8 AP_DataFlash: example uses millis/micros/panic functions 2015-11-20 12:35:17 +09:00
Caio Marcelo de Oliveira Filho 753956bd77 AP_Dataflash: use millis/micros/panic functions 2015-11-20 12:35:00 +09:00
Caio Marcelo de Oliveira Filho 0aa520a273 AP_Terrain: use millis/micros/panic functions 2015-11-20 12:34:53 +09:00
Caio Marcelo de Oliveira Filho c70dda526c AP_TECS: use millis/micros/panic functions 2015-11-20 12:34:46 +09:00
Caio Marcelo de Oliveira Filho 7c9a5dc1b9 AP_ServoRelayEvents: use millis/micros/panic functions 2015-11-20 12:34:39 +09:00
Caio Marcelo de Oliveira Filho 81186e5416 AP_Scheduler: use millis/micros/panic functions 2015-11-20 12:34:17 +09:00
Caio Marcelo de Oliveira Filho 82a14b183d AP_RangeFinder: use millis/micros/panic functions 2015-11-20 12:34:10 +09:00
Caio Marcelo de Oliveira Filho 5344d95ef5 AP_Rally: use millis/micros/panic functions 2015-11-20 12:34:04 +09:00
Caio Marcelo de Oliveira Filho 9639add306 AP_RPM: use millis/micros/panic functions 2015-11-20 12:33:57 +09:00
Caio Marcelo de Oliveira Filho 26c06ae3a9 AP_PerfMon: use millis/micros/panic functions 2015-11-20 12:33:33 +09:00
Caio Marcelo de Oliveira Filho d186704724 AP_Parachute: use millis/micros/panic functions 2015-11-20 12:33:26 +09:00
Caio Marcelo de Oliveira Filho 5b06924779 AP_OpticalFlow: use millis/micros/panic functions 2015-11-20 12:33:19 +09:00
Caio Marcelo de Oliveira Filho daee8e8e76 AP_Notify: use millis/micros/panic functions 2015-11-20 12:33:13 +09:00
Caio Marcelo de Oliveira Filho 8d882b06dd AP_NavEKF2: use millis/micros/panic functions 2015-11-20 12:32:41 +09:00
Caio Marcelo de Oliveira Filho e3c317b96b AP_NavEKF: use millis/micros/panic functions 2015-11-20 12:32:31 +09:00
Caio Marcelo de Oliveira Filho 0b2184b818 AP_Mount: use millis/micros/panic functions 2015-11-20 12:32:24 +09:00
Caio Marcelo de Oliveira Filho 513f4fe986 AP_Motors: example uses millis/micros/panic functions 2015-11-20 12:32:16 +09:00
Caio Marcelo de Oliveira Filho 01e4265ce1 AP_Mission: example uses millis/micros/panic functions 2015-11-20 12:32:09 +09:00
Caio Marcelo de Oliveira Filho f20a4e413c AP_Mission: use millis/micros/panic functions 2015-11-20 12:32:03 +09:00
Caio Marcelo de Oliveira Filho 8257e6ab89 AP_Math: examples use millis/micros/panic functions 2015-11-20 12:31:55 +09:00
Caio Marcelo de Oliveira Filho 5292bc0054 AP_HAL: example uses millis/micros/panic functions 2015-11-20 12:31:48 +09:00
Caio Marcelo de Oliveira Filho d7601095fa AP_InertialSensor: use millis/micros/panic functions 2015-11-20 12:31:41 +09:00
Caio Marcelo de Oliveira Filho 87b9b4463e AP_IRLock: use millis/micros/panic functions 2015-11-20 12:31:35 +09:00
Caio Marcelo de Oliveira Filho 2314578f6f AP_HAL_VRBRAIN: use millis/micros/panic functions 2015-11-20 12:31:28 +09:00
Caio Marcelo de Oliveira Filho 85d12efbef AP_HAL_SITL: use millis/micros/panic functions 2015-11-20 12:31:20 +09:00
Caio Marcelo de Oliveira Filho a76c9e0051 AP_HAL_PX4: use millis/micros/panic functions 2015-11-20 12:31:13 +09:00
Caio Marcelo de Oliveira Filho 7675913d5b AP_HAL_Linux: use millis/micros/panic functions 2015-11-20 12:31:04 +09:00
Caio Marcelo de Oliveira Filho f03eec59d6 AP_HAL_FLYMAPLE: use millis/micros/panic functions 2015-11-20 12:30:55 +09:00
Caio Marcelo de Oliveira Filho c33b86a783 AP_GPS: use millis/micros/panic functions 2015-11-20 12:30:48 +09:00
Caio Marcelo de Oliveira Filho 2b982d6391 AP_FrSkyTelem: use millis/micros/panic functions 2015-11-20 12:30:41 +09:00
Caio Marcelo de Oliveira Filho 032acaaee4 AP_EPM: use millis/micros/panic functions 2015-11-20 12:30:34 +09:00
Caio Marcelo de Oliveira Filho 0ae2fe6fcd AP_Declination: example uses millis/micros/panic functions 2015-11-20 12:30:27 +09:00
Caio Marcelo de Oliveira Filho cd7cfdef91 AP_Compass: examples use millis/micros/panic functions 2015-11-20 12:30:20 +09:00
Caio Marcelo de Oliveira Filho 86954cda0e AP_CompassCalibrator: use millis/micros/panic functions 2015-11-20 12:30:14 +09:00
Caio Marcelo de Oliveira Filho 0d3fbbdd37 AP_Compass: use millis/micros/panic functions 2015-11-20 12:30:05 +09:00
Caio Marcelo de Oliveira Filho 89d6acaeaa AP_BoardConfig: use millis/micros/panic functions 2015-11-20 12:29:58 +09:00
Caio Marcelo de Oliveira Filho 3b4e18043b AP_BattMonitor: examples use millis/micros/panic functions 2015-11-20 12:29:52 +09:00
Caio Marcelo de Oliveira Filho 9eb945d24f AP_BattMonitor: use millis/micros/panic functions 2015-11-20 12:29:45 +09:00
Caio Marcelo de Oliveira Filho 8cce3067f4 AP_Baro: examples use millis/micros/panic functions 2015-11-20 12:29:38 +09:00
Caio Marcelo de Oliveira Filho 5a280838f8 AP_Baro: use millis/micros/panic functions 2015-11-20 12:29:31 +09:00
Caio Marcelo de Oliveira Filho b8f0beab83 AP_Arming: use millis/micros/panic functions 2015-11-20 12:29:24 +09:00
Caio Marcelo de Oliveira Filho 410bbe4c26 AP_Airspeed: examples use millis/micros/panic functions 2015-11-20 12:29:16 +09:00
Caio Marcelo de Oliveira Filho 2b10e0fac0 AP_Airspeed: use millis/micros/panic functions 2015-11-20 12:29:07 +09:00
Caio Marcelo de Oliveira Filho 3a17c858e3 AP_AHRS: use millis/micros/panic functions 2015-11-20 12:29:00 +09:00
Caio Marcelo de Oliveira Filho 4ea45b8df1 AP_AHRS_NavEKF: use millis/micros/panic functions 2015-11-20 12:28:53 +09:00
Caio Marcelo de Oliveira Filho 55e61538b3 AP_AHRS_DCM: use millis/micros/panic functions 2015-11-20 12:28:45 +09:00
Caio Marcelo de Oliveira Filho b293fb150c AP_ADC: use millis/micros/panic functions 2015-11-20 12:28:36 +09:00
Caio Marcelo de Oliveira Filho b331ffdd91 APM_OBC: use millis/micros/panic functions 2015-11-20 12:28:28 +09:00
Caio Marcelo de Oliveira Filho fe718a6ce8 APM_Control: use millis/micros/panic functions 2015-11-20 12:28:20 +09:00
Caio Marcelo de Oliveira Filho e867a06383 AC_WPNav: use millis/micros/panic functions 2015-11-20 12:28:13 +09:00
Caio Marcelo de Oliveira Filho 70d0ea9151 AC_Sprayer: use millis/micros/panic functions 2015-11-20 12:28:04 +09:00
Caio Marcelo de Oliveira Filho ccd03bcf60 AC_Fence: use millis/micros/panic functions 2015-11-20 12:27:11 +09:00
Caio Marcelo de Oliveira Filho ea08b6115d AC_AttControl: use millis/micros/panic functions 2015-11-20 12:27:03 +09:00
Caio Marcelo de Oliveira Filho 7662c2e73f AP_HAL_VRBRAIN: implement new AP_HAL functions
Implement the new AP_HAL functions and use them in the Scheduler when
possible.
2015-11-20 12:25:42 +09:00
Caio Marcelo de Oliveira Filho 79721feb14 AP_HAL_FLYMAPLE: implement new AP_HAL functions
Implement the new AP_HAL functions and use them in the Scheduler when
possible.

Because the functions are in a namespace, there's no need to do the
define/undef trick and avoid the globals millis() and micros() provided
by libmaple.
2015-11-20 12:25:41 +09:00
Caio Marcelo de Oliveira Filho 8db8b9b355 AP_HAL_PX4: implement new AP_HAL functions
Implement the new AP_HAL functions and use them in the Scheduler when
possible.
2015-11-20 12:25:40 +09:00
Caio Marcelo de Oliveira Filho ff016c4b5a AP_HAL_Linux: implement new AP_HAL functions
Implement the new AP_HAL functions and use them in the Scheduler when
possible.

The '_sketch_start_time' was renamed and moved as a detail of
implementation of the functions code. It allows the code to return time
starting from zero.

The 'stopped_clock_usec' was renamed to follow convention in the file
and add a getter so that AP_HAL functions can reach it. It's not a
problem this getter is public because in practice, regular code
shouldn't even access the Linux::Scheduler directly -- only code that
should is from Linux implementation.
2015-11-20 12:25:39 +09:00
Caio Marcelo de Oliveira Filho 3ef77617fd AP_HAL_SITL: implement new AP_HAL functions
Implement the new AP_HAL functions and use them in the Scheduler when
possible.

The '_sketch_start_time' was renamed and moved as a detail of
implementation of the functions code. It allows the code to return time
starting from zero.

The 'stopped_clock_usec' was renamed to follow convention in the file
and add a getter so that AP_HAL functions can reach it. It's not a
problem this getter is public because in practice, regular code
shouldn't even access the SITLScheduler directly -- only code that
should is from SITL itself.
2015-11-20 12:25:38 +09:00
Caio Marcelo de Oliveira Filho efbc7648b1 AP_HAL: create AP_HAL namespace and use for some HAL functionality
For certain basic functionality, there aren't much benefit to be able to
vary the implementation easily at runtime. So instead of using virtual
functions, use regular functions that are "resolved" at link time. The
implementation of such functions is provided per board/platform.

Examples of functions that fit this include: getting the current
time (since boot), panic'ing, getting system information, rebooting.

These functions are less likely to benefit from the indirection provided
by virtual interfaces. For more complex hardware access APIs the
indirection makes more sense and ease the testing (when we have it!).

The idea is that instead of calling

    hal.scheduler->panic("on the streets of london");

now use

    AP_HAL::panic("on the streets of london");

A less important side-effect is that call-site code gets
smaller. Currently the compiler needs to get the hal, get the scheduler
pointer, get the right function pointer in the vtable for that
scheduler. And the call must include an extra parameter ("this"). Now it
will be just a function call, with the address resolved at link time.

This patch introduces the first functions that will be in the namespace,
further patches will implementations for each board and then switch the
call-sites. The extra init() function allow any initial setup needed for
the functions to work.
2015-11-20 12:25:24 +09:00
Jonathan Challinger f9c7f15052 AC_WPNav: WPNAV_LOIT_SPEED WPNAV_LOIT_MAXA take effect immediately 2015-11-18 22:12:39 +09:00
Paul Riseborough ff2782b790 AP_NavEKF2: Parameter changes to reduce noise on gyro bias estimates 2015-11-18 20:17:03 +09:00
Paul Riseborough 2193103586 AP_NavEKF: Reduce time to switch after an IMU fault
This revised threshold value is still double the maximum that has been observed in flight logs so far with healthy sensors
The previous value was too slow to switch for sudden IMU gyro faults
We can afford an ocasional false trigger becasue the front end will only select another instance if it is healthy and has lower errors
2015-11-18 20:17:00 +09:00
Paul Riseborough 20798316e1 AP_NavEKF2: fix bug in performance timer 2015-11-18 20:16:58 +09:00
Randy Mackay c9340dbeb6 AC_PosControl: run velocity controller z-axis at 400hz 2015-11-18 13:31:21 +09:00
Randy Mackay dbc8ce1d69 AC_PosControl: default z-axis controller to 400hz
No functional change as vehicle code always sets it explicitely
2015-11-18 13:31:20 +09:00
Randy Mackay 323a527734 AC_PosControl: velocity controller uses feed-forward althold 2015-11-18 13:31:19 +09:00
Randy Mackay 4b41710261 AC_AttControl: minor comment fix 2015-11-18 13:31:18 +09:00
Caio Marcelo de Oliveira Filho a348424551 AP_HAL: remove unused function
This was used by APM1/2 that were removed.
2015-11-18 11:50:56 +09:00
Andrew Tridgell 5561efde2b AP_NavEKF: we can assume get_sample_rate() returns a non-zero number
this fixes a build error with the previous patch
2015-11-18 11:48:50 +11:00
Paul Riseborough e32e6cfa67 AP_NavEKF: Protect against bad delta time from the INS library
Prevent arithmetic divide by zero exceptions and handle invalid delta time in a consistent way by setting invalid times to the average.
2015-11-18 11:43:40 +11:00
Paul Riseborough 2fb5a4489b AP_NavEKF2: Prevent airspeed faults from causing excessive loss of accuracy 2015-11-18 11:39:54 +11:00
Paul Riseborough fc6978e4d9 AP_NavEKF2: Fix error in parameter documentations 2015-11-18 11:39:54 +11:00
Paul Riseborough f9cadaf15c AP_NavEKF2: Increase resolution of innovation consistency gate parameters
Also adds protection against setting the gate to a number that would casue numerical errors.
2015-11-18 11:39:53 +11:00
Andrew Tridgell 08ef00b431 AP_NavEKF2: fixed build with IMU_BUFFER_LENGTH change 2015-11-18 11:33:51 +11:00
Paul Riseborough af3507ef3c AP_NavEKF2: Stop bad INS velocity spoiling height reset
We should reset the velocity as well as the height if a reasonable reset value is available.
2015-11-18 11:18:50 +11:00
Paul Riseborough 97799ef0b3 AP_NavEKF2: Ensure that GPS origin is set before using data for height 2015-11-18 11:18:50 +11:00
Paul Riseborough b8427e5d95 AP_NavEKF2: Only allow rangefinder height option during optical flow nav 2015-11-18 11:18:50 +11:00
Paul Riseborough c9eea98142 AP_NavEKF2: Improve terrain height estimation
The ad-hoc scaling of error growth has been replaced with a consistent method that uses the main nav filters published vertical velocity uncertainty and the terrain gradient assumption.
2015-11-18 11:18:46 +11:00
Paul Riseborough d820a538d5 AP_NavEKF2: Make magnetometer data available status global
This assists with debugging and makes it consistent with other measurements that are buffered
2015-11-18 11:18:46 +11:00
Paul Riseborough 04228e0b3b AP_NavEKF2: Rework selection of height measurements for fusion
GPS height has been added as a measurement option along with range finder and baro
Selection of the height measurement source has been moved into a separate function
Each height source is assigned its own measurement noise
If GPS or baro alt is not able to be used, it reverts to baro
When baro is not being used, an offset is continually calculated which enables a switch to baro without a height step.
2015-11-18 11:18:42 +11:00
Paul Riseborough 80bc64ee7a AP_NavEKF2: Update parameter documentation with GPS height source option 2015-11-18 11:18:18 +11:00
Paul Riseborough 4c72a14e22 AP_NavEKF2: Add function to LPF and spike filter baro data 2015-11-18 11:18:17 +11:00
Paul Riseborough 34311bedfa AP_NavEKF2: Add data buffers for range finder data 2015-11-18 11:18:17 +11:00
Andrew Tridgell 99da195e37 AP_NavEKF2: make IMU buffer length depend on main loop rate
this fixes a problem with Replay and baro data
2015-11-18 10:20:39 +11:00
Andrew Tridgell f36b2e415a AP_InertialSensor: fixed flymaple build 2015-11-17 08:52:49 +11:00
Andrew Tridgell 32ed0d58f3 AP_InertialSensor: fixed filter setup on 2nd accel/gyro 2015-11-16 17:57:36 +11:00
Andrew Tridgell e1cb9beeef SITL: expose update rate to HAL_SITL
and fixed dataflash reference loop
2015-11-16 17:57:36 +11:00
Andrew Tridgell 95ca0b39a8 HAL_SITL: moved virtual INS sensor to AP_InertialSensor_SITL 2015-11-16 17:57:35 +11:00
Andrew Tridgell 4a768d47f3 AP_InertialSensor: created a SITL specific backend 2015-11-16 17:57:35 +11:00
Andrew Tridgell 2675edcb96 HAL_SITL: removed unused variables 2015-11-16 17:57:35 +11:00
Andrew Tridgell ccd915eb67 AP_InertialSensor: moved raw gyro and accel logging to common code
this brings raw logging to non-PX4 ports
2015-11-16 17:57:35 +11:00
Andrew Tridgell 75ea8f3dc0 AP_InertialSensor: removed "have sample" logic from drivers
the frontend has all the information it needs, so we can simplify the
drivers some more
2015-11-16 17:57:35 +11:00
Andrew Tridgell 0e4bab74ba AP_InertialSensor: simplify sensor backends
use common code for filtering and update, allowing each sensor driver
to be simpler and more consistent
2015-11-16 17:57:35 +11:00
Randy Mackay 36c0beb918 GPS_UBlox: reorder init to resolve compiler warning
Also removed duplicate init of noReceivedHdop
2015-11-16 15:09:17 +09:00
Paul Riseborough 9b82b2200c AP_NavEKF2: Fix plane in-flight yaw reset
The copter method was being used for plane and the plane method was not being run due to the change in flight status not being detected.
The plane reset method did not trigger if the EKF had already dragged the velocity states along with the GPS or could align to an incorrect heading.
The method has been reworked so that it resets to the GPS course, but only if there are inconsistent angles and large innovations.
To stop a failed magnetometer causing a loss of yaw reference later in flight, if all available sensors have been tried in flight and timed out, then no further magnetoemter data will be used
2015-11-16 09:05:42 +11:00
Paul Riseborough e8706db382 AP_NavEKF2: Update IMU tuning parameter limits 2015-11-16 09:05:42 +11:00
Paul Riseborough 0562529729 AP_NavEKF2: Tuning changes to make attitude less sensitive to GPS and compass errors 2015-11-16 09:05:42 +11:00
Andrew Tridgell 3549c717db Filter: removed reference to old 'Desktop' build 2015-11-16 08:06:05 +11:00
Andrew Tridgell 8f4ce7f20b build: removed all nocore.inoflag files
these were APM2 specific
2015-11-16 08:05:17 +11:00
Andrew Tridgell 1ffe899a18 PID: fixed example build 2015-11-16 08:04:44 +11:00
Andrew Tridgell 9ea99cba29 HAL_Linux: fixed example build 2015-11-16 08:04:35 +11:00
Andrew Tridgell c81d4fa07b AP_Declination: fixed example build 2015-11-16 07:59:18 +11:00
Andrew Tridgell a9372ad5d7 Filter: fixed example builds 2015-11-16 07:58:55 +11:00
Andrew Tridgell 6cf5e582b9 AP_Common: fixed examples build 2015-11-16 07:58:13 +11:00
Michael Oborne 2f49fa1531 AP_GPS_GSOF: add second comport to base config 2015-11-15 14:56:49 +08:00
Andrew Tridgell 1a033f3b73 HAL_Linux: don't flood the link with errors on uninitialised perf counter
that could bring down the vehicle
2015-11-14 14:44:29 +11:00
Julien BERAUD 2f610a400a AP_HAL_Linux: fix perf
Fix warning (warning: declaration of 'perf_count' shadows a member of 'this')
and check that perf is not NULL before indirection
2015-11-14 14:44:29 +11:00
Julien BERAUD 259f5f07e8 AP_NavEKF_core: fix init of perf
_perf_FuseOptFlow  was used and not allocated
2015-11-14 14:44:29 +11:00
Julien BERAUD f8f2833c88 AP_HAL_Linux: use I2C_SLAVE_FORCE in case of error
When there is already a driver registered on an i2c bus, the I2C_SLAVE ioctl
returns an error.
When it happens, it is better to display a warning and try to force the address.
It is especially useful on the bebop when killing the regular autopilot that uses
iio drivers to access the imu because else we would need to manually unbind the
driver in an init procedure.

I have added a warning because this error can also be resulting of another cause.
If the error is not EBUSY, then panic

If the I2C_SLAVE_FORCE ioctl fails then we panic because one of the i2c devices
won't be working properly.
2015-11-13 21:20:13 +11:00
Andrew Tridgell cefb32566f GCS_MAVLink: fixed corner case in MAVLink routing
when a GCS sends a command to a system ID that isn't our system ID,
the GCS may use a non-advertised component ID such as
MAV_COMP_ID_SYSTEM_CONTROL. Those packets should be fowarded to the
target system even though the target system has not specifically
advertised that target sysid/compid tuple.
2015-11-13 13:38:53 +11:00
José Roberto de Souza 5ff67a41a1 AP_HAL_Linux: Implement perf API
Initial implementation of perf API on Linux, for now just saving
perf data, in a further patch this data will be exported.
2015-11-13 12:16:19 +11:00
mirkix f00d4f0b3e AP_HAL_Linux: Improve loading firmware 2015-11-12 21:25:17 +01:00
Robert Lefebvre 4f7246c432 SITL: Helicopter parameter updates 2015-11-12 19:37:38 +09:00
Robert Lefebvre b89b0d7f9e AP_MotorsHeli_Single: Move Servo_Test static variables to be class members 2015-11-12 19:37:37 +09:00
Robert Lefebvre 1bc13fb9c0 AC_AttitudeControl_Heli: Add Hover Roll Trim Scalar 2015-11-12 19:37:35 +09:00
Robert Lefebvre bb7f8c1999 AP_MotorsHeli: Create Servo Test functionality 2015-11-12 19:37:34 +09:00
Robert Lefebvre eeb544d098 AP_MotorsHeli: Create SV_MAN=5=Oscillate servo setup mode. 2015-11-12 19:37:33 +09:00
Robert Lefebvre 4443ca9602 AP_MotorsHeli: Yaw servo to move when using SV_MAN param for setup. 2015-11-12 19:37:32 +09:00
Robert Lefebvre c2dff8749e AP_MotorsHeli: Change SV_MAN=2=Center to output _col_mid_pwm instead of 0 collective 2015-11-12 19:37:31 +09:00
Fredrik Hedberg 212eb85ff2 AP_MotorsHeli: Add min and max collective to manual servo modes 2015-11-12 19:37:30 +09:00
Robert Lefebvre 22729e6927 AP_MotorsHeli: Change servo manual #defines into enum 2015-11-12 19:37:29 +09:00
Robert Lefebvre 750728fa1e AP_MotorsHeli_Single: Add motor enable aux output functionality 2015-11-12 19:37:28 +09:00
Robert Lefebvre 58e918341d RC_Channel: Add motor_run_enable aux function 2015-11-12 19:37:27 +09:00
Robert Lefebvre 0b33ef3862 AC_AttitudeControl: Add Hover Roll Trim functionality for helicopters. 2015-11-12 19:37:26 +09:00
Fredrik Hedberg 5fd7fe3e53 AP_Motors: Add manual servo override to center swash-plate for set-up in AP_MotorsHeli. 2015-11-12 19:37:25 +09:00
Jolyon Saunders ca28a49fa6 AP_Motors: Circular swash-plate limits for AP_MotorsHeli 2015-11-12 19:37:24 +09:00
Robert Lefebvre afcc304cbf AC_InputManager: Initial class creation 2015-11-12 19:37:21 +09:00
Robert Lefebvre c66af9b788 AC_HELI_PID: Add Leak-Min param and functionality. 2015-11-12 19:37:20 +09:00
Robert Lefebvre 62864c9e2b AC_AttitudeControl_Heli: Remove commented out Cyclic Cross-Coupling code. Will resurrect in future. 2015-11-12 19:37:19 +09:00
Robert Lefebvre b8ce23970d AC_AttitudeControl_Heli: Implement Pirouette Compensation 2015-11-12 19:37:18 +09:00
Robert Lefebvre f39ac7c900 AC_AttitudeControl_Heli: Add initialization of _flags_heli members 2015-11-12 19:37:17 +09:00
Paul Riseborough 6522fb2621 AP_NavEKF2: Allow user to relax pre-flight GPS checks 2015-11-12 20:39:15 +11:00
Randy Mackay d13b4c2dc3 AC_PrecLand: init members to resolve compile warning 2015-11-12 14:43:38 +09:00
Randy Mackay 175f5654c1 AC_PrecLand: fix backend compile error 2015-11-12 14:42:44 +09:00
Peter Barker fc05ad81eb DataFlash_File: cache oldest log to avoid directory scans when downloading 2015-11-12 12:23:46 +11:00
Paul Riseborough 0b653bb82b AP_NavEKF2: Update MAVLnk parameter documentation 2015-11-11 15:16:36 +11:00
José Roberto de Souza 17e105640e AP_InertialSensor: Add HAL_COMPASS_AK8963_MPU9250_I2C to _detect_backends() 2015-11-11 14:29:07 +11:00
José Roberto de Souza 6ece4d60aa AP_HAL: HAL_COMPASS_AK8963_MPU9250_I2C to the supported list 2015-11-11 14:29:07 +11:00
José Roberto de Souza bdc36349b4 AP_Compass: AK8963: Add support to use a AK8963 behind of a MPU9250 over I2C
To be able to use AK8963 connected to the auxiliary I2C bus of a
MPU9250 we need first initialize it.
2015-11-11 14:29:07 +11:00
José Roberto de Souza d1ff4286c2 AP_InertialSensor: Make detect_backends() public
This method will be used to initialize and configure I2C backends that
have an auxiliary I2C bus that can be connected to the main I2C bus,
like MPU6000 and MPU9250.
2015-11-11 14:29:07 +11:00
José Roberto de Souza 0cbe99a862 AP_InertialSensor: MPU9250 I2C: Connect the auxiliary I2C bus to the main bus
Using MPU9250 over I2C we can connect the auxiliary bus where there is
a AK8963 and connect this bus to the main one, this way we don't need
any AuxiliaryBus infrastructure as we need with SPI and we can talk
with AK8963 as we would talk with a standalone AK8963.
2015-11-11 14:29:07 +11:00
José Roberto de Souza b3322ed1ae AP_InertialSensor: Add MPU9250 over I2C to detect_backends() 2015-11-11 14:29:07 +11:00
José Roberto de Souza b3f030f650 AP_HAL: Add MPU9250 over I2C 2015-11-11 14:29:07 +11:00
José Roberto de Souza 607ab5b005 AP_InertialSensor: MPU9250: Add I2C support 2015-11-11 14:29:07 +11:00
José Roberto de Souza c3dae6fcec AP_InertialSensor: MPU9250: Remove methods not used anymore
Those methods were used by AK8963 before it started to use auxiliary bus.
2015-11-11 14:29:06 +11:00
José Roberto de Souza 1fc29a2654 AP_Compass: AK8963: Use MPU9250 auxiliary bus 2015-11-11 14:29:06 +11:00
José Roberto de Souza 588df53429 AP_InertialSensor: Add support to get auxiliary bus of multiple instances of the same sensor 2015-11-11 14:29:06 +11:00
José Roberto de Souza 3e1b974fd2 AP_InertialSensor: MPU9250: Export auxiliary bus 2015-11-11 14:29:06 +11:00
José Roberto de Souza 206f0fb773 AP_InertialSensor: MPU9250: Add BusDriver abstraction
This adds a similar abstraction to the one in MPU60XX so it's possible to use
MPU9250 in other bus. The I2C implementation will come later.
2015-11-11 14:29:06 +11:00
Lucas De Marchi 977f6aaf15 AP_Baro: MS5611: remove empty statement 2015-11-11 13:48:48 +11:00
Lucas De Marchi 94d01934f7 AP_Baro: MS5611: reduce OSR to 1024
This is the same change as done in PX4:

	This reduces self-heating of the sensor which reduces the amount
	of altitude change when warming up. Apparently some individual
	sensors are severely affected by this.

	Unfortunately it raises the noise level, but Paul is confident
	it won't be a significant issue.
2015-11-11 13:48:48 +11:00
Andrew Tridgell ea5cd99651 RC_Channel: use is_bounded_int32() 2015-11-11 13:45:09 +11:00
Andrew Tridgell 090c02e6bd AP_Common: rename is_bounded() to is_bounded_int32() and make inclusive
we will probably want float versions in future, and inclusive is
better for the RC_Channel case
2015-11-11 13:45:05 +11:00
Grant Morphett ba8dbf6696 AP_Common: Added a new is_bounded global function. 2015-11-11 13:39:39 +11:00
Grant Morphett 7edf8c0e0a RC_Channel: New method to detect if channel is in trim location
This is a new method which will return true if an RC_Channel has a PWM
value that is at its TRIM value plus or minus the allowed dead zone
around the TRIM.
2015-11-11 13:39:38 +11:00
Lucas De Marchi 1d51e60571 AP_HAL_Linux: move Util instantiation
The util object may be used by all other objects so we need to
instantiate it as earlier as possible.
2015-11-11 08:02:41 +11:00
Paul Riseborough ca31ced2b4 AP_NavEKF2: Fix bug preventing use of optical flow with multiple IMU's 2015-11-10 18:17:16 +11:00
José Roberto de Souza 01766e7069 AP_HAL_Linux: RCOutput: Add LinuxRCOutput_Sysfs
This RCOutput works over Linux PWM sysfs interface.
2015-11-10 17:05:34 +11:00
Lucas De Marchi 392879112e AP_HAL_Linux: document functions to write file
Document function and add attributes to mark then as printf- and
scanf-like functions.
2015-11-10 17:05:34 +11:00
Lucas De Marchi 821814007e AP_Common: add scanf format macro
Add a macro to annotate functions that act like scanf.  Calling the
printf format macro as FORMAT was bad as can be seen now. Later we need
to rename it to FMT_PRINTF.
2015-11-10 17:05:34 +11:00
Lucas De Marchi c66c61180a AP_HAL_Linux: rework PWM_Sysfs
This include some minor changes on all methods of PWM_Sysfs:

  - Sort headers
  - Add code inside Linux namespace rather than just use the namespace
  - Declare a union pwm_params, that's only used to calculate at compile
    time the maximum stack space we need in our methods: this is a bit
    safer for future extensions
  - Standardize error messages to include the useful params first and
    then the error message
  - Remove log message from hot path
  - Don't abuse macros for checking error - convert the SNPRINTF_CHECK
    macro into proper code, ignoring errors for not enough space since
    they can't happen
  - Fix call to read_file() passing uint8_t for "%u" in get_period()
  - Fix passing char** instead of char* to write_file() in set_polarity()
  - Use strncmp() instead of strncasecmp() since the kernel API uses
    lowercase.
  - Add comments on the 2 main methods of this class
2015-11-10 17:05:34 +11:00
José Roberto de Souza 39bd5fa80e AP_HAL_Linux: Add PWM_Sysfs
This class makes easy to use Linux PWM sysfs interface, available since
Linux 3.10.

More information https://www.kernel.org/doc/Documentation/pwm.txt
2015-11-10 17:05:34 +11:00
José Roberto de Souza d53911e3f6 AP_Math: Add functions to convert microseconds to/from nanoseconds 2015-11-10 17:05:34 +11:00
José Roberto de Souza ca533a9d94 AP_Math: Add functions to convert frequency to/from nanoseconds 2015-11-10 17:05:34 +11:00
Paul Riseborough 577670ccee AP_NavEKF2: Reduce memory required by 6KB when running at 400Hz
Down-sample the IMU and output observer state data to 100Hz for storage in the buffer.
This reduces storage requirements for Copter by 75% or 6KB
It does not affect memory required by plane which already uses short buffers due to its 50Hz execution rate.
This means that the EKF filter operations operate at a maximum rate of 100Hz.
The output observer continues to operate at 400Hz and coning and sculling corrections are applied during the down-sampling so there is no loss of accuracy.
2015-11-10 15:51:18 +11:00
Siddharth Bharat Purohit 5e2382ea09 AP_GPS:UBLOX: send save cfg msg once per 5s and 5 times only 2015-11-10 15:16:55 +11:00
Siddharth Bharat Purohit 360c09f9bd AP_GPS_UBLOX: send cfg save msg only once every 1 second 2015-11-10 15:16:55 +11:00
Jonathan Challinger bc708f9808 AP_GPS: add SAVE_CFG parameter make ublox config saving optional 2015-11-10 15:16:55 +11:00
Jonathan Challinger e82df48631 AP_GPS: save configuration to non-volatile memory in UBlox GPS 2015-11-10 15:16:55 +11:00
lvale 89b593b1f4 APM_OBC: status text severity to INFO or ERROR 2015-11-10 13:11:38 +09:00
lvale b601ef2f9e AP_Arming: status text severity to INFO 2015-11-10 13:11:36 +09:00
lvale 9d88508cc3 GCS_MAVLink: handle_mission_item text severity to info 2015-11-10 13:11:34 +09:00
Jonathan Challinger 6784fd8625 AC_AttitudeControl: reserve parameter IDs 2015-11-10 12:56:52 +09:00
Lucas De Marchi 825d10c81a Filter: remove filter with double type
We are currently not using LowPassFilter2p<double> and it just generates
a lot of warnings on PX4 while instantiating it due to implicitly
promoting float to double:

libraries/Filter/LowPassFilter2p.cpp: In instantiation of
	'T DigitalBiquadFilter<T>::apply(const T&, const DigitalBiquadFilter<T>::biquad_params&) [with T = double]':
libraries/Filter/LowPassFilter2p.cpp:86:41:   required from 'T LowPassFilter2p<T>::apply(const T&) [with T = double]'
libraries/Filter/LowPassFilter2p.cpp:98:16:   required from here
libraries/Filter/LowPassFilter2p.cpp:20:82: warning: implicit conversion from 'float' to 'double' to match other
	operand of binary expression [-Wdouble-promotion]
     T delay_element_0 = sample - _delay_element_1 * params.a1 - _delay_element_2 * params.a2;
                                                                                  ^
2015-11-10 12:43:21 +09:00
Paul Riseborough e33aa7898a AP_NavEKF2: Prevent return of uninitialised variable 2015-11-09 22:30:38 +11:00
Paul Riseborough 3d8e74df26 AP_NavEKF2: Don't switch magnetometers when on the ground or just started
Large magnetometer innovations on the ground could be caused by factors that will disappear when flying, eg:

a) Bad initial gyro bias
b) External magnetic field disturbances (adjacent metal structures, placement of hatches with magnets, etc)

To avoid unnecessary switches, we inhibit switching until off-ground and when sufficient time has lapsed from power on to learn gyro bias offsets.
2015-11-09 22:07:10 +11:00
Paul Riseborough 3099d94e78 AP_NavEKF2: Retrieve correct time-stamp for active compass 2015-11-09 22:07:10 +11:00
Paul Riseborough 6698d4379d AP_Compass: Enable usec timestamps to be retrieved for specified instance 2015-11-09 22:07:10 +11:00
Paul Riseborough 42b47acdfc DataFlash: Fix logging error for EKF second instance 2015-11-09 22:07:10 +11:00
Paul Riseborough 5d2f78996a AP_NavEKF2: Remove un-used data in IMU buffer
Recovers 416 Bytes of memory per EKF2 instance for Copter
2015-11-09 22:07:10 +11:00
Paul Riseborough 88cc1e2ffe DataFlash: Publish the EKF2 magnetometer selection index 2015-11-09 22:07:10 +11:00
Paul Riseborough f00b1ff22d AP_NavEKF2: Publish the magnetometer selection index 2015-11-09 22:07:10 +11:00
Paul Riseborough 7294c8004b AP_NavEKF2: Enable use of backup magnetometers after a timeout
If the magnetometer fails innovation consistency checks for too long (currently 10 sec), then the next available sensor approved for yaw measurement will be used.
2015-11-09 22:07:09 +11:00
Paul Riseborough 6deabe28c2 AP_NavEKF2: Require all magnetometer axes to pass innovation test
The original design intent was to require all axes to pass because severe errors are rarely constrained to a single axis.
This was not achieved with the previous implementation.
These changes move the innovation consistency checks for all three axes to the top before any axes are fused.
Unnecessary performance timers have been removed.
2015-11-09 22:07:09 +11:00
Paul Riseborough afeadfca51 AP_NavEKF2: Don't attempt to compensate for external mag calibration
This was problematic to implement with magnetometer switching. It is likely that slow magnetometer learning can still be performed externally (eg plane) but this will need to be monitored to see if it causes issues.
2015-11-09 22:07:09 +11:00
Paul Riseborough e8305c5653 AP_NavEKF: Prevent front-end from returning uninitialised data (garbage) 2015-11-09 15:56:45 +11:00
Andrew Tridgell 840c9e65bb AP_Baro: don't notify the GCS of new pressure reference too often 2015-11-09 14:34:07 +11:00
Andrew Tridgell e873ff1e5f AP_Param: copter with vectors when sending parameters 2015-11-09 14:28:20 +11:00
Peter Barker 1b13315092 AP_Baro: notify GCS of calibration 2015-11-09 09:23:20 +11:00
Peter Barker 5f9b1c5f4e AP_Param: provide facility to notify GCS of param set 2015-11-09 09:23:20 +11:00
Peter Barker 046b008889 AP_Param: send saved param values to all GCS 2015-11-09 09:23:20 +11:00
Peter Barker 368363531f GCS_MAVLink: provide facilities to send param values to all GCS 2015-11-09 09:23:20 +11:00
Tom Pittenger 73c5234633 AP_Terrain: cache status
instead of computing the terrain status on-demand, assign it in update() and cache the result. Then external tasks that check the status won't be doing terrain intensive calculations in their thread. All the calculations needed for the status were being performed in update already so this is an optimization.
2015-11-09 08:36:41 +11:00
Paul Riseborough f08a4af751 AP_NavEKF2: Remove redundant if statement
Thank you to OXINARF for picking up this one
2015-11-08 17:06:57 +11:00
Paul Riseborough 0f8cfa02ab AP_NavEKF: Remove redundant if statement
Thank you to OXINARF for picking up this one
2015-11-08 17:06:57 +11:00
Paul Riseborough 2243f95074 AP_NavEKF: Enable clean entry into GPS aiding whilst in-flight
Ensures that the latest GPS data is used to reset the states.
Separates the logic used to set the origin from the logic used to determine when to reset states and commence GPS aiding
2015-11-08 17:06:49 +11:00
Paul Riseborough 9efc2152fc AP_NavEKF2: Fix comment 2015-11-08 16:26:04 +11:00
Paul Riseborough a8983d075f AP_NavEKF2: Enable clean entry into GPS aiding in-flight
The setting of the EKF origin and the entry into GPS aiding mode have been separated to make the logic clear.
The order of operations has been changed to ensure that when a reset to GPS is performed, a valid GPS measurement is available in the buffer
Declaration of GPS availability is not made unless the GPS data has been entered into the buffer
2015-11-08 16:26:04 +11:00
Paul Riseborough f99dbc70f9 AP_NavEKF2: Don't return ready to use GPS true if user has inhibited GPS 2015-11-08 16:26:04 +11:00
Paul Riseborough d6f7156f4e AP_NavEKF2: Fix timing offset in position reset calculation
the correction for GPS latency now uses the correct time for that observation
2015-11-08 16:26:04 +11:00
Paul Riseborough 803817821d AP_AHRS: Support changes to EKF2 interfaces that specify the instance
An instance of -1 is specified which causes data for the primary instance to be returned.
2015-11-08 15:37:28 +11:00
Paul Riseborough 138315af21 DataFlash: Add logging for second NKF instance 2015-11-08 15:37:28 +11:00
Paul Riseborough 0b64ad0123 AP_NavEKF2: Enable EKF instance to be specified when requesting public data
Only applied to interfaces required for data logging.
If an invalid instance is requested, the data for the primary instance is returned. This allows the primary data to be returned by calling with a -1 instance value.
2015-11-08 15:37:28 +11:00
Paul Riseborough dfdacf2ddc GCS_MAVLink: Accommodate change to EKF2 interface
Return euler angles for primary instance
2015-11-08 15:37:28 +11:00
Paul Riseborough 5b1d6f2aa2 DataFlash: accomodate change in EKF2 interface 2015-11-08 15:37:28 +11:00
Paul Riseborough 243888e923 GCS_MAVLink: accomodate change in EKF2 interface 2015-11-08 15:37:28 +11:00
Paul Riseborough 6c2dc3ccf8 AP_NavEKF2: Publish the number of instances 2015-11-08 15:37:27 +11:00
Paul Riseborough 46e4c45537 DataFlash: Only log EKF messages when enabled 2015-11-08 15:37:27 +11:00
Paul Riseborough 624f169b9b AP_NavEKF: Publish enabled status 2015-11-08 15:37:27 +11:00
Paul Riseborough 65e4a4ab94 AP_NavEKF2: Use correct casting of integers when printing
Changes in response to review comments
2015-11-08 15:37:27 +11:00
Paul Riseborough 987d261109 DataFlash: Update logging of EKF2 primary core index
Changes made in response to review comments
2015-11-08 15:37:27 +11:00
Paul Riseborough 2dcaeb0304 AP_NavEKF2: Update publishing of primary core index
Changes made in response to review comments
2015-11-08 15:37:27 +11:00
Paul Riseborough 1858da8307 AP_NavEKF2: Better switching in response to faults
Make selection sticky
If fault detected or unhealthy, then switch to healthy core with lowest fault score.
If no healthy core found, do not switch.
2015-11-08 15:37:27 +11:00
Paul Riseborough 5f6d1d8d25 AP_NavEKF2: Add fault score calculation 2015-11-08 15:37:27 +11:00
Paul Riseborough 4884b2d38a DataFlash: Log the primary EKF2 index 2015-11-08 15:37:27 +11:00
Paul Riseborough b24507d33c AP_NavEKF2: Publish the primary EKF index 2015-11-08 15:37:27 +11:00
Paul Riseborough 04165a60a7 AP_NavEKF2: Reduce false positive on EKF health check
Apply filtering to baro innovation check and and don't apply innovation checks once aiding has commenced because GPS and baro disturbances on the ground and during launch could generate a false positive
2015-11-08 15:37:27 +11:00
Paul Riseborough 49f9ea317c AP_NavEKF: Update console message and param descriptions for multiple EKF's 2015-11-08 15:37:26 +11:00
Paul Riseborough 2340e18fdc AP_NavEKF2: Offset the fusion time horizon between multiple instances
Prevents frame over-runs due to simultaneous fusion of measurements on each instance.
The offset is only applied if less than 5msec available between frames
2015-11-08 15:37:26 +11:00
Paul Riseborough 3eeff8dbc6 AP_NavEKF2: Remove unused code
This method of correcting for the fusion time horizon delay was too computationally expensive for our application and did not smooth fusion noise.
2015-11-08 15:37:26 +11:00
Paul Riseborough d48454ee2d AP_NavEKF2: Use nominated IMU unless unavailable
We now run a separate instance of the EKF for each IMU, so input data fusion of IMU's is no longer required.
2015-11-08 15:37:26 +11:00
Siddharth Bharat Purohit 392fce76b2 AP_NavEKF: define getGpsGlitchStatus function 2015-11-08 12:55:58 +09:00
Andrew Tridgell 2ffabe9e05 AP_BoardConfig: fixed PX4v1 build 2015-11-06 17:10:08 +11:00
Andrew Tridgell d52279af27 AP_NavEKF2: don't try to allocate last bytes of memory to EKF2 2015-11-06 10:42:58 +11:00
Andrew Tridgell ee78e2d618 AP_NavEKF2: set primary to first healthy core 2015-11-06 10:42:58 +11:00
Andrew Tridgell 2ab2afc86a AP_NavEKF2: added EK2_IMU_MASK for multiple IMUs
no voting between multiple IMUs yet
2015-11-06 10:42:58 +11:00
Andrew Tridgell 56909ce973 AP_NavEKF: split EKF1 into frontend and backend
this allows the primary EKF to be allocated dynamically, allowing for
experiments with EKF2 with multi-IMU support
2015-11-06 10:42:57 +11:00
Andrew Tridgell c334bd0ddf AP_BoardConfig: added BRD_CAN_ENABLE option
this allows uavcan to be enabled/disabled at boot. When it is disabled
we save about 25k of memory, allowing for more options for things like
multiple EKF
2015-11-06 10:23:37 +11:00
Lucas De Marchi e9c6702269 AP_HAL_VRBRAIN: fix typo using comma operator
We want to return mallinfo().fordblks, not the struct using the comma
operator with a non-existing fordblks variable.
2015-11-05 15:48:32 -02:00
Lucas De Marchi 0d95a9c41d AP_OpticalFlow: reduce lock region
Release the lock as soon as we can.
2015-11-05 16:12:03 +09:00
Lucas De Marchi 70edf31ca6 AP_OpticalFlow: make error path common 2015-11-05 16:12:00 +09:00
Lucas De Marchi 7b726d824d AP_OpticalFlow: remove num_errors increment due to busy bus
num_errors should be used to detect bad bus transfers, not if we
actually read something. Since we are using i2c_sem->take_nonblocking()
failing here is more likely if the bus is shared.
2015-11-05 16:11:58 +09:00
Lucas De Marchi 41ddb67712 AP_OpticalFlow: pack struct passed to I2C layer
We pass "sizeof(i2c_integral_frame)" to hal.i2c->readRegisters(). Since
we have a padding in i2c_integral_frame we actually read 3 bytes more
than we should. Add PACKED to the struct so this is fixed.

i2c_frame doesn't have a padding (or hole) so there isn't this problem,
but since it's also used to calculate the frame size, use PACKED there
too.
2015-11-05 16:11:56 +09:00
Andrew Tridgell 49799257ea GCS_MAVLink: handle available memory of over 64k in mavlink 2015-11-05 16:09:00 +11:00
Andrew Tridgell 883ac59e4a HAL_Linux: always report 256k of available memory 2015-11-05 16:09:00 +11:00
Andrew Tridgell 567ea0e420 HAL_VRBRAIN: make available_memory() uint32_t 2015-11-05 16:09:00 +11:00
Andrew Tridgell 81e34006a5 HAL_SITL: make available_memory() uint32_t 2015-11-05 16:09:00 +11:00
Andrew Tridgell ac1c0bba15 HAL_PX4: make available_memory() uint32_t 2015-11-05 16:09:00 +11:00
Andrew Tridgell 8a4c0593f2 AP_HAL: make available_memory() uint32_t 2015-11-05 16:09:00 +11:00
Andrew Tridgell a3ca732403 AP_Airspeed: show health status in examples 2015-11-05 16:09:00 +11:00
Andrew Tridgell 75d2aed6e1 HAL_SITL: added help for uart command line checks 2015-11-04 14:26:55 +11:00
Víctor Mayoral Vilches d5d1bfae8c AP_HAL_Linux: Adapt code to common RPI layer 2015-11-04 13:58:25 +11:00
Víctor Mayoral Vilches b1a53c383c AP_HAL_Linux: Add AnalogIn_ADS1115, common code
This commit provides a single abstraction for both
Erle-Brain 2 and Navio boards.
2015-11-04 13:58:24 +11:00
Víctor Mayoral Vilches 47d43c64ef AP_HAL_Linux: Add RCInput_RPI, merge common code 2015-11-04 13:58:24 +11:00
Víctor Mayoral Vilches 4a2fe12652 AP_Notify: Add support for Erle-Brain 2 2015-11-04 13:58:24 +11:00
Víctor Mayoral Vilches b54b8aa8af AP_HAL_Linux: AP_BoardLED add support for Erle-Brain 2 2015-11-04 13:58:24 +11:00
Víctor Mayoral Vilches 30faf7e92a AP_InertialSensor: Add Erle-Brain 2 support 2015-11-04 13:58:24 +11:00
Víctor Mayoral Vilches 739fc0df35 AP_HAL_Linux: UtilRPI, add Erle-Brain 2 2015-11-04 13:58:24 +11:00
Víctor Mayoral Vilches 30153b6eac AP_HAL_Linux: Scheduler, add Erle-Brain 2 2015-11-04 13:58:24 +11:00
Víctor Mayoral Vilches 8ae8f47538 AP_HAL_Linux: SPIDriver, add Erle-Brain 2 2015-11-04 13:58:24 +11:00
Víctor Mayoral Vilches 68c92eab25 AP_HAL_Linux: GPIO, add Erle-Brain 2 2015-11-04 13:58:24 +11:00
Víctor Mayoral Vilches 90a00553cb AP_HAL: Boards, add Erle-Brain 2 2015-11-04 13:58:24 +11:00
Lucas De Marchi dd784189a1 AP_AHRS: remove comment about avr-libc 2015-11-04 12:14:16 +11:00
Lucas De Marchi 1a9b57da1f AP_GPS: remove check for GPS_SKIP_SIRF_NMEA 2015-11-04 12:14:15 +11:00
Lucas De Marchi c32d323cd6 GCS_MAVLink: remove check for GPS_RTK_AVAILABLE 2015-11-04 12:14:15 +11:00
Lucas De Marchi e31595c60c AP_GPS: remove check for GPS_RTK_AVAILABLE 2015-11-04 12:14:15 +11:00
Lucas De Marchi c75c1d84d9 AP_GPS: remove check for GPS_MAX_INSTANCES
All supported boards may have more than 1 GPS instance.
2015-11-04 12:14:15 +11:00
Lucas De Marchi c74b1a660d DataFlash: remove DATAFLASH_NO_CLI
This is not used anymore since the removal of AVR CPUs.
2015-11-04 12:14:15 +11:00
Lucas De Marchi 2a91d2169e RC_Channel: remove check for AVR CPUs
Remove the checks for HAL_CPU_CLASS > HAL_CPU_CLASS_16 and
HAL_CPU_CLASS >= HAL_CPU_CLASS_75. Corresponding dead code will be
removed on separate commits.
2015-11-04 12:14:14 +11:00
Lucas De Marchi 45c472205b GCS_MAVLink: remove check for AVR CPUs
Remove the checks for HAL_CPU_CLASS > HAL_CPU_CLASS_16 and
HAL_CPU_CLASS >= HAL_CPU_CLASS_75. Corresponding dead code will be
removed on separate commits.
2015-11-04 12:14:14 +11:00
Lucas De Marchi 1e839f97ed DataFlash: remove check for AVR CPUs
Remove the checks for HAL_CPU_CLASS > HAL_CPU_CLASS_16 and
HAL_CPU_CLASS >= HAL_CPU_CLASS_75. Corresponding dead code will be
removed on separate commits.
2015-11-04 12:14:14 +11:00
Lucas De Marchi ca4ae1c9e0 AP_Motors: remove check for AVR CPUs
Remove the checks for HAL_CPU_CLASS > HAL_CPU_CLASS_16 and
HAL_CPU_CLASS >= HAL_CPU_CLASS_75. Corresponding dead code will be
removed on separate commits.
2015-11-04 12:14:14 +11:00
Lucas De Marchi fb28f426da AP_Math: remove check for AVR CPUs
Remove the checks for HAL_CPU_CLASS > HAL_CPU_CLASS_16 and
HAL_CPU_CLASS >= HAL_CPU_CLASS_75. Corresponding dead code will be
removed on separate commits.
2015-11-04 12:14:14 +11:00
Lucas De Marchi 255e04a841 AP_HAL: remove check for AVR CPUs
Remove the checks for HAL_CPU_CLASS > HAL_CPU_CLASS_16 and
HAL_CPU_CLASS >= HAL_CPU_CLASS_75. Corresponding dead code will be
removed on separate commits.
2015-11-04 12:14:14 +11:00
Lucas De Marchi 4cef751aef AP_GPS: remove check for AVR CPUs
Remove the checks for HAL_CPU_CLASS > HAL_CPU_CLASS_16 and
HAL_CPU_CLASS >= HAL_CPU_CLASS_75. Corresponding dead code will be
removed on separate commits.
2015-11-04 12:14:14 +11:00
Lucas De Marchi 8eef58a8c2 AP_Baro: remove check for AVR CPUs
Remove the checks for HAL_CPU_CLASS > HAL_CPU_CLASS_16 and
HAL_CPU_CLASS >= HAL_CPU_CLASS_75. Corresponding dead code will be
removed on separate commits.
2015-11-04 12:14:14 +11:00
Lucas De Marchi da86e29c27 AP_AHRS: remove check for AVR CPUs
Remove the checks for HAL_CPU_CLASS > HAL_CPU_CLASS_16 and
HAL_CPU_CLASS >= HAL_CPU_CLASS_75. Corresponding dead code will be
removed on separate commits.
2015-11-04 12:14:14 +11:00
Lucas De Marchi bdf92e8c79 StorageManager: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:13 +11:00
Lucas De Marchi 2847af905e RC_Channel: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:13 +11:00
Lucas De Marchi 039f42d916 GCS_MAVLink: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:13 +11:00
Lucas De Marchi 7cc96f3845 GCS_Console: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:13 +11:00
Lucas De Marchi 0dfeae2556 DataFlash: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:13 +11:00
Lucas De Marchi 3ba00feda4 AP_SerialManager: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:13 +11:00
Lucas De Marchi 8d9dfcab27 AP_Relay: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:13 +11:00
Lucas De Marchi 8d86d79c0b AP_RangeFinder: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:13 +11:00
Lucas De Marchi 0c6b47e331 AP_Parachute: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:12 +11:00
Lucas De Marchi d2c18a5c7b AP_Notify: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:12 +11:00
Lucas De Marchi d00c8e3a34 AP_NavEKF: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:12 +11:00
Lucas De Marchi e0e7b73ceb AP_NavEKF2: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:12 +11:00
Lucas De Marchi ad094b9073 AP_Mount: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:12 +11:00
Lucas De Marchi 3941bb7347 AP_Mission: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:12 +11:00
Lucas De Marchi c7871d1bca AP_Math: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:12 +11:00
Lucas De Marchi 266bb3b759 AP_L1_Control: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:12 +11:00
Lucas De Marchi 3142f21363 AP_InertialSensor: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:12 +11:00
Lucas De Marchi cf8203c08b AP_HAL_SITL: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:12 +11:00
Lucas De Marchi 8e65e88d06 AP_HAL: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:11 +11:00
Lucas De Marchi 973c3c6bc6 AP_HAL_FLYMAPLE: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:11 +11:00
Lucas De Marchi 24e5deb906 AP_GPS: remove comments about AVR boards 2015-11-04 12:14:11 +11:00
Lucas De Marchi eb75d73952 AP_Compass: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:11 +11:00
Lucas De Marchi b734777b95 AP_Common: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:11 +11:00
Lucas De Marchi 1c8f6c2ee5 AP_Camera: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:11 +11:00
Lucas De Marchi 12c88570d7 AP_BattMonitor: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:11 +11:00
Lucas De Marchi 4bd8b2ae35 AP_Baro: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:11 +11:00
Lucas De Marchi 221d822573 AP_Airspeed: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:11 +11:00
Lucas De Marchi 124937ab61 AP_AHRS: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:11 +11:00
Lucas De Marchi 4ae35c9a74 AP_ADC: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:11 +11:00
Lucas De Marchi c495bdb299 Remove AP_HAL_AVR
Replace everything under AP_HAL_AVR with a README.md file pointing to
the correct branch for AVR support.
2015-11-04 12:14:11 +11:00
Gustavo Jose de Sousa 8e351a058d AP_InertialSensor: MPU6000: enable data-ready pin for minlure
Data-ready pin wasn't being used before due to a bug in the Kernel with
concurrent accesses to GPIO in Intel Baytrail platforms. That has been fixed in
Kernel version 4.2.
2015-11-04 12:12:47 +11:00
Lucas De Marchi 3d1d6286e9 AP_InertialSensor: fix example build after PSTR removal 2015-11-04 12:11:59 +11:00
Andrew Tridgell a5a1680fb3 HAL_SITL: added support for real UART devices
This allows use of real UART devices in the simulator. Useful for GPS
driver work or other MAVLink peripherals
2015-11-04 11:29:04 +11:00
Lucas De Marchi 6984168a45 AP_HAL_Linux: don't log on failed semaphore
With commit 24f4153 ("AP_HAL_Linux: RCOutput_PCA9685: group writes") a
log was introduced when we can't get the bus semaphore. However since we
are calling the non blocking method, failing there is not that unlikely
if the bus is shared. Return back to the previous behavior of not
logging.
2015-11-03 11:08:00 +11:00
Paul Riseborough 9b37c29efa AP_NavEKF: Improve mag earth state reset accuracy
This removes errors in the in-flight reset of the earth field states by:

1) Using a state vector and magnetometer measurement from the same time coordinate
2) Not using the AHRS trim offsets in the calculation
2015-11-02 17:47:01 +09:00
Paul Riseborough 0dd5a7c4fa AP_NavEKF: Use correct blended delta time for all vel and pos integration
dtIMUactual has been spit into a separate dtDelAng and dtDelVel and dtDelVel1 and dtDelVel2 delta time in recognition of the amount of timing jitter and different update rates for the IMU's
2015-11-02 17:47:00 +09:00
Paul Riseborough 42214ec303 AP_NavEKF: Fix failure to start mag cal due to gyro noise
Vibration in the 400Hz delta angles could cause the angular rate condition check for in-flight magnetic field alignment to fail.
The symptons were failure to start magnetic field learning as expected when EK2_MAG_CAL=3 was set.
The calculation of a delta rotation between consecutive magnetometer samples has been introduced instead of the most recent IMU delta angle as this is less affected by noise and give an upper bound on the angular error.
the check has been moved into the magnetometer fusion control function so that any reset will be performed using fresh magnetometer data
2015-11-02 17:46:59 +09:00
Paul Riseborough 707089178f AP_NavEKF: Update default parameter values:
Explicitly set Plane parameters rather than rely on use of the default
If no type defined, default to Copter parameters (most common platform type
Enable different platform types to use different initial accel bias uncertainty
Reduce initial accel bias uncertainty for copter to prevent initial oscillation in bias and height estimate
2015-11-02 17:46:58 +09:00
Paul Riseborough 3d8f720aaf AP_NavEKF: Improve initial accel bias learning
Fuse synthetic velocity data at zero before arming to improve stability margins for initial bias offset learning.
2015-11-02 17:46:57 +09:00
Paul Riseborough 64ad7d6a50 AP_NavEKF: handle case where one IMU fails to return a delta velocity or angle 2015-11-02 17:46:56 +09:00
Paul Riseborough 69d4bd2481 AP_NavEKF: Protect against baro data errors in constant position mode
Large baro data errors when flying without GPS could cause total failure of the EKF.
This patch provides protection against this happening in-flight but allows for large innovations during preflight alignment.
2015-11-02 17:46:55 +09:00
Paul Riseborough 778b1c3e18 AP_NavEKF: Remove dead code for constant velocity mode 2015-11-02 17:46:54 +09:00
Paul Riseborough fb8e01a73c AP_NavEKF: Do not automatically accept DCM alignment data after 30 seconds
A looser check is applied at 30 seconds rather than no check.
2015-11-02 17:46:53 +09:00
Paul Riseborough be11e12f81 AP_NavEKF: Improve height reset during climbs and descents
Resets the vertical velocity to the GPS when the height is reset is the GPS is healthy
2015-11-02 17:46:53 +09:00
Paul Riseborough 59df23bc0f AP_NavEKF: Reduce EKF health pre-arm check false positives 2015-11-02 17:46:52 +09:00
Paul Riseborough aa14de9d39 AP_NavEKF2: Fix failure to start mag cal due to gyro noise
Vibration in the 400Hz delta angles could cause the angular rate condition check for in-flight magnetic field alignment to fail.
The symptons were failure to start magnetic field learning as expected when EK2_MAG_CAL=3 was set.
2015-11-02 14:12:17 +11:00
Paul Riseborough 2ebce110b7 AP_NavEKF2: Explicitly define plane build type for default parameters
Use Copter parameters if build type is unknown
2015-11-02 14:12:17 +11:00
Paul Riseborough 7ed36d8e65 AP_AHRS: Enable pre-flight GPS check status reporting for EKF2 2015-11-02 14:12:17 +11:00
Paul Riseborough b6d63d4b4e AP_NavEKF2: Fix reporting of pre-flight GPS checks
Re-order checks so that that less important messages are not hidden when the 40 character buffer overflows
Add required output methods
2015-11-02 14:12:16 +11:00
Paul Riseborough 7bd61a484c AP_NavEKF2: Faster initial accel bias learning 2015-11-02 14:12:16 +11:00
Paul Riseborough b15bf3243e AP_NavEKF2: Remove potential for division by zero 2015-10-30 15:34:26 +09:00
Paul Riseborough 5533a9a149 AP_NavEKF2: Add improved health monitoring when using simple compass yaw fusion 2015-10-30 15:34:23 +09:00
Paul Riseborough f539b597a3 AP_NavEKF2: Improve initialisation of magnetic field learning
Use the more robust, but less accurate compass heading fusion up to 5m altitude
Wait for the magnetometer data fusion time offset to be correct before using data to reset states
Don't reset magnetic field states if the vehicle is rotating rapidly as timing offsets will produce large errors
When doing the yaw angle reset, apply the reset increment to all quaternions stored in the output buffer to avoid transients produced by yaw rotations and the 0.25 second fusion time horizon offset.
Only do the one yaw and mag reset at 5m, not two at 1.5 and 5.0m
Always re-do the yaw and mag reset when leaving the ground.
2015-10-30 15:34:20 +09:00
Paul Riseborough 844ed95718 AP_NavEKF2: Add method to rotate output quaternion history 2015-10-30 15:34:17 +09:00
Paul Riseborough a1e32d71ec AP_NavEKF: Prevent large rotation rates corrupting the in-flight mag reset 2015-10-30 15:34:14 +09:00
Lucas De Marchi 1ce03c53a6 AP_Curve: remove wrong comment about PSTR
Not being able to leave the instantiation in ther header is not because
of PSTR issues, but basically because the instantiation needs to be in a
compilation unit, not in the header itself.
2015-10-30 14:35:49 +09:00
Lucas De Marchi 9203e2b929 AP_Common: remove PSTR definition 2015-10-30 14:35:48 +09:00
Lucas De Marchi 92016e9229 AP_Progmem: remove dead code
The only thing from AP_Progmem that's still used are the pgm_read_*
function and there's no support for AVR anymore. So remove the dead code
and use a single header to contain that inline functions.
2015-10-30 14:35:47 +09:00
Lucas De Marchi 68bef1ec64 AP_Param: fix wrong printf format for printf
"%S" is used for wide string, but we are passing a char*. Use lowercase
in this case to remove warnings like this:

libraries/AP_InertialSensor/AP_InertialSensor.cpp: In member function
'bool AP_InertialSensor::calibrate_accel(AP_InertialSensor_UserInteract*, float&, float&)':
libraries/AP_InertialSensor/AP_InertialSensor.cpp:620:61: warning:
format '%S' expects argument of type 'wchar_t*', but argument 3 has type 'const char*' [-Wformat=]
                 "Place vehicle %S and press any key.\n", msg);
                                                             ^
2015-10-30 14:35:45 +09:00
Lucas De Marchi d2a259cef0 DataFlash: fix wrong printf format for printf
"%S" is used for wide string, but we are passing a char*. Use lowercase
in this case to remove warnings like this:

libraries/AP_InertialSensor/AP_InertialSensor.cpp: In member function
'bool AP_InertialSensor::calibrate_accel(AP_InertialSensor_UserInteract*, float&, float&)':
libraries/AP_InertialSensor/AP_InertialSensor.cpp:620:61: warning:
format '%S' expects argument of type 'wchar_t*', but argument 3 has type 'const char*' [-Wformat=]
                 "Place vehicle %S and press any key.\n", msg);
                                                             ^
2015-10-30 14:35:42 +09:00
Lucas De Marchi bdd1d5e9d4 AP_Menu: fix wrong printf format for printf
"%S" is used for wide string, but we are passing a char*. Use lowercase
in this case to remove warnings like this:

libraries/AP_InertialSensor/AP_InertialSensor.cpp: In member function
'bool AP_InertialSensor::calibrate_accel(AP_InertialSensor_UserInteract*, float&, float&)':
libraries/AP_InertialSensor/AP_InertialSensor.cpp:620:61: warning:
format '%S' expects argument of type 'wchar_t*', but argument 3 has type 'const char*' [-Wformat=]
                 "Place vehicle %S and press any key.\n", msg);
                                                             ^
2015-10-30 14:35:41 +09:00
Lucas De Marchi 62ba8266ef AP_InertialSensor: fix wrong printf format for printf
"%S" is used for wide string, but we are passing a char*. Use lowercase
in this case to remove warnings like this:

libraries/AP_InertialSensor/AP_InertialSensor.cpp: In member function
'bool AP_InertialSensor::calibrate_accel(AP_InertialSensor_UserInteract*, float&, float&)':
libraries/AP_InertialSensor/AP_InertialSensor.cpp:620:61: warning:
format '%S' expects argument of type 'wchar_t*', but argument 3 has type 'const char*' [-Wformat=]
                 "Place vehicle %S and press any key.\n", msg);
                                                             ^
2015-10-30 14:35:40 +09:00
Lucas De Marchi 5244559010 Minimize AP_Progmem.h includes
Most of AP_Progmem is already gone so we can stop including it in most
of the places. The only places that need it are the ones using
pgm_read_*() APIs.

In some cases the header needed to be added in the .cpp since it was
removed from the .h to reduce scope. In those cases the headers were
also reordered.
2015-10-30 14:35:32 +09:00
Lucas De Marchi a65c98485c AP_HAL: UARTDriver: remove _P() variants
They aren't used anymore so remove.
2015-10-30 14:35:31 +09:00
Lucas De Marchi 1b07dabeb7 Replace prog_char and prog_char_t with char
prog_char and prog_char_t are now the same as char on supported
platforms. So, just change all places that use them and prefer char
instead.

AVR-specific places were not changed.
2015-10-30 14:35:30 +09:00
Lucas De Marchi b52d1cfabb DataFlash: remove DataFlash.Log_Write_Message_P() 2015-10-30 14:35:29 +09:00
Lucas De Marchi 4ab9821624 Replace use of Log_Write_Message_P() with Log_Write_Message() 2015-10-30 14:35:28 +09:00
Lucas De Marchi 132303db4b AP_InertialSensor: use printf() rather than _printf_P() 2015-10-30 14:35:27 +09:00
Lucas De Marchi 2556fc8dbe BetterStream: use common macro for printf formatting
Since this needs an additional header, also put them in correct order.
2015-10-30 14:35:26 +09:00
Lucas De Marchi 20c6ffc5e3 Replace use of UARTDriver::printf_P() with UARTDriver::printf()
This also starts to show warnings on places that were already using
wrong printf format strings.
2015-10-30 14:35:25 +09:00
Lucas De Marchi 7ceffb1e2b Replace use of vprintf_P() with vprintf() 2015-10-30 14:35:23 +09:00
Lucas De Marchi 6f4904189b Replace use of println_P() with println() 2015-10-30 14:35:22 +09:00
Lucas De Marchi a964ac38ec Replace use of print_P() with print() 2015-10-30 14:35:21 +09:00
Lucas De Marchi 65e719ccc3 AP_Param: replace find_P() with find() 2015-10-30 14:35:19 +09:00
Lucas De Marchi af88ebf477 GCS_MAVLink: remove send_text_P() in favor of send_text() 2015-10-30 14:35:18 +09:00
Lucas De Marchi 831d8acca5 Remove use of PROGMEM
Now variables don't have to be declared with PROGMEM anymore, so remove
them. This was automated with:

    git grep -l -z PROGMEM | xargs -0 sed -i 's/ PROGMEM / /g'
    git grep -l -z PROGMEM | xargs -0 sed -i 's/PROGMEM//g'

The 2 commands were done so we don't leave behind spurious spaces.

AVR-specific places were not changed.
2015-10-30 14:35:16 +09:00
Lucas De Marchi d595e41003 Replace use of strncmp_P() with strncmp() 2015-10-30 14:35:14 +09:00
Lucas De Marchi 0aa117f65d Replace use of strnlen_P() with strnlen() 2015-10-30 14:35:13 +09:00
Lucas De Marchi 1336d621be Replace use of strcpy_P() with strcpy() 2015-10-30 14:35:12 +09:00
Lucas De Marchi e4b313d2ca Replace use of memcpy_P() with memcpy() 2015-10-30 14:35:11 +09:00
Lucas De Marchi f8f3f5a024 Replace use of strlen_P() with strlen() 2015-10-30 14:35:10 +09:00
Lucas De Marchi aa370fe758 Replace use of strcmp_P() with strcmp() 2015-10-30 14:35:09 +09:00
Lucas De Marchi 6f0db45b57 Replace use of strcasecmp_P() with strcasecmp() 2015-10-30 14:35:08 +09:00
Lucas De Marchi a8455aa4e3 AP_HAL: Remove Util::{v,}snprintf_P() 2015-10-30 14:35:06 +09:00
Lucas De Marchi 84d5fb006f Remove use of Util::{v,}snprintf_P()
These are now the same function as Util::snprintf().
2015-10-30 14:35:05 +09:00
Lucas De Marchi 2c38e31c93 Remove use of PSTR
The PSTR is already define as a NOP for all supported platforms. It's
only needed for AVR so here we remove all the uses throughout the
codebase.

This was automated with a simple python script so it also converts
places which spans to multiple lines, removing the matching parentheses.

AVR-specific places were not changed.
2015-10-30 14:35:04 +09:00
Randy Mackay 4d458833dc AP_NavEKF2: remove unnecessary PV_AidingMode check
Thanks to OXINARF for catching this
2015-10-30 12:52:49 +09:00
Paul Riseborough b459d937ad AP_NavEKF2: Clean up GPS fusion timeout logic and comments 2015-10-30 12:24:19 +09:00
Paul Riseborough 61d556afb1 DataFlash: Fix shorthand variable names for EKF position reset delta 2015-10-30 12:24:18 +09:00
Randy Mackay adee13d729 AC_WPNav: handle ekf position reset in Loiter and Brake 2015-10-30 12:24:17 +09:00
Randy Mackay 94adaba305 AP_NavEKF2: constify getLastPosNorthEastReset
Also constify getLastVelNorthEastReset
2015-10-30 12:24:16 +09:00
Randy Mackay 3f29365cae AP_NavEKF: constify getLastPosNorthEastReset 2015-10-30 12:24:15 +09:00
Randy Mackay 4e959ef6f9 AP_AHRS: constify getLastPosNorthEastReset
Also constify getLastVelNortEastReset
2015-10-30 12:24:13 +09:00
Randy Mackay 52ed075405 AP_NavEKF2: constify getLastYawResetAngle 2015-10-30 12:24:12 +09:00
Randy Mackay 758c5a7d7f AP_NavEKF: constify getLastYawResetAngle 2015-10-30 12:24:11 +09:00
Randy Mackay 7c20577ee0 AP_AHRS: constify getLastYawResetAngle 2015-10-30 12:24:10 +09:00
Randy Mackay 040ec481f4 AC_WPNav: loiter uses pos_control.shift_pos_xy_target 2015-10-30 12:24:09 +09:00
Randy Mackay 550ba478c9 AC_PosControl: add shift_pos_xy_target 2015-10-30 12:24:08 +09:00
Randy Mackay 16a0281c92 AC_PosControl: remove unused set_vel_target 2015-10-30 12:24:07 +09:00
Paul Riseborough 0b1a6a2157 AP_NavEKF2: Clean up GPS timeout logic 2015-10-30 12:24:06 +09:00
Paul Riseborough f67f6b01f4 AP_AHRS: Publish the EKF position and velocity reset deltas 2015-10-30 12:24:05 +09:00
Paul Riseborough 74da4d8e57 AP_NavEKF2: Remove GPS glitch offset logic
Correction for steps in position and velocity caused by resets following GPS glitches and other events are now handled by the control loops.
2015-10-30 12:24:04 +09:00
Paul Riseborough 4fdec67546 AP_NavEKF2: Publish the position and velocity state reset deltas
Used by the control loops to compensate for step changes in position and velocity when the EKF needs to do a reset of these states.
2015-10-30 12:24:02 +09:00
Paul Riseborough 7c40448bab AP_NavEKF: Remove GPS glitch offset logic
The correction for offsets due to position and velocity resets will now be handled in the control loops.
2015-10-30 12:24:01 +09:00
Paul Riseborough 5489ff9118 AP_NavEKF: publish position and velocity state reset data
Used by the control loops to compensate for steps in velocity and/or position resulting from state resets.
2015-10-30 12:24:00 +09:00
Tom Pittenger 0d36c4c07b GCS_MAVLink: version update after generate 2015-10-30 11:16:30 +09:00
Tom Pittenger bf9d4b5898 GCS_MAVLink: generate adds abort Alt label in MAV_CMD_NAV_LAND
code is already implemented and released
2015-10-30 11:15:50 +09:00
Randy Mackay c52f16b86f AC_WPNav: increase param description max for LOIT_JERK 2015-10-29 12:16:30 +09:00
Randy Mackay 49c4a133d7 AC_WPNav: set jerk separately for wpnav and loiter 2015-10-29 12:10:47 +09:00
Randy Mackay ee0abb1750 AC_PosControl: add set_jerk_xy 2015-10-29 12:10:44 +09:00
Jonathan Challinger 853f8bfaf4 AC_WPNav: stop gradually in loiter 2015-10-28 20:21:55 +09:00
Randy Mackay 73f4533995 AC_PosControl: minor comment update 2015-10-28 20:21:53 +09:00
Randy Mackay 895a40893d AC_PosControl: use_desvel_ff flag added
This allows turning on/off desired velocity feedforward without setting desired_vel.z to zero.  Setting desired_vel.z to zero has the side effect of disrupting the landing detection which needs to know if we are trying to descend
2015-10-28 20:21:52 +09:00
Leonard Hall aec66c5db6 AC_PosControl: faster z-axis slowdown when over speed 2015-10-28 20:21:38 +09:00
Leonard Hall 245f7ce268 AC_PosControl: allow desired vel z to be above speed limit 2015-10-28 17:59:36 +09:00
Leonard Hall f55c31a157 AC_PosControl: add alt hold without feed forward 2015-10-28 17:57:20 +09:00
Andrew Tridgell aee2543b75 AP_Parachute: fixed release bug
if release() is called within 1 millisecond of update() the release
wouldn't happen
2015-10-27 16:06:34 +11:00
Andrew Tridgell 0d9715cfe8 AP_Parachute: added a released() function
used to help with throttle suppression in plane
2015-10-27 16:06:34 +11:00
Randy Mackay ca942f39dd AP_Motors_Heli: remove unused allow_arming check 2015-10-27 09:14:40 +09:00
Andrew Tridgell 724f5511aa SITL: support multiple jsbsim aircraft types
use -f jsbsim:ModelName
2015-10-27 10:01:34 +11:00
Randy Mackay e9cec1203a GCS_MAVLink: version update after generate 2015-10-26 16:28:54 +09:00
Randy Mackay e51498aa45 GCS_MAVLink: generate after adding DO_SEND_BANNER 2015-10-26 16:28:52 +09:00
Jonathan Challinger 36bb5a25a2 GCS_MAVLink: add MAV_CMD_DO_SEND_BANNER 2015-10-26 16:28:49 +09:00
squilter 9de2ec04f6 AC_PrecLand: update comments to reflect change from bf_angle to angle 2015-10-26 09:45:05 +09:00
squilter 9e7099f5ee AC_PrecLand: implement frame of reference 2015-10-26 09:45:03 +09:00
squilter e409bd0a58 AC_PrecLand: rename bf_angle to angle 2015-10-26 09:45:01 +09:00
Andrew Tridgell c228ea4371 AP_NavEKF2: prevent a valgrind error on startup 2015-10-26 11:34:32 +11:00
Jonathan Challinger c762865d66 AP_Mount: use configured function to determine if MNT_TYPE has been configured 2015-10-26 11:15:54 +11:00
Jonathan Challinger f0f5239d8f AP_L1_Control: use set_default for runtime param defaults 2015-10-26 11:15:54 +11:00
Jonathan Challinger 21e7d46944 RC_Channel: use set_default for runtime param defaults 2015-10-26 11:15:54 +11:00
Jonathan Challinger 39246c13ad AP_Param: add set_default, configured 2015-10-26 11:15:54 +11:00
Paul Riseborough 87ea9acc7f AP_NavEKF2: Fix mavlink parameter label 2015-10-26 08:05:15 +11:00
Paul Riseborough 1cf626692c AP_NavEKF: Reduce impact of altimeter flow disturbance error on Copter alt hold
This increase in assumed altimeter noise and reduction in accel noise has been flight tested by L.Hall with noticeable reduction in the immediate response to Baro errors during moving flight.
This increases the time constant of response to baro errors such that the pilot can more easily compensate.
2015-10-26 08:05:15 +11:00
Paul Riseborough e692e30988 AP_NavEKF2: Reduce allowance for magnetometer timing errors
The previous gain from rate to magnetometer error was excessive. The revised value is equivalent to a magnetic field length of 0.5 with a timing uncertainty of 0.01 sec
2015-10-26 08:05:15 +11:00
Paul Riseborough 4c5ba60578 AP_NavEKF2: Remove dead code 2015-10-26 08:05:15 +11:00
Andrew Tridgell 142aa59bce AP_InertialSensor: fixed vibration logging after recent changes 2015-10-26 07:26:17 +11:00
Lucas De Marchi 9eaf7c5660 AP_HAL: add format attribute to panic() 2015-10-24 14:26:36 +11:00
Lucas De Marchi 2322b8014d AP_HAL: use common macro for printf formatting 2015-10-24 14:26:36 +11:00
Lucas De Marchi dc95145de2 AP_Common: add attribute to sanitize prinf-like functions
Make the compiler emit warnings if the variables don't match the
printf format string. To be added in functions with printf-like
arguments.
2015-10-24 14:26:36 +11:00
Lucas De Marchi 3650eb468f AP_HAL_FLYMAPLE: Scheduler: implement variadic version of panic() 2015-10-24 14:26:36 +11:00
Lucas De Marchi e2d1fab863 AP_HAL_Empty: Scheduler: implement variadic version of panic() 2015-10-24 14:26:36 +11:00
Lucas De Marchi 6027a02fe9 AP_HAL_SITL: Scheduler: implement variadic version of panic() 2015-10-24 14:26:36 +11:00
Lucas De Marchi e9d92c446c AP_HAL_VRBRAIN: Scheduler: implement variadic version of panic() 2015-10-24 14:26:36 +11:00
Lucas De Marchi f791767fb2 AP_HAL_PX4: Scheduler: implement variadic version of panic() 2015-10-24 14:26:36 +11:00
Lucas De Marchi 4b54bcbfad AP_HAL_Linux: use variadic panic()
While at it also add a prefix with the name of the driver.
2015-10-24 14:26:36 +11:00
Lucas De Marchi 2af4244854 AP_HAL_Linux: Scheduler: implement variadic version of panic() 2015-10-24 14:26:36 +11:00
Lucas De Marchi ad61a93c14 AP_HAL: turn panic() into a variadic method
Change the declaration on all HAL implementations so panic() in future
may implement a printf-like interface.
2015-10-24 14:26:35 +11:00
Lucas De Marchi 0b4aa5ac85 AP_HAL: Scheduler: reorder includes
Follow the following order for includes:

   - Corresponding header file (if exists)
   - System headers
   - Other ArduPilot library headers
   - "Local" headers (from the same library)
2015-10-24 14:26:35 +11:00
Paul Riseborough 55ac8f0230 AP_NavEKF2: Update parameter values.
Testing on different platforms has shown that the new EKF has smaller innovations enabling innovation consistency checks that reject GPS and baro errors to be tightened.
The position and velocity thresholds for plane have been left the same because planes are less sensitive to GPS glitches as they fly higher and with more separation to surrounding objects. They are also more prone to bad inertial data due to the installation practices.
The altitude noise has been increased on plane to allow for the larger baro disturbances that result from the higher speeds and lack of a proper static pressure source. The innovation consistency gate has been adjusted to provide the same baro error limit of ~20m before baro is rejected.
2015-10-24 07:26:50 +11:00
Paul Riseborough 1e7ac873b9 AP_NavEKF2: Improve handling of GPS loss and recovery for planes
Extended GPS loss can result in the earth field states becoming  rotated and making it difficult for the EKF to recover its heading when GPS is regained.
During prolonged GPS outages, the position covariance can become large enough to cause the reset function to continually activate. This is fixed by ensuring that position covariances are always reset when the position is reset.
The innovation variance was being used incorrectly instead of the state variance to trigger the glitch reset.
2015-10-24 07:17:11 +11:00
Paul Riseborough cd5ec3a3e0 AP_NavEKF2: Reduce angle errors when flying without GPS
Turn off aiding during >1g manoeuvres when not using GPS
Use larger velocity and position uncertainties when flying without GPS
2015-10-23 19:04:30 +11:00
Paul Riseborough 1eaf318b9b AP_NavEKF2: Faster learning of gyro scale factors 2015-10-23 19:04:30 +11:00
Paul Riseborough a2f5962f77 AP_NavEKF2: Reduce effect of baro disturbances 2015-10-23 19:04:30 +11:00
Paul Riseborough 5eb7cf1fbf AP_NavEKF: Reduce roll/pitch disturbance when magnetic field is reset
Because we have changed the yaw angle and have taken a point sample on the magnetic field, covariances associated with the magnetic field states will be invalid and subsequent innovations could cause an unwanted disturbance in roll and pitch.
The reset of the Euler angles to a new yaw orientation was being done using roll and pitch from the output observer states, not the EKF state vector which meant that when roll and pitch were changing, the reset to a new yaw angle would also cause a roll and pitch disturbance.
2015-10-23 19:04:30 +11:00