Commit Graph

17527 Commits

Author SHA1 Message Date
Lucas De Marchi e232543fca AP_Compass: AK8963: change initialization and rename methods
We need to check the AK8963's id before anything else Here we are
reordering the calls to _calibrate() and _check_id(). After that we
don't need to read and write again the AK8963_CNTL1 register.

While at it do some renames as well:
	- _configure() -> _setup_mode(): since now there's a
 	  _bus->configure() it became confusing what actually it's
	  doing.
	- make error messages say what we were actually trying to do but
	  couldn't. Also remove PSTR since this is linux-only.
	- start_conversion() -> start_measurements():  We are instructing the
          bus to start to get the samples, not to tell the chip to start an
          analog->digital conversion like in other sensors.
2015-07-23 17:44:35 +10:00
Lucas De Marchi ae5d9baddb AP_Compass: AK8963: remove defines not used anymore
The MPUREG_PWR_MGMT_1 defines were used when we cared about the MPU9250
initialization code. Now all initialization is done by the MPU9250 class
itself, so remove these defines.

Also remove AK8983_SELFTEST_MAGNETIC_FIELD_ON that is never used and let
the defines always with 2 bytes to improve readability.
2015-07-23 17:44:34 +10:00
Lucas De Marchi cae895bfdf AP_Compass: AK8963: group members together
Besides being semantically related, this removes the hole due to
alignment. The size is the same since the hole is actually turned into
padding.
2015-07-23 17:44:34 +10:00
Lucas De Marchi 28d3d775a4 AP_Compass: AK8963: remove resolution member
We only use the highest one and there's no intention to support the
14bits one. Just use the define rather than saving it as a member.
2015-07-23 17:44:34 +10:00
Lucas De Marchi 86b3312112 AP_Compass: AK8963: factor out common code of read_raw()
Similar code was added in the read_raw() implementation for each bus.
Add a new POD struct read_raw to contain the registers from the AK8963
and use it instead as argument.
2015-07-23 17:44:33 +10:00
dgrat d941174978 AP_Compass: AK8963: enhance the readability
Reduce the deepness of indentation and fix coding style.
2015-07-23 17:44:33 +10:00
Randy Mackay c627f84fa8 Copter: Ch6 circle rate as float 2015-07-23 16:21:23 +09:00
Randy Mackay 28c722c157 AC_Circle: rate change takes effect immediately 2015-07-23 16:21:20 +09:00
Przemek Lekston 4b38d444dd Plane: fix default behaviour of flaps. 2015-07-23 15:28:08 +10:00
Przemek Lekston 6a62b11536 Plane: fix LOITER_TO_ALT to verify headings towards waypoints within the loiter radius.
Whenever next waypoint is within the loiter radius, maintaining loiter would prevent us from ever pointing toward the next waypoint. Hence for very close waypoints loiter_to_alt becomes verified by the altitude only.
2015-07-23 15:24:43 +10:00
Tom Pittenger d51e6d466b AP_HAL_SITL: add support for airspeed failures 2015-07-23 14:38:06 +10:00
Tom Pittenger 250dcd31a2 SITL: Add ARSP_FAIL param
This will allow testing pitot tube hardware failures
2015-07-23 14:38:06 +10:00
Andrew Tridgell 5cc7c456a7 autotest: fixed sense of test for autotest directory
fixes PR#2593
2015-07-23 14:36:18 +10:00
Staroselskii Georgii d7ac725a64 AP_HAL_Linux: fixed signal handler in RCInput_Navio
DMA is getting stopped in the separate method now. This is the best we
can get at the current time. It does yield slightly better experience
and works in the majority of cases.

The patch is a no bulletproof solution, though.

There's a possibility of corruption in case of e.g. a SIGKILL. There's
no signal framework at the time and the commit doesn't add one. That's
why all signals are handled in the same erroneous way. This is not a
good nor a final solution to the issue.

For the issue at hand a better fix might be porting the code to kernel
space but it's a rather tediuos task that we cannot undertake in the
couple of weeks.
2015-07-23 08:51:38 +10:00
Staroselskii Georgii 8528a7d159 AP_HAL_Linux: added deinit logic for RCInput_Navio
DMA needs to be stopped if a panic occurs.
2015-07-23 08:51:37 +10:00
Staroselskii Georgii f4d14f73ba AP_HAL_Linux: extended panic handling with RCInput deinitialization
The issue has already come up. There's no deinitialization mechanisms at the moment. As APM is rather software than firmware on Linux, there're some clean-up work that needs to be done. This commit triggers deinitialization of RCInput on a panic.
2015-07-23 08:51:37 +10:00
Vladislav Zakharov 97b51a4bcb AP_HAL: Added deinit() method to RCInput
Add a deinit() counterpart. This is needed for some ports that require some deinitializtion logic. The default implementation is empty. I'm not sure whether we need to inforce it for all.
2015-07-23 08:51:37 +10:00
Tom Pittenger 9737c426eb SITL: Gazebo index out of bound
- imu_orientation_quat[size=3] is fed to Quaternion[size=4] which causes an index-out-of-range problem
2015-07-22 21:33:46 +10:00
Michael du Breuil 59dda49cce AP_GPS: Fix missing reserved fields in the UBX-RXM-RAWX message 2015-07-22 21:31:10 +10:00
Michael du Breuil 09fef505e0 AP_GPS: With a ublox driver, accept a packet if it will fit in the buffer 2015-07-22 21:31:10 +10:00
Michael du Breuil 22b16b4532 AP_GPS: Enable selecting what GNSS system to use if the reciever supports it
Ublox 7 and 8 seires use a UBX-CFG-GNSS message to enable satellite constellations. The default value does not enable any additional ones, and any constellations the reciever doesn't report knowing about are not configured.
2015-07-22 21:31:10 +10:00
Michael du Breuil 47592a1953 AP_GPS: Raise the baud rate on a ublox GPS if using RAW logging
the implementation leaves an easy path forward for providing a different startup blob for all the GPS's if raw logging is enabled
2015-07-22 21:31:09 +10:00
Michael du Breuil 19bb96b9cb AP_GPS: Improve startup logic for detecting what gps is connected
Remove race condition on sending intial blob to the GPS, it was possible to send a blob that got the GPS configured enough to allow the autodetect to take over (and then some drivers like ublox would not finish sending the blob, which has potential details that the driver might have needed to send)

