Commit Graph

639 Commits

Author SHA1 Message Date
Caio Marcelo de Oliveira Filho bad68829ae APMrover2: include SITL only for SITL board
Include board-specific files only when the board is used. Since these
should be exceptional cases, let the includer handle the ifdef instead
of putting ifdefs in every platform-specific header.

In the future we should evaluate whether the HAL for the board should
instantiate this.
2015-10-22 13:36:14 -02:00
Caio Marcelo de Oliveira Filho 49a42dc985 SITL: use a SITL namespace 2015-10-22 11:04:42 -02:00
Peter Barker 5db4549d79 Rover: use simple log entry numbers to download logs 2015-10-21 10:50:32 +11:00
Caio Marcelo de Oliveira Filho 06b2c966c1 APMrover2: implement HAL::Callbacks
Also removes includes for each board since they are not necessary
anymore.
2015-10-21 09:16:09 +11:00
Caio Marcelo de Oliveira Filho ec52df991c build: compile only the HAL files needed by the board
Instead of requiring every program to specify the HAL related modules,
let the build system do it (in practice everything we compiled depended
on HAL anyway). This allow including only the necessary files in the
compilation.
2015-10-21 09:16:07 +11:00
Caio Marcelo de Oliveira Filho 2e464a53c2 AP_HAL: make code not depend on concrete HAL implementations
The switching between different AP_HAL was happening by giving different
definitions of AP_HAL_BOARD_DRIVER, and the programs would use it to
instantiate.

A program or library code would have to explicitly include (and depend)
on the concrete implementation of the HAL, even when using it only via
interface.

The proposed change move this dependency to be link time. There is a
AP_HAL::get_HAL() function that is used by the client code. Each
implementation of HAL provides its own definition of this function,
returning the appropriate concrete instance.

Since this replaces the job of AP_HAL_BOARD_DRIVER, the definition was
removed.

The static variables for PX4 and VRBRAIN were named differently to avoid
shadowing the extern symbol 'hal'.
2015-10-21 09:16:07 +11:00
Gustavo Jose de Sousa 7c725bb59e APMrover2: use compass get_{field,offsets}() functions
Both functions are equivalent, so we're going to simply use
get_{field,offsets}() instead of get_{field,offsets}_milligauss().
2015-10-15 19:56:04 +09:00
Grant Morphett 461eff25d5 Rover: Fixed a build issue on Windows with the new RPM library
The AP_RPM library needed to be added to make.inc for the sitl build
to work correctly on Windows.  Thanks to Zach for solving the issue
in this discussion
http://diydrones.com/group/ardurover-user-group/forum/topics/rover-sitl-build-failed?commentId=705844%3AComment%3A2109049&xg_source=msg_com_gr_forum
2015-10-11 16:00:58 +09:00
Randy Mackay 93b0dd4d61 Rover: add no break comment to avoid compiler warning 2015-10-03 12:56:26 +09:00
Randy Mackay 836fff2119 Rover: send home position when home is set or get-home msg received 2015-10-03 12:56:21 +09:00
Andrew Tridgell 64410b10fb Rover: use ahrs.send_ekf_status_report() 2015-09-29 10:59:28 +10:00
Andrew Tridgell 5cac948ed0 Rover: added EK2_ parameters and EKF2 instance 2015-09-23 11:56:27 +10:00
Randy Mackay bcc87a9a3b Rover: replace SKIP_GYRO_CAL with INS_GYR_CAL
Also calibrate gyros during accel trim
2015-09-21 17:06:45 +09:00
Andrew Tridgell 42ed989da0 Rover: log mode in dataflash callback
this ensures every log has the initial mode
2015-09-17 20:14:35 +10:00
Stewart Loving-Gibbard 2c62a3a1c5 Rover: Adding Logging of RSSI data. 2015-09-16 16:41:48 +09:00
squilter 97b901a5fb Rover: Support do_digicam_x via command_long 2015-09-16 13:06:55 +09:00
Peter Barker d6e380496c Rover: ensure 10% free space when initialising logging 2015-09-09 12:22:36 +10:00
Staroselskii Georgii 8bb7e2d4b0 Rover: make Rover use milligauss 2015-09-09 10:38:16 +10:00
Grant Morphett 571b4478fd Rover: Using a new method to check for throttle failsafe
This method checks for throttle reversal.
2015-09-09 10:28:02 +10:00
Grant Morphett f5c7ac7a00 Rover: Fixing issue 302
Using the configured FS_THR_VALUE to check for failsafe instead of
just checking against 50 below throttle min.
2015-09-09 10:28:01 +10:00
Andrew Tridgell b87ed96825 Rover: fix for changed AP_RangeFinder API 2015-09-08 16:46:52 +10:00
Grant Morphett 90b48fe46a Rover: Fixing issue 327 - reporting Baro alt instead of GPS 2015-09-08 09:40:39 +10:00
Randy Mackay 958d279b7c Rover: support do-mount-control via command-long 2015-09-06 16:01:28 +09:00
Siddharth Bharat Purohit b8a9f9ebc5 APMrover2: implement on-board compass calibration for APMrover 2015-09-03 16:59:14 +10:00
Peter Barker 6e3687f8af Rover: DFMessageWriter; ability to trickle messages out to DF 2015-09-03 15:20:20 +10:00
Gustavo Jose de Sousa d6778fbf53 APMrover2: use function name for AP_Scheduler task name
That makes it easier to identify tasks when debug is enabled in AP_Scheduler.
2015-09-01 20:22:18 +10:00
Gustavo Jose de Sousa 30ffd0cbd2 APMrover2: use designated initializers for tasks structs
Makes code less prone to break build and semantics (e.g., when a new field is
added).
2015-09-01 20:22:18 +10:00
Stewart Loving-Gibbard a315b980bf Rover: Moving to RSSI library for reading various kinds of RSSI, with the possibility of adding more.
* Retains ability to read from Analog Pin
* Adds ability to read RSSI from PWM channel value as is done in OpenLRSng, EazyUHF, and various other LRS.
* Handles any type of RSSI that provides RSSI values inverted - i.e. when the low value is the best signal and the high value is the worst signal.
* Has different key names from all existing RSSI parameters to provide for a clean break and easier distinguishing.
* Existing parameters are marked as obsolete
2015-08-29 08:05:59 +10:00
Randy Mackay 84252405c3 Rover: sanity check ROI target 2015-08-27 15:15:59 +09:00
Randy Mackay 536311744d Rover: fix link to BATT param descriptions 2015-08-26 11:17:53 +09:00
squilter b4cf0ce2bb Rover: update severity values 2015-08-25 14:04:40 +09:00
squilter 06eb53402f Rover: define and send FIRMWARE_VERSION 2015-08-23 09:21:53 +09:00
Tom Pittenger 2319bdb068 Rover: queue MISSION_ITEM_REACHED
clean up unreachable code
2015-08-19 15:42:08 +10:00
Tom Pittenger 545d926d20 Rover: bring rover mission callback inline with copter and plane 2015-08-19 15:26:32 +10:00
Stewart Loving-Gibbard c55e4e275d Rover: fix spelling errors in Parameters.cpp 2015-08-18 09:54:04 +09:00
Grant Morphett f4d319ba83 Rover: Including the sonar/rangefinder status in SYS_STATUS message 2015-08-12 06:34:26 -07:00
Andrew Tridgell 3ce5f62420 Rover: prevent build error with MSG_RPM 2015-08-12 15:03:51 +10:00
Gustavo Jose de Sousa 01e05ce743 APMrover2: standardize inclusion of libaries headers
This commit changes the way libraries headers are included in source files:

 - If the header is in the same directory the source belongs to, so the
 notation '#include ""' is used with the path relative to the directory
 containing the source.

 - If the header is outside the directory containing the source, then we use
 the notation '#include <>' with the path relative to libraries folder.

