Commit Graph

263 Commits

Author SHA1 Message Date
Andrew Tridgell 6e9abb616a APM: show real raw RC input, not mixed input
this makes it easier to diagnose elevon mixing issues
2012-09-13 12:00:49 +10:00
Andrew Tridgell 0812fc4890 APM: reboot only works on the APM2 2012-09-10 11:50:48 +10:00
Andrew Tridgell cb88681914 APM: added support for MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN
this allows for remote reboot of APM
2012-09-10 11:42:30 +10:00
Andrew Tridgell e2779523ea APM: fixed fetch of relative altitude waypoints
when we fetch relative altitude waypoints from APM to a file, we need
to preserve the altitude
2012-09-10 09:40:29 +10:00
Andrew Tridgell d07d42403e APM: tidy up an if() statement 2012-09-08 10:14:20 +10:00
Andrew Tridgell 130b26e1f9 APM: support DO_SET_SERVO command 2012-09-08 10:06:53 +10:00
Andrew Tridgell 9b2ad55773 APM: added forwarding of unknown MAVLink types 2012-09-08 10:06:15 +10:00
Michael Oborne cd08420c3e AP fix takeoff alt issue
issue 733
2012-09-06 20:19:12 +08:00
Andrew Tridgell f6c3197cd2 APM: added new TELEM_DELAY parameter
number of seconds to delay telemetry
2012-08-30 08:59:39 +10:00
Andrew Tridgell ecc6a52904 APM: report estimated airspeed if airspeed not available 2012-08-25 17:49:26 +10:00
Andrew Tridgell abe5bbfa4d APM: support forcing MANUAL of FBWA mode over MAVLink 2012-08-24 15:18:22 +10:00
Andrew Tridgell 6ab2a861f7 APM: added RSSI to RC_CHANNELS_RAW as well
and prevent double read
2012-08-22 13:58:25 +10:00
Andrew Tridgell 2d5bb7c51b APM: added RSSI in raw message too 2012-08-22 13:48:09 +10:00
Andrew Tridgell c0c0b8c976 APM: added RECEIVER_RSSI_PIN option
this allows for the receiver RSSI to be sent over MAVLink

