Commit Graph

630 Commits

Author SHA1 Message Date
Julian Oes 307dc3e32d mavlink: fix boot complete without lockstep
Without lockstep the actual monotonic clock of the host computer is
used. Therefore, this time is likely much more than 20 seconds and the
check if the boot complete happened in time will fail immediately.

Therefore, it probably makes more sense to count the time from the first
mavlink creation.
2019-10-10 08:58:34 +02:00
Daniel Agar c8e59c4e39 parameter_update use uORB::Subscription consistently 2019-09-29 10:49:03 -04:00
garfieldG bbb96cbd0c Mavlink startup script per board
-moved rc.mavlink to the boards optional rc additions (now it's called rc.board_mavlink) to handle board specific mavlink needs (mavlink over usb, ethernet, additional streams, etc.)
-mavlink module will be responsible to usb defaults, therefore less args are needed to be passed to mavlink module if one wants to use mavlink over usb.
-the way to check if connection is usb is by it's designated variable and not by config mode.
2019-09-29 10:46:08 -04:00
Julian Oes b0035e5704 mavlink: prevent race if shut down immediately
If we do mavlink stop-all right after mavlink start, we do a perf_free
before actually having stopped the threads accessing the perf counters.
2019-09-28 16:40:13 -04:00
Daniel Agar 3031f94ded mavlink: optimize normal mode for typical GCS usage over serial radio 2019-09-25 14:08:04 -04:00
Julian Oes 0b368d043f mavlink: always check stream subscriptions (#13018)
This fixes the regression where we saw this in SITL:
ERROR [mavlink] system boot did not complete in 20 seconds

The reason was that the stream subscription requests were not checked
because the while loop was not running yet because mavlink was not
booted completely.
By moving the stream subscription requests into a function we can run
them even if we don't run the rest of the loop.
2019-09-25 14:37:08 +02:00
Daniel Agar fe4f6c186e Mavlink: ifdef networking code 2019-09-21 13:46:01 -04:00
Daniel Agar 494f35d5f4 Mavlink: wait for boot complete before sending or receiving anything 2019-09-18 09:07:55 -04:00
Martina 0414d59ee9 mavlink_main: stream OBSTACLE_DISTANCE to GCS 2019-08-14 13:32:15 -04:00
Mark Owen e25db01620 Mavlink: Fix forwarding of messages with target system/component id (#12559)
Mavlink does not correctly forward messages that have the target_system or target_component routing fields in the message.

Some investigation revealed that the Mavlink::forward_message function is incorrectly utilizing the mavlink_msg_entry_t.target_system_ofs and mavlink_msg_entry_t.target_component_ofs fields. These offsets are intended to be used relative to the start of the message payload. But, as implemented, these offsets are incorrectly being used relative to the start of the message. This pull-request corrects that problem.

I also correctly made use of the mavlink_msg_entry_t.flags field to determine if a message contains a target_system or target component field. The previous check incorrectly assumed that they would always be non-zero if present.

Signed-off-by: Mark Owen <maowen801@gmail.com>
2019-08-13 07:16:09 -07:00
garfieldG d3ba9c59e0 mavlink: added check if instance mode is serial when trying to find if instance exists (#12642) 2019-08-06 10:53:07 -04:00
mcsauder 2e3926b577 Fix a corner case that prevented mavlink config streams from being indexed appropriately when USB is not connected at boot.
Break out Mavlink class constructor logic into set_instance() and set_channel() methods. and add const specifiers and default arguments to Mavlink::mavlink_open_uart().
2019-08-05 05:02:20 -07:00
Daniel Agar e69398c09f introduce uORB::PublicationQueued and transition most orb_advertise_queue usage 2019-08-04 10:08:09 -04:00
Daniel Agar 9986a88697 mavlink: split BATTERY_STATUS from SYS_STATUS update and handle all bricks (#12034) 2019-07-18 13:32:41 +02:00
Daniele Pettenuzzo 55b5e7552c mavlink: add new extvisionmin mode (#12279)
Signed-off-by: DanielePettenuzzo <daniele@px4.io>
2019-06-28 10:44:22 -04:00
Lorenz Meier 7ba658d573 MAVLink module: Add additional IMUs as default outputs
This simplifies setup and verification of systems, as all three sensors can be looked at in a graph view.
2019-06-26 10:24:16 -04:00
Daniel Agar 4910bed45b mavlink send_statustext_critical() remove redundant print 2019-06-15 10:14:41 -04:00
Mark Sauder ae6fed4f29 Migrate remaining variable initializations from constructor list to declarations in mavlink_main.cpp/h. 2019-06-12 12:53:09 -04:00
Daniel Agar 579cbbb42c mavlink move to new lightweight uORB::Subscription 2019-06-03 17:06:21 -04:00
mcsauder e6b427022a Add missing underscore prefix to a member variable in mavlink_main.cpp.h and delete unnecessary struct specifiers in mavlink_main.h. 2019-04-26 11:33:17 +02:00
mcsauder 73fb30f251 Migrate an additional set of 16 variable initilializations from the Mavlink class constructor list to their respective declarations. 2019-04-26 11:33:17 +02:00
Beat Küng 744b50b478 send MAVLink GROUND_TRUTH at 25 Hz, only in SIH mode. And minor cleanup 2019-04-12 09:25:07 +02:00
romain 9adb4410bd newline added at the end of files 2019-04-12 09:25:07 +02:00
Beat Küng 914a9b78b6 new airframe for sih, HIL_STATE_QUATERION sent through MAVLink 2019-04-12 09:25:07 +02:00
bresch da2deaa0b2 Parameter update - Rename variables in modules/mavlink
using parameter_update.py script
2019-04-03 15:38:50 +02:00
Beat Küng fe0c2d1352 mavlink autopilot_version: add vendor version 2019-03-28 08:47:32 +01:00
Ilya Petrov 15c2473eda mavlink_main.cpp - add fix for Cygwin (Windows)
fix for issue https://github.com/PX4/Firmware/issues/11030 - "getting required buffer size failed" on jmavsim simulation on Windows 10
2019-03-21 22:48:11 +01:00
Claudio Micheli fb990d7de3 Removed subscribtion to multiple _telemetry_status instances.
Since commander handles all telemetry_status the same there is no need to subscribe to multiple instances.


Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-03-12 11:24:33 +01:00
Daniel Agar 6dec451bab HEARTBEAT and commander failsafe handling cleanup 2019-03-12 11:24:33 +01:00
mcsauder 1f65887982 Migrate a few more var initializations from the Mavlink class constructor list to the respective declarations. 2019-03-09 14:53:24 -05:00
mcsauder 7b3482adf0 Whitespace formatting in mavlink_main.cpp/h and begin work of some variable initialization at declaration in mavlink_main.h. 2019-03-09 13:32:26 -05:00
mcsauder cb49ed55fe Delete unnecessary #includes from mavlink_main.cpp and relocate a few #defines to mavlink_main.h for future variable initialization work. 2019-03-08 22:10:11 -05:00
Daniel Agar e2bf4b1894 List container improvements and testing
- support range based for loops
 - add remove() method to remove a node
 - add clear() to empty entire list and delete nodes
 - add empty() helper
2019-03-01 21:01:04 -05:00
Anna Dai 3db901b238 add mavlink mode external vision MAVLINK_MODE_EXTVISION
the mode can be used for VIO algorithms and obstacle avoidance to close the loop
2019-02-21 09:18:23 +01:00
Beat Küng d8b013355c PRINT_MODULE_USAGE_PARAM_{INT,FLOAT}: add support to ignore the default value 2019-02-08 09:29:46 +01:00
Julian Oes b17c0a11ab mavlink: improve comments about message forwarding (#11323)
This removes the confusing ugly magic number of 233 introduced as part
of https://github.com/PX4/Firmware/pull/7670.

Also, the convoluted if is cleaned up using 3 separate bools with some
comments to explain what's going on.

This should not change anything function-wise except that the flight
controller could now potentially also use system ID 233 and not break
forwarding.
2019-02-05 10:33:49 -05:00
Daniel Agar 63097bd8a1 mavlink sort message defaults and float literal consistency 2019-01-14 14:46:13 -05:00
Daniel Agar 8c88aa6416 mavlink move simple getters to header and mark const 2019-01-01 22:21:02 +00:00
Daniel Agar f60bfd0020 mavlink add tx loop interval perf counter 2019-01-01 22:21:02 +00:00
Julian Oes 5b9dea5604 Replacing usleep with px4_usleep
This is a step towards isolating time from the system.
2018-12-22 10:32:18 +01:00
Nuno Marques cfd1be584e Feature: VIO: add ODOMETRY stream (#11084)
* mavlink_messages: remove LOCAL_POSITION_NED_COV stream

* mavlink_messages.cpp: add ODOMETRY stream

* add MAV_ODOM_LP parameter to activate odometry loopback

* EKF2: add vehicle_odometry publisher

* Replace VISION_POSITION_ESTIMATE loopback with ODOMETRY

* LPE: add vehicle_odometry publisher

* set vehicle_odometry local_frame field

* mavlink_messages.cpp: ODOMETRY frame_id depends on MAV_ODOM_LP
2018-12-21 12:54:04 -05:00
Matthias Grob e708e82425 mavlink: lower orbit status frequency 5Hz 2018-12-18 14:40:07 +01:00
Matthias Grob 14b83f7bfc mavlink: add orbit to the normal messages
It is only actually sent out when the orbit is running.
2018-12-18 14:40:07 +01:00
Daniel Agar 3e0a3559a9 cmake use standard mechanisms for settings flags 2018-11-26 14:40:14 -08:00
Michael Schaeuble 33a9eb946a Mavlink: Reduce rate of UTM_GLOBAL_POSITION stream 2018-11-22 16:55:30 +01:00
Michael Schaeuble 15439fcc0b Mavlink: Add UTM_GLOBAL_POSITION stream 2018-11-22 16:55:30 +01:00
Mara Bos 10c20b38ad Fix many format strings.
Fixes these invalid format strings:
- A `%d` for a pointer (replaced it by `%p`)
- A 0x%08x (and a 0x%0x8!) for a pointer (replaced by %p)
- 2 cases of `%d` for a `ssize_t` (replaced it by `%zi`)
- 1 case of a %u for an `int` (replaced by %i)
- 3 cases of %d for a `long` (replaced by %ld)
- 19 cases of `%d`, `%i`, `%u` or `%lu` for a `size_t` (replaced it by `%zu`)
- An unused formatting argument (removed it)
- A missing `%d` (added it)
- A missing `%s` (added it)
- 2 cases of `%llu` for a `uint64_t` (replaced it by `"%" PRIu64`)
- 6 cases of giving a string directly as format string (replaced it by `("%s", string)`)
- 2 cases of %*-s, which should probably have been %-*s.
  (Looks like NuttX accepts (the invalid) %*-s, but other platforms don't.)
- A %04x for a `uint32_t` (replaced by "%04" PRIx32)
2018-10-27 12:44:51 +02:00
TSC21 3228e494bd radio_status: change 'fixed' field name to 'fix' so it does not clash with 'fixed' floating-point notation on the IDL generation 2018-10-08 10:58:45 +02:00
Beat Küng e2a32aab76 mavlink_main: add support for autopilot_version.uid2 2018-10-03 10:30:10 +02:00
Julien Lecoeur cb3d86a609 Add support for mavlink message DEBUG_FLOAT_ARRAY 2018-09-27 12:33:12 -04:00