Some of the advantages of such approach:

 - Only one search path for libraries headers.

 - OSs like Windows may have a better lookup time.
2015-08-11 16:28:40 +10:00
Grant Morphett 92a7a3e6ff Rover: Lets put Rover into BETA - v2.2.51
I also made myself the maintainer - ssshhh - don't tell Tridge.
2015-08-06 17:13:30 +10:00
Grant Morphett 103119fe9a Rover: fixed bug when reverse throttle would increase speed in AUTO
Fixed this bug
https://github.com/diydrones/ardupilot/issues/840
If a Rover was in AUTO and the user moved the throttle stick into
reverse past 50% the rover would increase.  Basically the throttle
nudge behaviour was the same regardless of whether you moved the
throttle forward or backward.
2015-08-06 17:11:53 +10:00
Grant Morphett 5044189ac9 Rover: scheduler remaining time loop calc made common
Just making the improved scheduler loop remaining time calculation in line with
Plane and Copter.
2015-08-05 15:31:44 +09:00
squilter aa4a7a0b28 Rover: init vehicle capabilities 2015-08-01 09:35:46 +09:00
Grant Morphett 224d45000b Rover: fixed a bug going into guided and rover still moving
When the rover goes into guided mode it sets the current location as
the guided point to goto.  If the rover is stationary when this
happens no problem.  If however the rover is still rolling (say going
from AUTO to GUIDED) then the rover would go past its guided position
and get confused and begin to circle it.  This change resolves that issue.
2015-07-30 12:41:02 +10:00
Grant Morphett a2e9d0488c Rover: Implemented loitering at a waypoint if Param1 is non-zero
Rover now honours the Param1 setting of a time in seconds for a
NAV_WAYPOINT and the Rover will loiter at that waypoint for that
period of time.
Note that as soon as the Rover reaches that waypoint the loiter timer
will start. If you enter a different mode during this time (HOLD for
instance) the timer resets. If you then switch back to AUTO
mode and the Rover returns to that waypoint it will wait for the
loiter time configured in param1.
2015-07-29 10:08:04 +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
Grant Morphett 1fb81777f1 Rover: deleted the old command_description.txt file which isn't used. 2015-07-21 16:31:26 +09:00
Randy Mackay 14561f04b0 Rover: log IMUDT 2015-07-14 13:31:58 +09:00
Lucas De Marchi 8f74d7d982 APMrover2: use ARRAY_SIZE macro 2015-07-07 07:56:29 +10:00