Thanks to Burt Green for the suggestion
2012-08-22 13:33:12 +10:00
uncrustify f7b8fecad9 uncrustify ArduPlane/GCS_Mavlink.pde 2012-08-21 19:19:51 -07:00
rmackay9 11e946eb54 ArduCopter, ArduPilot: revert mavlink delay callback to be "unsigned long" 2012-08-18 20:34:41 +09:00
rmackay9 6d489947cf ArduPlane: replaced many "int" with "int16_t", "long" with "int32_t" 2012-08-18 18:26:13 +09:00
rmackay9 9773c8ce93 ArduPlane: commented out two unused variables to remove compiler warning 2012-08-18 13:20:34 +09:00
Andrew Tridgell d27e51f20a APM: allow telemetry send during parameter and waypoint fetch
this slows down telemetry by a factor of 4 during parameter or
waypoint transmit. That ensures that mode changes and gps position are
still updated during a long parameter fetch
2012-08-16 10:50:12 +10:00
Andrew Tridgell ed064b2506 MAVLink: enable fetching of single parameters
this makes it possible for the GCS to fetch a single parameter by
name, which is useful for parameters that change in flight
2012-08-16 10:14:46 +10:00
Andrew Tridgell c960db7af5 APM: allow for separate calibration of airspeed/barometer
this is useful just before takeoff, to account for temperature changes
2012-08-15 19:49:09 +10:00
Andrew Tridgell 8cb55eb75a APM: keep the time of the last heartbeat message
this will be used for failsafe processing
2012-08-15 12:39:34 +10:00
Andrew Tridgell 0584017aff APM: expose change_command() and geofence_breached() to libraries
this makes a failsafe library easier
2012-08-15 12:39:34 +10:00
Andrew Tridgell 93f1d5645b APM: fixed LOITER_TIME and LOITER_TURNS
These now follow the mavlink spec. Loiter time is in seconds, and
loiter turns is now 32 bit angle, so can handle larger numbers of
turns.
2012-08-15 12:39:34 +10:00
Andrew Tridgell c31eef59ae Mavlink: log wind estimation result 2012-08-11 22:06:03 +10:00
Andrew Tridgell d9b09d2c93 APM: allow for navigation by dead-reckoning
we now ask AHRS if we have a position estimate, and use that if
available
2012-08-11 12:01:08 +10:00
Andrew Tridgell 0ffc89d512 APM: support the MISSION_WRITE_PARTIAL_LIST command
this allows missions to be partially updated in flight
2012-08-09 17:13:36 +10:00
Andrew Tridgell dc47074dbd MAVLink: removed the need for Mavlink_compat.h
we have now fully transitioned to MAVLink 1.0, so we no longer need
the compatibility layer and the old names in the code
2012-08-09 12:22:46 +10:00
Andrew Tridgell 2a7b298bbc MAVLink: moved mavlink variables back to library
these were moved to the main sketches to allow for compile time
selection of MAVLink 0.9 vs 1.0. We no longer support 0.9, so we can
move it back, which simplifies some test sketches
2012-08-09 12:06:21 +10:00
Andrew Tridgell e133900c68 APM: Added STICK_MIXING option
this replaces the compile time option. Disabling during long distance
flights when the transmitter may be out of range is useful.
2012-08-09 08:53:29 +10:00
Andrew Tridgell 5bfd1200d6 APM: change variables to use _cm, _cd and _ms suffix for units
this makes it less likely that we mix up units
2012-08-08 12:12:30 +10:00
Andrew Tridgell 12cd6b68ff AP_Param: update ArduPlane core for new AP_Param interface 2012-08-08 12:11:57 +10:00
Michael Oborne cb0eacca37 AP Fix Hil Airspeed calc in m/s 2012-07-26 20:21:17 +08:00
Andrew Tridgell 3c2fc72654 APM: fixed HIL build 2012-07-26 10:09:07 +10:00
Andrew Tridgell 85465c9126 MAVLink: fixed another two places where micros() was used for a millisecond time 2012-07-20 11:57:15 +10:00
Jonathan Challinger fc4f111d15 Changed mavlink GLOBAL_POSITION_INT.relative_alt message to correctly return altitude above ground. 2012-07-17 16:15:11 +10:00
Andrew Tridgell de3c9ce56d Airspeed: change APM to use new AP_Airspeed library
the next step is AHRS dead reckoning
2012-07-16 11:21:50 +10:00
Andrew Tridgell 58fd91165f APM: fixed some build warnings and type errors 2012-07-06 19:59:18 +10:00
Andrew Tridgell 0385932afb MAVLink: added climb rate reporting 2012-07-05 13:00:46 +10:00
Andrew Tridgell 60caaa4b04 MAVLink: remove MAVLink 0.9 protocol support
this simplifies the code a lot. We're not going back to 1.0
2012-07-05 13:00:46 +10:00
Andrew Tridgell 55092c25a6 SITL: enable the SIM_* parameters in ArduCopter and ArduPlane 2012-06-29 15:10:52 +10:00
Andrew Tridgell 5bccfbd94c Barometer: fixed airstart for APM
we need to re-load the ground pressure and temperature from eeprom on
and airstart
2012-06-27 16:01:50 +10:00
rmackay9 621e020dac ArduPlane HIL: fixed bug so g_gps->setHil calls send time as a uint32_t (was sending a float but was cast back to an uint32_t resulting in a meaningless time that never changed). 2012-06-26 22:59:24 +09:00
Amilcar Lucas 1906e06b69 Added camera trigger functionality 2012-06-13 21:00:20 +02:00
Michael Oborne b4a1b03fd3 AP: add fake satellite count for hil. 2012-06-02 16:38:20 +08:00
Andrew Tridgell d9457ecc38 MAVLink: send time of GPS fix accurately
when we send a GPS_RAW message, set the usec field to the time we got
the fix from the GPS, not the current time. This makes it possible for
aerial photo processing to be more accurate, as the usec field with
more accurately reflect the planes position/time pair
2012-05-23 17:33:33 +10:00
Andrew Tridgell 8e01bc3593 MAVlink: update ArduPlane for param fetch during DataFlash erase
same changes as for ArduCopter
2012-05-22 16:13:35 +10:00
Michael Oborne 218e70cd8b AP - fix attitude level hil mavlink 1.0 issue 2012-05-06 11:05:35 +08:00
Andrew Tridgell b6a475f6a5 MAVLink: make APM build with MAVLink 1.0 possible with arduino GUI 2012-04-24 22:24:58 +10:00
Andrew Tridgell 95be2c5922 APM: updates for MAVLink 1.0 2012-04-24 19:54:20 +10:00
Andrew Tridgell 8e6fdb8981 APM: use OutputCh_current() in MAVLink servo logging
this gives a more accurate picture of what is actually happening with
the servos
2012-04-24 10:57:43 +10:00
Michael Oborne 8d797fec3c fix potential null pointer 2012-04-20 17:57:06 +08:00
Andrew Tridgell e1270401bf MAVLink: make parameter send use adaptive stream rate
this makes it possible to fetch parameters with very low air data
rates
2012-04-02 11:18:53 +10:00
Andrew Tridgell 7b50724f60 MAVLink: allow for find grained stream rate control
streams can now be requested at any multiple of 20ms. So if you ask
for a stream at 7Hz then you will get it at close to 7Hz.
2012-04-02 11:18:53 +10:00
Andrew Tridgell e0bb7e2777 MAVLink: don't waste 100 bytes of bandwidth sending 1 byte of information
the GPS_STATUS message is a massive waste of bandwidth, but it is the
only message that tells us the number of visible satellites. So only
send it if that information changes.

