Commit Graph

1259 Commits

Author SHA1 Message Date
Andrew Tridgell e346cd3c80 GCS_MAVLink: fixed use of incorrect millis16() values 2020-10-12 13:48:15 +11:00
Peter Barker 45f7322af6 GCS_MAVLink: avoid catching up on sending messages when sending disrupted
The code here was never meant to maintain an "average" streamrate.  It
was designed so that we would maintain a consistent clock in the face of
minor scheduling anomalies (like an EKF fusion step).

The way this is written, however, makes us spit out a message for each
of the intervals we missed - clearly not intended behaviour.

This was tested by inserting the following code:

 void GCS_MAVLINK::update_send()
 {
+    const uint32_t xnow = AP_HAL::millis();
+    if (xnow > 10000 &&
+        xnow < 20000) {
+        return;
+    }
+
2020-10-12 13:48:15 +11:00
Patrick José Pereira 8701e3626d GCS_MAVLink: Update GCS_Dummy to use new AP_FWVersionDefine header
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2020-10-07 19:32:12 +11:00
Peter Barker 7cb8cde417 GCS_MAVLink: move orderly rebooting code from GCS into AP_Vehicle
Several places we reboot the vehicle we should probably do several of
the things done in this code - flushing parameters, forcing safety on
etc.
2020-09-29 18:07:59 +10:00
yaapu e7a49dd624 GCS_Mavlink: refactor zero_rc_outputs() out of GCS_Mavlink 2020-09-29 18:07:59 +10:00
Peter Barker 0c88af99da GCS_MAVLink: revert removal of private channel check when forwarding
This reverts 6dc77c97ce

The commit caused a regression on Solo as the gimbal is "nodding",
indicating traffic from the autopilot is getting through to the gimbal.
2020-09-25 09:42:27 +10:00
Andy Piper 5d487be242 GCS_MAVLink: squash enum type error 2020-09-22 09:37:02 +10:00
Andy Piper 8b766efb0a GCS_MAVLink: add support for updating OSD parameters over mavlink 2020-09-09 20:36:42 +10:00
Andrew Tridgell 74686f8dc4 GCS_MAVLink: fixed locking of mavlink in serial control
this fixes takeover of mavlink ports for high serial numbers
2020-09-08 09:01:16 +10:00
Sharvashish Das 80e2dbc9f2 GCS_Common: send_local_position uses offset from origin 2020-09-01 10:27:18 +10:00
Andrew Tridgell 30f9fd9d2a GCS_MAVLink: fixed overrun of text passed to other libraries
this caused corruption in log files, and was passing a
non-nul-terminated string to notify and other libraries
2020-08-28 17:35:17 +10:00
Siddharth Purohit 42f5f986d8 GCS_MAVLink: use AP_CANManager library
also add support for handling enumeration cmd by KDETest
2020-08-19 17:31:09 +10:00
Peter Barker 0e284b95b0 GCS_MAVLink: move battery type enumeration out of parameters object 2020-08-11 13:21:52 +10:00
Michael du Breuil 6dc77c97ce GCS_MAVLink: Remove redundant check for private channels
We can't learn the route for sending to a private channel, so we
shouldn't need to actually check it when iterating the routes.
2020-08-11 09:49:42 +10:00
Randy Mackay 1a3ef62b84 GCS_MAVLink: add virtual send_winch_status 2020-08-07 21:55:07 +09:00
Siddharth Purohit 1a08252504 GCS_MAVLink: add support for bank selection on SPI DEVICE_OPs 2020-08-06 12:41:35 +10:00
elhayra 9b3a574775 GCS_MAVLink: sending UAVCAN MAVlink ESC messages 2020-08-06 09:28:35 +10:00
Andy Piper e91ae19544 GCS_MAVLink: make mount/gimbal configurable on a per-board basis 2020-08-04 09:18:14 +10:00
Dr.-Ing. Amilcar do Carmo Lucas 7067cbdafd GCS_Mavlink: Adapt to upstream mavlink changes to the SCALED_PRESSURE message 2020-07-29 14:34:22 +10:00
Michael du Breuil 6773821b3b GCS_MAVLink: Don't forward MAVLink data on channels marked private, make private channels more private 2020-07-22 07:17:49 +10:00
Andy Piper 05416daef3 GCS_Mavlink: output fast sampling startup messages 2020-07-10 16:45:29 +10:00
Andrew Tridgell 5a18b16f69 GCS_MAVLink: use strncpy_noterm 2020-07-10 13:32:24 +10:00
Andrew Tridgell 9466e7e71e GCS_MAVLink: make correct_offboard_timestamp_usec_to_ms protected
for use by vehicle code
2020-07-10 13:28:38 +10:00
Andrew Tridgell 91aaa7876d GCS_MAVLink: reserve another mavlink channel
for SimShip
2020-07-10 13:28:38 +10:00
Peter Barker 741520d598 GCS_MAVLink: find next bucket to send when sending-ids emptied on msg removal
We need to find the next bucket of messages to send when we've removed
the last message id from the current set of IDs we're sending out - not
just when we've empted the bucket the messages came from in the first
place.

An internal check caught this bug - the
'next_deferred_bucket_message_to_send called on empty bucket' error
2020-07-07 10:49:31 +10:00
Andrew Tridgell 90232fa6c0 GCS_MAVLink: fixed alignment errors in FTP server 2020-07-07 10:23:00 +10:00
Peter Barker e2056f56e3 GCS_MAVLink: support for sending generator message 2020-07-03 08:21:42 +09:00
Randy Mackay 03ea646e50 GCS_MAVLink: send_battery_status uses memcpy for cell voltages
Co-authored-by: WickedShell <Wicked.Shell.Scripts@gmail.com>
2020-06-24 10:19:15 +09:00
Randy Mackay 65aea0e9c1 GCS_MAVLink: send_battery_status sends min of cell 10 11 and 12 2020-06-24 10:19:15 +09:00
Michael du Breuil 7fae084793 GCS_MAVLink: Only send a single battery status per call 2020-06-23 09:18:56 +10:00
Peter Barker e4621e6921 GCS_MAVLink: do not process commands after we have decided to reboot 2020-06-17 11:54:03 +10:00
chobits 991387dbfb GCS_MAVLink: support covariance field in vis pose msg 2020-06-09 13:31:21 +09:00
Peter Barker f158533fe9 GCS_MAVLink: allow private channels to also be active
This will allow for logging of private channels.
2020-06-09 10:37:32 +10:00
Peter Barker 06012cbc56 GCS_MAVLink: cope with RingBuffer rename if empty() to is_empty() 2020-06-09 10:21:48 +10:00
Peter Barker b428f12913 GCS_MAVLink: add and use accessor for last-RADIO_STATUS.remrssi-ms 2020-06-09 10:20:29 +10:00
Peter Barker 07e3f1d48f GCS_MAVLink: add RADIO_STATUS.rssi as an AP_RSSI telemetry source 2020-06-09 10:20:29 +10:00
Peter Barker c1de346150 GCS_MAVLink: avoid copying data twice in ftp transfers 2020-06-07 08:51:09 +10:00
chobits ff6e4c4f9a GCS_MAVLink: support VISION_SPEED_ESTIMATE 2020-06-01 17:51:24 +09:00
Andrew Tridgell fc28cd4fa2 GCS_MAVLink: fixed a ftp duplicate reply
this fixes a bug in burst replies where the duplicate reply may have
the wrong offset. This causes the "paramftp bad type" error
2020-05-14 09:53:42 +10:00
Peter Barker 5100c9fb8c GCS_Common: whitelist AUTOPILOT_VERSION for in_delay_callback sending
GCSs may request this very early on in the boot process, particularly
for SITL.

If we try to send it during a delay callback then we end up dropping it
at the moment - but we'd already sent the ack in response to the
request.
2020-05-11 15:22:38 +10:00
Andrew Tridgell 87c2858bde GCS_MAVLink: give banner on param download with ftp
thanks to Peter for noticing
2020-05-10 15:10:21 +10:00
Andy Piper da166b256d GCS_MAVLink: add messages to Spektrum telemetry if it is enabled 2020-05-05 09:23:15 +10:00
Peter Barker 81454c7a40 GCS_MAVLink: create and use INTERNAL_ERROR macro so we get line numbers 2020-04-30 13:21:36 +10:00
Andrew Tridgell 7571e616de GCS_MAVLink: handle session timeout due to lost packets
and fixed handling of losing last pkt in a burst
2020-04-29 07:36:55 +10:00
Andrew Tridgell 65e790a48c GCS_MAVLink: invalidate param count on set of ENABLE param 2020-04-29 07:36:55 +10:00
Andrew Tridgell 7cd901fa5b GCS_MAVLink: enable ftp without filesystem
allows for @PARAM and @SYS
2020-04-29 07:36:55 +10:00
Andrew Tridgell 6811d79b6f GCS_MAVLink: define GCS_SEND_TEXT() globally
used to avoid linking GCS in AP_Periph
2020-04-29 07:36:55 +10:00
Peter Barker 26b88823f4 GCS_MAVLink: correct out-of-space-to-send call in HAVE_PAYLOAD_SPACE 2020-04-27 15:30:30 +10:00
Peter Barker 8b0b644c11 GCS_MAVLink: correct check for payload space for COMMAND_ACK 2020-04-27 15:30:30 +10:00
Peter Barker 668e0d0e65 GCS_MAVLink: check for empty replies queue first thing in send_ftp_replies
Will save us a little time on average
2020-04-27 15:30:30 +10:00
Randy Mackay 6f8176c71e GCS_MAVLink: remove ahrs3 2020-04-22 14:11:17 +09:00
Peter Barker 8b9281eaa1 GCS_MAVLink: log number of times message not sent due to no space 2020-04-17 22:21:14 +10:00
Peter Barker 41ada7f8f4 GCS_MAVLink: document the payload-space macros 2020-04-17 10:20:49 +10:00
Randy Mackay c39fef6c56 GCS_MAVLink: pass vision-position-estimate reset_counter to AP_VisualOdom handler 2020-04-14 10:28:03 +10:00
Randy Mackay 9769f08fd9 GCS_MAVLink: visual odometry build fixes 2020-04-09 19:41:08 +09:00
Randy Mackay a9c1eb5af4 GCS_MAVLink: fill in sys_status vision position bits 2020-04-09 19:41:08 +09:00
Randy Mackay a1ddd55ea5 GCS_MAVlink: AP_integrate of rename to handle_vision_position_delta_msg 2020-04-09 19:41:08 +09:00
Randy Mackay 728e8b45a9 GCS_MAVLink: use AP_VisualOdom to handle vision-position-estimate messages 2020-04-09 19:41:08 +09:00
Siddharth Purohit b0cbbb4bea GCS_Common: fix unannotated fall-through between switch labels 2020-04-01 17:10:36 +11:00
Andrew Tridgell 21e93dae34 GCS_MAVLink: send only old value for readonly param set
this prevents a condition where the GCS can display the wrong value if
the 2nd PARAM_VALUE is lost

Note that groundstations can tell the set failed due to readonly in
the following ways:

 1) look for the statustext: Param write denied (PARAMNAME)

 2) see that the value came back with the old value, with index of
   65535

 3) can repeat the send, looking for (1) and (2)

