Commit Graph

40 Commits

Author SHA1 Message Date
Beat Küng 97fe5f928a mavlink_orb_subscription: remove unneeded checks
not needed anymore after the previous commit
2018-07-23 22:32:17 +02:00
Beat Küng e1a7472738 MavlinkOrbSubscription::update: improve performance & fix corner case
- reorders operations, such that the most expensive one (orb_copy) is done
  only when really needed.
- corner case: when the topic was not advertised yet, orb_stat() would fail
  and then update() was called, which succeeds for the first advertisement.
  In that case the timestamp was incorrectly set to 0 and true was
  returned.
  The next call would again return true, because the timestamp was updated,
  but the topic data was still the same.

Reduces CPU load by ~2% on a Pixracer.
2018-07-12 21:31:38 +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
Daniel Agar 3db287ba67 mavlink messages delete unnecessary timestamps and cleanup 2018-03-28 15:37:57 -04:00
Daniel Agar deb5cbcc82 mavlink GLOBAL_POSITION_INT use vehicle_local_position for altitude 2018-03-28 15:37:57 -04:00
Beat Küng d930ad4e9e mavlink_orb_subscription: reduce orb_exists() check from 10Hz to 3Hz
Checking with 3Hz for new topics should be fast enough.
2017-10-18 08:40:32 +02:00
wangxdflight 67c3102db4 updated to remove a compilation flag check as orb_exists() is already supported 2017-01-16 08:25:58 -08:00
wangxdflight b693e29d64 enable px4 flight for excelsior(legacy) 2017-01-16 08:25:58 -08:00
Daniel Agar c9956e25b4 mavlink fix code style 2017-01-07 01:03:18 -05:00
Daniel Agar e0a9793347 mavlink doesn't have already published message
- if the land detector started before the mavlink module it won't have
   a valid message vehicle_land_detected message until published again
2016-11-29 00:49:57 -05:00
Beat Küng 4da2ae2302 MavlinkOrbSubscription: optimize fields for size
reorder & reduce instance to uint8_t (which is more than enough).
Reduces sizeof(MavlinkOrbSubscription) from 40 to 24.

On Pixracer this frees almost 2KB of RAM
2016-10-23 15:25:20 +02:00
Julian Oes aa6d9e363f mavlink: fix a shadowing warning 2016-09-30 08:02:55 +02:00
Julian Oes ab4441c00b mavlink: add comment for Snapdragon 2016-09-30 08:02:55 +02:00
Julian Oes 1b69f9cb23 mavlink: don't miss first vehicle_command_ack
This fixes a corner case where the first advertise/publish of a
vehicle_command_ack was missed. What happened was that the
orb_subscribe_multi was not called until the topic had been published
and therefore orb_exists was happy. This means that by the time
orb_subscribe_multi was finally called, the first vehicle_command_ack
was already history and not detected by orb_check.

This changed adds a flag to the MavlinkOrbSubscription which tells it to
subscribe to a topic from the beginning.
2016-09-30 08:02:55 +02:00
Lorenz Meier e011a528eb Enable a workaround for #5438 (#5450)
* Enable a workaround for #5438

* Disable Travis Slack integration

* Fix formatting
2016-09-06 23:34:02 +02:00
Lorenz Meier 15e50b26dc Fix MAVLink subscription 2016-08-28 15:53:42 +02:00
Lorenz Meier 8dc8ae7de8 MAVLink app: Only hold buffers for published topics 2016-08-28 10:49:41 +02:00
Lorenz Meier 720c445f21 MAVLink: Code style 2016-08-26 23:43:33 +02:00
Julian Oes 8345a0368b mavlink: add function to copy only if updated
The MavlinkOrbSubscription only had an interface to either always copy
or copy based on a timestamp. This commit adds a copy interface if the
topic has been updated.
2016-07-13 10:10:45 +02:00
Beat Küng d8fbd8a6f6 fix MavlinkOrbSubscription: use orb_unsubscribe instead of close() 2016-06-07 10:05:59 +02:00
Lorenz Meier 55c879a0ab MAVLink: Use valid flag to initialize fields 2016-05-15 15:38:01 +02:00
Mark Charlebois 1f84c348fc fix for segv if topic has not been published
If the topic has not been published, orb_copy returns a
negative number which causes update() to memset the data
contents to zero.

In some instances data is a null pointer. This causes a
segment violation crash.

Added a check for data != 0

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:15:12 -07:00
Lorenz Meier dcf03a2594 mavlink app: Use actuator controls message 2015-02-13 09:33:12 +01:00
Lorenz Meier cbe3783d5e Support topic groups in MAVLink subscription handling 2015-01-29 16:33:53 +01:00
Don Gagne 92adbe9216 Fix compiler warnings 2014-06-29 17:47:24 -07:00
Thomas Gubler f9d5cf332c Revert "Hotfix: Only orb_copy items in mavlink app if the timestamp changed"
This reverts commit a9653fa10d.
2014-06-25 17:05:20 +02:00
Lorenz Meier a9653fa10d Hotfix: Only orb_copy items in mavlink app if the timestamp changed 2014-06-23 13:51:05 +02:00
Anton Babushkin 342e08977a MavlinkOrbSubscription API reworked 2014-06-11 14:00:44 +02:00
Lorenz Meier fbb3adde06 mavlink app: Clean up allocations 2014-05-16 14:00:58 +02:00
Anton Babushkin fc757f9492 mavlink: is_published() fix 2014-04-02 15:38:49 +04:00
Anton Babushkin 762e8f5289 mavlink_orb_subscription: minor optimization and comment fix 2014-03-16 17:28:34 +04:00
Anton Babushkin df5d702bae mavlink: MavlinkOrbSubscription.update() result fixed 2014-03-16 17:10:56 +04:00
Lorenz Meier 3874bca208 mavlink: Only send messages when we have updates for them. 2014-03-16 13:48:33 +01:00
Anton Babushkin 1b8004cd8e mavlink: add new streams in main loop, minor cleanup and fixes 2014-03-01 16:43:04 +04:00
Anton Babushkin 836f7c435f mavlink: code style and copyright fixes 2014-03-01 00:16:51 +04:00
Anton Babushkin 141982a3ac mavlink: minor refactoring and cleanup, rate limiter class implemented, new messages added 2014-02-27 13:54:55 +04:00
Anton Babushkin 7310fd6085 mavlink: use inherited classes instead of callbacks for mavlink messages formatting, fixes and cleanup 2014-02-26 21:28:35 +04:00
Anton Babushkin e291af990f mavlink: adding message stream by name implemnted, mavlink streams definitions and formatters moved to mavlink_messages.h/cpp, mavlink_orb_listener class and thread removed 2014-02-26 00:24:14 +04:00
Anton Babushkin cf7ac7e660 mavlink_orb_subscription: bug fixed 2014-02-25 00:04:44 +04:00
Anton Babushkin d8fdade6ab mavlink: major rewrite, prepare for dynamic mavlink streams configuration, WIP 2014-02-24 23:46:58 +04:00