Commit Graph

552 Commits

Author SHA1 Message Date
Beat Küng 84841236cb mavlink: allow resetting mavlink streams to default via MAV_CMD_SET_MESSAGE_INTERVAL
This implementation does not need more resources.
It's not super efficient in terms of runtime, but it's also not something
that is called often.
2018-06-25 12:19:56 +02:00
Beat Küng 333fd9cf45 mavlink: improve status output
- add datarate
- add UDP remote port
- add partner IP
2018-06-25 12:19:56 +02:00
Beat Küng f59412ba65 mavlink: only enable HIL_ACTUATOR_CONTROLS in hil if link has enough bandwidth
Plus correct return value.
Iridium links are below that.
2018-06-25 12:19:56 +02:00
Julien Lecoeur c73944c7a2 Mavlink: initialize _ping_stats
Uninitialized `_ping_stats.last_ping_time` caused ping statistics to be printed even when no ping was received.
2018-06-19 13:00:36 +02:00
Beat Küng 08064c2b71 mavlink_main: remove nonexisting streams
Removes SITL startup warnings:
WARN  [mavlink] stream SCALED_IMU2 not found
WARN  [mavlink] stream SCALED_IMU3 not found

Introduced in 9122725052
2018-06-13 15:54:45 +02:00
Daniel Agar d73d20bcce systemlib delete unused systemlib.h 2018-06-12 09:06:30 +02:00
acfloria 57162ff08d Improve high latency switching and acknowledge
- Move publishing the telemetry status from the IridiumSBD driver to the mavlink instance
- In the commander use the iridiumsbd_status message for heartbeat in case of a high latency link
- Move positive acknowledge to the mavlink instance
- Add a failed acknowledge in the commander if no high latency link exists
2018-05-27 12:11:35 -04:00
mcsauder 9122725052 Alphabetize the mavlink stream lists in mavlink_main.cpp. 2018-05-26 14:49:08 -04:00
Mohammed Kabir 92457bcafd mavlink : implement full ping protocol and link latency reporting 2018-05-15 18:57:34 +02:00
Daniel Agar ea3acb7121 cmake remove circular linking and reorganize
- px4_add_module now requires MAIN
 - px4_add_library doesn't automatically link