Michael has proposed we add a PARAM_VALUE mavlink2 flags
extension. That would be nice, but we should still make this change to
fix the issue with mavlink 1.0
2020-03-31 11:19:58 +11:00
Peter Barker 55d37e5d0e GCS_MAVLink: correct slowing down of waypoint re-requests
These re-requests shouldn't be slowed down by a factor of 20.

This was a left-over from when we did these in terms of 20ms intervals
(50Hz loop rate)
2020-03-31 11:15:04 +11:00
Peter Barker ca7fcc093c GCS_MAVLink: correct return type on get_stream_slowdown_ms
Only used in one place.  On slow links may have caused us to re-request
a waypoint too often.  "Too often" is still >1s intervals.
2020-03-31 11:15:04 +11:00
Peter Barker 0b756547be GCS_MAVLink: add stream_slowdown to MAV message 2020-03-31 11:13:11 +11:00
Peter Barker 7028f1adba GCS_MAVLink: GCS_FTP: remove redundant more_pending variable
This is taken care of by the "break" statements
2020-03-31 10:38:13 +11:00
Peter Barker a09ac895e9 GCS_MAVLink: remove dead assignment
This value is never used
2020-03-31 10:38:13 +11:00
Michael du Breuil 18baf18041 GCS_MAVLink: Remove redundant assignment to the command
This is done internally by the conversion to mission_item_int_t
2020-03-31 10:35:49 +11:00
Randy Mackay ecf5abc1f2 GCS_MAVLink: minor format fix 2020-03-30 20:20:08 +09:00
Andrew Tridgell e7fdf8fad1 GCS_MAVLink: reduced delay between ftp packets 2020-03-28 15:28:03 +11:00
Andrew Tridgell 5c9ae33151 GCS_MAVLink: support variable sized packets in burst read
this allows packet size to be tailored to the transport
2020-03-28 15:28:03 +11:00
Andrew Tridgell 8a84dbc19e GCS_MAVLink: slow down telemetry during ftp 2020-03-28 15:28:03 +11:00
Andrew Tridgell c1d4a5bd35 GCS_MAVLINK: prevent closedir() with nullptr 2020-03-28 15:28:03 +11:00
Andrew Tridgell 28082774b6 GCS_MAVLink: use new DirHandle for directory listings 2020-03-28 15:28:03 +11:00
Peter Barker 97b07d9c84 GCS_MAVLink: add option to get the autopilot to hard-fault itself 2020-03-19 16:03:58 +11:00
Andrew Tridgell 39fc324854 GCS_MAVLink: convert to new get_rpm() API 2020-03-12 08:36:40 +11:00
Andrew Tridgell aaf828c9d4 GCS_MAVLink: consider NO_CHANGE as success for bootloader flash
this prevents GCS users from seeing "update failed"
2020-03-11 16:30:06 +11:00
Peter Barker ebfa910774 GCS_MAVLink: GCS_Dummy: add missing CR to console output of statustexts
send_text and friends don't expect the caller to add the CR; the GCS
will add one.  Since we're jsut emitting to console, add one ourselves.
2020-03-10 19:07:08 +11:00
Rishabh f3e66055e5 GCS_MAVLink: Alert GCS if user tries calibration while vehicle is armed 2020-03-03 11:37:19 +11:00
Peter Barker fbe2e75b9f GCS_MAVLink: divide time allowed to send messages fairly 2020-02-27 08:49:59 +11:00
Peter Barker 727c12c388 GCS_MAVLink: move initialisation of serial and gcs to AP_Vehicle 2020-02-25 11:50:55 +11:00
Peter Barker e2c9f6a8a1 GCS_MAVLink: add flags to MAV dataflash log
holds various pieces of simple information about a link
2020-02-25 10:59:22 +11:00
Peter Barker f8f4ed7ee0 GCS_MAVLink: log disarm method 2020-02-22 12:16:29 +11:00
Andrew Tridgell 20ea1a3dc7 GCS_MAVLink: don't send statustext from other than main thread
This fixes high stack usage in the RCIN thread when it notifies the
GCS of a new RCIN protocol. The problem is severe when signing is
enabled, as signing adds over 500 bytes to stack cost of sending a
mavlink msg

