23 Commits

Author SHA1 Message Date
Daniel Agar
263b00b65f
ekf2 support SET_GPS_GLOBAL_ORIGIN and remove globallocalconverter usage
- vehicle_command cmd extended from uint16 to support PX4 internal commands that don't map to mavlink
2021-03-05 18:25:14 -05:00
Julian Oes
2a0ddf9f44 mavlink: enable 6 instead of 4 instance 2021-02-17 13:54:34 -05:00
Julian Oes
a2ff53b018 mavlink: remove typedef of anonymous struct
Clang doesn't seem to like these.
2020-12-06 23:55:59 -05:00
David Jablonski
09180b9d4a
mavlink: increment cmd confirmation field (#14808) 2020-05-04 09:21:01 +02:00
Beat Küng
3198610f85 src/platforms: move all headers to platforms/common/include/px4_platform_common
and remove the px4_ prefix, except for px4_config.h.

command to update includes:
for k in app.h atomic.h cli.h console_buffer.h defines.h getopt.h i2c.h init.h log.h micro_hal.h module.h module_params.h param.h param_macros.h posix.h sem.h sem.hpp shmem.h shutdown.h tasks.h time.h workqueue.h; do for i in $(grep -rl 'include <px4_'$k src platforms boards); do sed -i 's/#include <px4_'$k'/#include <px4_platform_common\/'$k/ $i; done; done
for in $(grep -rl 'include <px4_config.h' src platforms boards); do sed -i 's/#include <px4_config.h/#include <px4_platform_common\/px4_config.h'/ $i; done

Transitional headers for submodules are added (px4_{defines,log,time}.h)
2019-10-30 11:48:47 +01:00
Julian Oes
82bee2bf54 mavlink: match commands aimed at any sysid/compid
When we send a command to any sysid or any compid, we need to match an
ack from a specific sysid or compid. If we don't do that, we keep
sending retransmissions and eventually time out.
2019-08-14 13:29:07 -04:00
RomanBapst
43d006aff2 mavlink command sender: give channels more time to request command
- if a channel receives an ack for a command, do not immediately remove the
command item from the send queue but wait until the next ack timeout occurs.
This gives other mavlink channels time to try to put identical commands into
the send queue.

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-08-05 12:07:05 +02:00
RomanBapst
71791fa8f8 mavlink_command_sender: don't try to resend command to instance which
did not request this command

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-08-05 12:07:05 +02:00
RomanBapst
807cfc8aac mavlink: fix race condition in mavlink_command_sender
- if we receive an ack for a command through a specific mavlink channel
then do not drop the corresponding command in the queue if this specific
mavlink channel did not issue the command. If we don't do this we can
end up in a situation where we associate an ack coming through a specific
mavlink channel to a command in the queue which was not requested by this mavlink channel.
Moreover, the actual command for which the ack was meant remains in the
queue and eventually triggers a timeout.

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-08-05 12:07:05 +02:00
Daniel Agar
a99f75dde2 Mavlink set last sent timestamp to space out initial publication
- remove QURT defines no longer required
2018-06-09 13:38:44 +02:00
Julian Oes
ba150566c6 mavlink_command_sender: add some log printfs
This improves the printfs which will be logged. This should improve to
debug the camera triggering. The debug printfs are disabled by default.
2017-08-16 09:47:50 +02:00
Julian Oes
31edab6d6d mavlink_command_sender: remove unused include 2017-08-16 09:47:50 +02:00
Lorenz Meier
90fdc544fd MAVLink app: Code style fix 2017-07-08 15:34:36 +02:00
Lorenz Meier
ddf32e14de MAVLink app: More print improvements 2017-07-08 15:23:46 +02:00
Lorenz Meier
d15dd061f9 MAVLink app: More debug string formatting 2017-07-08 14:36:08 +02:00
Lorenz Meier
e8aa5a3172 MAVLink app: Fix non-enabled debug string output 2017-07-08 14:23:46 +02:00
Lorenz Meier
6f368f34d1 MAVLink: Remove non-required safety check 2017-07-08 13:59:35 +02:00
Lorenz Meier
8d8174ea0c MAVLink command retransmission: Reduce RAM footprint and make debug output optional 2017-07-08 12:46:28 +02:00
Julian Oes
1576094d9f mavlink_command_sender: use const ref 2017-07-08 11:52:23 +02:00
Julian Oes
893b7b5d46 mavlink_command_sender: instantiate in initialize 2017-07-08 11:52:23 +02:00
Julian Oes
c66af00753 mavlink_command_sender: fix NuttX build 2017-07-08 11:52:23 +02:00
Julian Oes
e6d31f951c mavlink_command_sender: fix logic after first test
- change/add a few printfs so they make more sense
- don't accidentally ignore command_acks
- don't forward commands to the same component id, and don't forward
  commands that are broadcast to all components (target component 0)
2017-07-08 11:52:23 +02:00
Julian Oes
af0107ae0a mavlink: add class for command retransmission
This adds a class to allow for retransmission of outgoing commands.
The sent commands are kept in a timestamped list to check if they are
acked as required by the mavlink protocol.
If they are not acked within a timeout, they can be retransmitted.
2017-07-08 11:52:23 +02:00