2018-04-29 21:48:54 -04:00
acfloria ae807fc189 Move VEHICLE_CMD_CONTROL_HIGH_LATENCY ack to commander 2018-04-11 15:15:28 +02:00
acfloria 53fdbb6c04 Remove unnecessary newlines 2018-04-11 15:15:28 +02:00
acfloria 6f0d3ffe9b Mavlink: Add acknowledge for VEHICLE_CMD_CONTROL_HIGH_LATENCY 2018-04-11 15:15:28 +02:00
acfloria da57dbbce0 Increase the MavLink module stack size 2018-04-11 15:15:28 +02:00
acfloria 6c3857a147 Remove exception for command acknowledge in mavlink transmitting 2018-04-11 15:15:28 +02:00
acfloria edd337880d Improve message handling in mavlink IRIDIUM mode
- Do not send any mission updates as they are handled within HIGH_LATENCY2
- Always send a command acknowledge even if transmitting is not enabled
2018-04-11 15:15:28 +02:00
acfloria 1fd8b681a0 Transmit one message over high latency telemetry on boot 2018-04-11 15:15:28 +02:00
acfloria e061b1a3a5 Do not enable hil for high latency mavlink 2018-04-11 15:15:28 +02:00
acfloria 17a157b9da Adopt high latency switching to new MAV_CMD design 2018-04-11 15:15:28 +02:00
acfloria ce1b908714 Adopt mavlink stream to new HIGH_LATENCY2 definition 2018-04-11 15:15:28 +02:00
acfloria 1cc84ad8c9 Remove magic numbers from commander.cpp and style fixes 2018-04-11 15:15:28 +02:00
acfloria 4f256cca20 Improvements for the iridiumsbd driver
- Update heartbeat after successful sbd session and fill it in the telemetry_status message
- Add parameter for session timeout, read interval, and stacking time
- Add sbd session timeout
- Fix updating the rssi at a constant rate when no sbd session is scheduled
- Add variable timout to read_at function
- Check if test command is valid to avoid being stuck in the test state
2018-04-11 15:15:28 +02:00
acfloria 631f314e89 En-/disable transmitting from a mavlink instance using a uORB message
Allow enabling/disabling transmitting data from all mavlink instances
with a specific mode/type. When disabled the instance can still receive
data. The uORB message used is the vehicle_command and uses the following
parameter:
param1: Specifies the mode/type of the instances to enable/disable transmitting
param2: Boolean to indicate if transmitting should be enabled or disabled
2018-04-11 15:15:28 +02:00
Daniel Agar f145b65cbb mavlink static streams_list array 2018-04-03 18:37:51 -04:00
Daniel Agar 29b3950747 move geo and geo_lookup to PX4/ecl 2018-03-26 23:16:55 -04:00
Vasily Evseenko ebe74ccb2e Add 'forced on' flow control mode to mavlink UART (#8776) 2018-03-10 14:54:57 -05:00
Daniel Agar 5ef27c5425 mavlink add minimal mode (#8947) 2018-03-04 17:50:28 -05:00
Daniel Agar 2d27b1eb52 delete unused MAV_TEST_PAR 2018-02-10 20:37:47 -05:00
Beat Küng a644ed90dd mavlink: use orb_unsubscribe() instead of close() for orb subscription 2018-01-31 15:18:51 +01:00
Jonas Vautherin 38c949731f mavlink_main: fix broadcast computation
The way the broadcast IP is currently fetched is by sending an ioctl()
request. The limitation of this is that the broadcast address may not
be set on the network interface (more specifically, it is usually not
set in docker containers). In those cases, it results in the broadcast
address becoming 0.0.0.0, which is not valid [1].

This fix uses the network IP and the netmask to compute the directed
broadcast address. This should be more reliable, as both of those are
always set on the network interface.

[1]: https://tools.ietf.org/html/rfc1122, section 3.2.1.3 (a)
2018-01-21 14:58:04 +01:00
Lorenz Meier 6227139df1 MAVLink app: Make debug messages a compile time check
The debug messages are too verbose to be run in a production vehicle and inherently were something that should only be run in SITL / debug sessions on hardware. Switching the flag to the PX4_DEBUG() macro does not only make this more explicit, but also saves a lot of flash space that otherwise was consumed by the strings.
2018-01-13 22:02:57 -05:00
Lorenz Meier 2170e7eba0 MAVLink main: Only update internal parameters
All param handling happens in the param manager.
2018-01-08 09:27:22 +01:00
Lorenz Meier fba592b5fc MAVLink app: Send newest param hash for every param change to notify GCS about change
This should help keeping the GCS up to date about asynchronous changes on the autopilot.
2018-01-08 09:27:22 +01:00
Matthias Grob 70de169f15 Cygwin: Enable build of SITL jMAVsim under Windows using the Cygwin Unix-like environment
Most of the incompatitbilities are luckily similar to the darwin build.
- New target OS __PX4_CYGWIN added because in other build environments on Windows defines will very likely be completely different
- added all necessary exeptions to the defines
- disabled priorities completely because on Windows they are defined 1-32 and with all the arbitrary +40 -40 priority settings there were a lot of problems
  not only did some threads/"virtual tasks" not start because of out of bound priorities but also the resulting scheduling was totally random and inadequate
  with default priorities it ran toally fine during my first tests, should be rethought when windows is used onboard in the future
2018-01-05 14:47:33 -05:00
Daniel Agar 627788c93c mavlink remove unnecessary param set notification 2018-01-04 09:21:17 +01:00
Lorenz Meier dd7b72dfb0 MAVLink app: Fix boot-time race between receive thread and instantiation. 2017-10-07 13:56:30 +02:00
Julien Lecoeur 12353f4da7 Add support for mavlink message DEBUG_VECT 2017-08-30 14:45:02 +01:00
Julien Lecoeur eeb966d375 Add support for mavlink message DEBUG 2017-08-30 14:45:02 +01:00
Beat Küng dd4be8aecf mavlink: only enable FTP if -x flag is provided 2017-08-24 19:03:58 +02:00
Beat Küng 12f1c342d0 mavlink_main: do not use message_buffer if _ftp_on
if _ftp_on is true, message_buffer was created and read, but it was
actually never written to, so this is not needed. It can only ever be
written to if _forwarding_on is true.
2017-08-24 19:03:58 +02:00
José Roberto de Souza 4462869432 Add support to new fields in command_ack 2017-08-19 09:04:52 +02:00
José Roberto de Souza 925efe990d Initialize all outgoing vehicle_command_ack_s and vehicle_command_s
This will initialize those structs with zero in all fields not set
and all fields set will only be change once to the final value not
wasting CPU time zeroing it.

This will guarantee that no non-unitialized structs will have
a trash value on from_external causing it to be sent to the
MAVLink channel without need it.
2017-08-08 21:46:30 +02:00
José Roberto de Souza 7c268f4fa1 mavlink: Safely avoid send the same vehicle_command and vehicle_command_ack back
The previous approach was checking system id and component id but it
will not work in 100% of cases as external devices can send MAVLink
message with the right system id but with broadcast component id.
2017-08-08 21:46:30 +02:00
José Roberto de Souza 89a428fbfe commander: Keep vehicle_command_ack_s local
No need to keep this struct as global or alive while looping.
2017-08-08 21:46:30 +02:00
Beat Küng 45e185f8e3 mavlink: document verbose command 2017-08-04 18:08:51 +02:00
Beat Küng cf3b068179 mavlink: add 'verbose [on|off]' command 2017-08-04 18:08:51 +02:00
Beat Küng 371586be2c MAVLink: Add verbose command 2017-08-04 18:08:51 +02:00
Beat Küng a987886ca3 mavlink: add fence & rally to protocol capabilities 2017-08-04 18:08:51 +02:00
Lorenz Meier 68d70cc8c0 MAVLink: Use modern PX4 output format to enable system logging for errors. 2017-07-29 16:12:41 +02:00
Lorenz Meier 09f1373a08 MAVLink: Adjust stream rates to match real usage 2017-07-29 16:12:41 +02:00