Limit the delay to checking for NMEA gps to only checking after all the available baud rates have been checked

Since a UBlox will actually report having DGPS (due to SBAS or RTCM data) actually report this as the highest supported mode
2015-07-22 21:31:09 +10:00
Grant Morphett 9a79baef59 Rover: Merged a bug fix from Plane.
Merged a bug fix where mode would not revert on geo-fence disable.
The mode would not revert if the switch was in position 0.
Geofencing will soon be in Rover and I didn't want to forget this bug
and chase it later so committing it now.  It works fine in Rover now
even though the geofencing code isn't in yet.
2015-07-22 21:27:36 +10:00
Grant Morphett 873e6c8e29 Rover: Doubled the rate at which read_control_switch is called.
As the previous commit as doubled the number of reads required to
confirm that the mode change switch has been changed this means it
will halve the speed it changes at.  So we double the rate at which we
read it to keep things consistent.
2015-07-22 21:26:37 +10:00
Grant Morphett 4f6259f374 Rover: Added mode switch debouncing from Plane. 2015-07-22 21:26:37 +10:00
Randy Mackay 7935bf70f1 Copter: rc_override active only on non-zero overrides
Bug found by Kevin Hester
2015-07-22 17:32:30 +09:00
Randy Mackay 7f97f7d0a3 Git: ignore logs, mav.parm for plane, rover 2015-07-22 11:11:37 +09:00
squilter 30201b5136 Git: ignore logs, mav.parm for copter 2015-07-22 11:11:34 +09:00
Arthur Benemann e3398648d7 GCS_MAVLink: fix debug formatting 2015-07-21 21:41:34 +09:00
Randy Mackay 521f3dc4b9 GCS_MAVLink: only forward msg once per channel
Issue found and alternative fix provided by Arthur Benemann
2015-07-21 21:41:32 +09:00
Randy Mackay 6f72d202fe GPS: fix parameter descriptions 2015-07-21 19:50:12 +09:00
Grant Morphett 1fb81777f1 Rover: deleted the old command_description.txt file which isn't used. 2015-07-21 16:31:26 +09:00
Grant Morphett cc6a981b12 Plane: deleted the old command_description.txt file which isn't used. 2015-07-21 16:31:24 +09:00
Randy Mackay e31f2d26c4 MotorsMulticopter: move get_hover_throttle_as_pwm to protected
No functional change
2015-07-21 16:27:04 +09:00
Randy Mackay c7c6228b5d MotorsMulticopter: remove virtual from set_yaw_headroom 2015-07-21 16:27:01 +09:00
Randy Mackay 908afad65c Copter: reset yaw angle target when disarmed or landed in AltHold 2015-07-21 16:26:50 +09:00
Randy Mackay 157c97447d AC_AttControlHeli: init passthrough_yaw 2015-07-21 16:26:27 +09:00
Randy Mackay 35a924703f Copter: change multirotor comments to multicopter
No functional change
2015-07-21 16:26:25 +09:00
Randy Mackay 1b68d0eead Copter: no MotBatt logging for TradHeli 2015-07-21 16:26:22 +09:00
Randy Mackay 4cacff54b4 Copter: no update_throttle_thr_mix for TradHeli 2015-07-21 16:26:19 +09:00
Randy Mackay 5baf98bcfc Copter: no get_throttle_pre_takeoff for TradHeli 2015-07-21 16:26:17 +09:00
Randy Mackay 0f174053d6 Coptre: disable esc calibration for TradHeli 2015-07-21 16:26:14 +09:00
Randy Mackay 1af383253f Copter: disable compassmot for TradHeli 2015-07-21 16:26:11 +09:00
Randy Mackay 546d668d1d Copter: no set_hover_throttle for TradHeli 2015-07-21 16:26:07 +09:00
Randy Mackay 88b617707f Copter: call set_throttle_range for multicopters only 2015-07-21 16:26:05 +09:00
Randy Mackay 53aad69fa2 Copter: include AttControl_Multi.h 2015-07-21 16:26:02 +09:00
Randy Mackay 0af7fb93e5 Copter: rename param to MotorsMulticopter 2015-07-21 16:25:58 +09:00
Randy Mackay 8b4805bfcb AC_AttControl_heli: add MotorsHeli include 2015-07-21 16:25:56 +09:00
Randy Mackay bf2bf2e3fa AC_AttControl_Multi: new multirotor specific attitude control class 2015-07-21 16:25:53 +09:00