This makes MAVLink work better at low baud rates
2012-03-30 17:46:20 +11:00
Andrew Tridgell 4c4c38f69a APM: Added MANUAL_LEVEL option
when MANUAL_LEVEL is set to 1, we don't do accelerometer levelling at
startup, and instead used the values saved in the EEPROM. This makes
it easier to do levelling on the bench, or once for a series of
flights for the day
2012-03-29 12:39:53 +11:00
Andrew Tridgell 34506b170f Mavlink: fixed warnings about limits on int32 values 2012-03-27 15:37:25 +11:00
Andrew Tridgell 458d55e5bc MAVLink: constrain variable changes to the datatype range
if someone tries to set a AP_Int16 to a value of 300000, they now get
32767 instead of -27678
2012-03-19 17:29:02 +11:00
Andrew Tridgell 8afd196907 APM: adapt ArduPlane for AHRS framework 2012-03-19 17:29:02 +11:00
Andrew Tridgell d75e883fe8 GCS: get_integrator() is now get_gyro_drift() in DCM 2012-03-10 10:34:33 +11:00
Andrew Tridgell 13d5839778 APM: removed quaternion special cases 2012-03-10 10:34:32 +11:00
Andrew Tridgell e39c3cb9d2 APM: make it possible to build ArduPlane with quaternion support 2012-03-10 10:34:29 +11:00
Andrew Tridgell b455443e2c APM: added logging of DCM, HWSTATUS and SIMSTATE 2012-03-10 10:34:27 +11:00
Andrew Tridgell 690dc9052a GCS: force scalar type in copy_name()
this enables access to compass offsets over MAVLink
2012-02-25 11:37:20 +11:00
Andrew Tridgell df8a557630 AP_Param: update users of AP_Param for ParamToken 2012-02-19 17:05:28 +11:00
Andrew Tridgell 78babd37fa APM: use set_and_save_ifchanged() for GCS stream rates
this avoids a lot of EEPROM scan operations when the groundstation
updates the stream rates
2012-02-18 10:51:57 +11:00
Andrew Tridgell c662140a2b APM: report the nav_bearing as hold_course when enabled
this gives a more accurate view of the navigation code, as when
hold_course is not -1 it overrides nav_bearing
2012-02-15 08:50:45 +11:00
Andrew Tridgell c042ef1298 APM: fixed some build warnings 2012-02-14 08:58:56 +11:00
Andrew Tridgell 8d1729b3ba Mavlink: report the corrected pitch via MAVLink
this subtracts the TRIM_PITCH_CD from the pitch reported via
MAVLink. That gives a better indication of the true pitch in the tlog
2012-02-14 08:58:56 +11:00
Andrew Tridgell ecdbfd257a token is 16 bits now 2012-02-13 16:22:53 +11:00
Andrew Tridgell 0b3e3ec5c8 added group indexes to GCS_MAVLINK class 2012-02-13 16:22:52 +11:00
Andrew Tridgell bc0ed62aa9 adapt mainline APM code to AP_Param 2012-02-13 16:22:51 +11:00
Sandro Benigno 3200781f56 Battery monitor type 3 cannot calculate battery remaining properly, due it uses only voltage reading. This path set battery_remaining to a value out-of-band for that type of monitoring. It informs to external devices to not show that info. 2012-02-11 21:01:13 -02:00
Michael Oborne 6b949511ca change rc norm_output to scale evenly across the entire range 2012-01-20 16:24:55 +08:00
Doug Weibel 69c7598db2 Update battery monitoring code for ArduPlane
Fixes compatibility for APM2.  Also a significant update to the battery monitoring code:  We previously had monitoring modes for individual cell voltages for 3 and 4 cell lipos.  These have been removed as they were never really supported (the cell voltages were computed but were not reported or recorded anywhere).  Also, some clean-up/prep work was done for supporting monitoring 2 separate battery packs.  The CLI battery and current monitoring tests were consolidated into 1 test.
2012-01-15 16:10:28 -07:00
Michael Oborne cd145fd7a9 add circle to output modes 2011-12-29 18:21:32 +08:00
Andrew Tridgell 42522baf9f geofence: store fence points as int32_t
this keeps maximum precision in fence boundaries
2011-12-16 20:11:51 +11:00
Andrew Tridgell fc495ce6a7 geofence: added fence status reporting and faster altitude check 2011-12-16 20:11:51 +11:00
Andrew Tridgell 3b148c87d5 geofence: main geo-fence code
this implements the primary logic of geo-fencing
2011-12-16 20:11:51 +11:00
Andrew Tridgell 84a694efb9 only check for "enter 3 times" in first 20s after boot
we don't want stray bytes on serial3 to make us enter the CLI during
flight!
2011-12-16 20:09:32 +11:00
Andrew Tridgell 8cd13749bd MAVLink: fixed link flood on waypoint upload 2011-12-13 20:39:04 +11:00
Andrew Tridgell d5c23c83cf apm2: fixed for new barometer code 2011-12-11 15:21:10 -08:00
Andrew Tridgell 39a36fe946 fixed the "reboot on GPS lock" bug
the problem was that with APM2 we may not have a 2nd GCS instance. The
"gps alt: xxx" message was being unconditionally sent to both GCS
instances, which caused a crash
2011-12-04 09:06:58 +11:00
Andrew Tridgell 838c57cd1a mavlink: paranoia setting of failsafe when forcing AUTO mode
this shouldn't be needed, but will do no harm, and I thought I saw
this fail in a test
2011-11-28 16:22:33 +11:00
Andrew Tridgell 7def0e98e8 USB-MUX: auto-switch telemetry port based on UXB mux for ArduPlane
when USB is unplugged, switch baud rate to the SERIAL3_BAUD rate from
EEPROM
2011-11-25 20:00:19 -08:00
Andrew Tridgell 8ef364657b MAVLink: fixed throttle display in VFR_HUD 2011-11-21 20:29:19 +11:00
Amilcar Lucas ab730ff919 Added camera and/or antenna mount support.
It is fully configurable with the mission planner, there is no need to change
the source code to adapt to your setup.
It needs more testing, but the SIL is not working for me.
2011-10-31 22:55:58 +01:00
Andrew Tridgell 9eb27c2573 GCS: fixed timeout loading waypoints
while loading waypoints we could saturate the link
2011-10-31 21:25:35 +11:00
Michael Oborne 3f3c04f95b Add MAVLINK_MSG_ID_HIL_STATE message 2011-10-30 18:17:37 +08:00
Andrew Tridgell d9ae4e4e6e MAVLink: use new MAV_MODE_FLAG_CUSTOM_MODE_ENABLED flag
this enables us to tell if custom_mode is set
2011-10-30 13:00:54 +11:00
Andrew Tridgell 580647b1de use C++ tricks to minimise differences for MAVLink 1.0
this should make maintainence/testing a bit easier
2011-10-30 11:48:56 +11:00
Doug Weibel 645b9c1d48 Initial rewrite of command logic.
Changes mission structure so that conditional and immediate commands are located between associated waypoints instead of after the second waypoint.
2011-10-27 13:45:52 -06:00
Andrew Tridgell 5a44298d57 CLI: enable "hit enter 3 times" support for CLI
if you hit enter 3 times before you send any mavlink packets, we will
enter CLI mode
2011-10-27 21:54:07 +11:00
Andrew Tridgell 2b9daf65ff mavlink: fixed WP upload
The previous code accepted arbitrary command codes here, and ACKed
them. Later we should specifically list which ones are OK
2011-10-26 12:18:24 +11:00
Andrew Tridgell 5a089f98d2 MAVLink: MAVLink 1.0 support now builds
not testing at all - so be careful!
2011-10-24 12:21:26 +11:00
Andrew Tridgell f815a1b27b mavlink: started adding support for MAVLink 1.0
this is nowhere near complete, and does not compile yet
2011-10-24 10:20:36 +11:00
Michael Oborne d38b289766 hil sensor cleanup 2011-10-14 18:14:32 +08:00
Michael Oborne 7ef51f723d Sensor hil fix's 2011-10-13 22:22:03 +08:00
Amilcar Lucas e5c248e2bf Moved mavlink_check_target() to the libraries/.
This allows it to be reused by the other libraries and by other projects ArduPlane, ArduCopter, ArduRover ... etc.
It also reduces code duplication
2011-09-24 14:40:07 +02:00
Andrew Tridgell 6a9a85f184 remove unused climb_rate code 2011-09-19 11:04:02 +10:00
Andrew Tridgell 0f09bf6654 GCS: added new gcs_send_text_fmt() method
this allows low priorty formatted messages to be sent to the ground
station, without causing a CPU stall on the serial send buffer
2011-09-19 11:04:02 +10:00
Andrew Tridgell 9351ef17a9 GCS: don't send low priority messages unless they fit
check the serial transmit buffer, and don't send low priority messages
unless they can go straight out without blocking the CPU
2011-09-19 11:04:02 +10:00
Andrew Tridgell 55cd7bcf1d added gcs_severity enum
this makes it harder to mixup defines
2011-09-19 11:04:02 +10:00
Andrew Tridgell 66e4ae50bb remove some more old cruft 2011-09-19 11:04:02 +10:00
Andrew Tridgell 73223ee458 remove Mavlink_Common.h and used deferred logic for params/waypoints
this moves the mavlink send logic into GCS_Mavlink.pde, and also
ensures we only ever send parameters and waypoints when there is
sufficient space in the serial send buffer
2011-09-19 11:04:02 +10:00
Andrew Tridgell de12ea429e remove some more unused code in the GCS interface 2011-09-19 11:04:02 +10:00
Andrew Tridgell e61d742345 GCS: make the two GCS links gcs0 and gcs3
the artifical separation between 'gcs' and 'hil' just leads to
confusion. This also simplifies the code a bit more, and saves us a
bit more text
2011-09-19 11:04:02 +10:00
Andrew Tridgell 2ca8e58bc2 GCS: simplify the API for sending messages
this makes the code clearer, and saves us another 100 bytes of text
2011-09-19 11:04:02 +10:00
Andrew Tridgell 17ebb311a7 MAVLink: use enum ap_message and remove unused param argument
saves us another 200 bytes of text
2011-09-19 11:04:02 +10:00
Andrew Tridgell 9baab490f1 HIL: first step in simplifying the HIL/GCS code
this gets rid of the messy #ifdefs around HIL_PORT, and removes
non-MAVLink GCS and HIL support
2011-09-19 11:04:01 +10:00
Andrew Tridgell 49d96726d5 MAVLink: only send HEARTBEAT and SYS_STATUS during initialisation
I am concerned that some of the mavlink send routines may impact on
sensor calibration, so its safer to just send the minimum information
to keep the GCS happy
2011-09-17 14:58:02 +10:00
Michael Oborne e43b711e96 fix remote error value 2011-09-15 18:26:59 +08:00
Andrew Tridgell e0dc1271d6 imported ArduPlane from ArduPilotMega svn 2011-09-09 11:29:39 +10:00