fixes issue #13615
2020-02-20 10:39:29 +11:00
Michael du Breuil 1f8c030eba GCS_MAVLink: Allow scripting to start/stop the REPL 2020-02-18 17:23:22 -07:00
Michael du Breuil 296c014d14 GCS_MAVLink: Fix excess trimming of autopilot version 2020-02-19 09:10:02 +11:00
Andrew Tridgell 32ecd904bd GCS_MAVLink: use MAV_SYS_STATUS_PREARM_CHECK
this allows GCS to continually display prearm check status
2020-02-18 15:16:02 +11:00
Matt Lawrence c84dcd9bf8 GCS_Mavlink: Add routing for GoPro heartbeat 2020-02-18 11:13:27 +11:00
Peter Barker 87a31c6409 GCS_MAVLink: don't recalculate max parameter count if not streaming params 2020-02-18 10:33:41 +11:00
Peter Hall b1742b4e19 GCS_Mavlink: constrain battery current to avoid wrap 2020-02-12 08:04:39 +11:00
Andrew Tridgell f7eba43cb8 GCS_MAVLink: raise ftp stack size to 3072 from 1024
this prevents memory corruption on directory listing
2020-02-11 13:32:17 +11:00
Peter Hall ba811052f8 GCS_Mavlink: report on fence limiting 2020-02-04 10:24:33 +09:00
Randy Mackay 7a5f57f940 GCS_MAVLink: send rc output mode banner to GCS 2020-02-04 12:23:33 +11:00
Peter Barker 1650979a2b GCS_MAVLink: add support for MAV_CMD_DEBUG_TRAP 2020-01-29 10:27:01 +11:00
Andrew Tridgell 0e7ddebd15 GCS_MAVLink: fix for updated mavlink extensions 2020-01-29 08:16:59 +11:00
Peter Barker e248bdfb16 GCS_MAVLink: split statustexts into 50-byte chunks using mav2 extensions 2020-01-28 19:56:38 +11:00
Peter Barker 8fc64ccbe9 GCS_MAVLink: allow NavEKFs to be compiled out 2020-01-21 11:53:18 +11:00
Peter Barker a9f62f196e GCS_MAVLink: consolidate places we snprintf statustexts 2020-01-14 10:38:43 +11:00
Andrew Tridgell 8ae5dffd31 GCS_MAVLink: fixed valgrind error in mission upload
affects DO_JUMP
2020-01-11 08:29:34 +11:00
Randy Mackay 188fdfb1b8 GCS_MAVLink: send optflow message even if no height estimate 2020-01-06 11:36:43 +09:00
Andrew Tridgell 1b528137f7 GCS_MAVLINK: cope with AP_Frsky_Telem being created after init
may be created by the FPort backend
2020-01-02 09:52:57 +11:00
murata 91e09338ea GCS_MAVLInk: Judgment of non-existence value by PARAM_SET 2019-12-31 10:12:01 +11:00