diff options
author | Julian Oes <julian@oes.ch> | 2013-11-22 14:07:21 +0100 |
---|---|---|
committer | Julian Oes <julian@oes.ch> | 2013-11-22 14:07:21 +0100 |
commit | 5748a9c964b2c7d5b682a8d539e3c52d34a34d25 (patch) | |
tree | 7e44eec6bb86662d7cdd377f0b1d0a76de392fc6 /src/modules/navigator | |
parent | 7892a72f90be76fc948a0fbefb2357d29bbdffcc (diff) | |
download | px4-firmware-5748a9c964b2c7d5b682a8d539e3c52d34a34d25.tar.gz px4-firmware-5748a9c964b2c7d5b682a8d539e3c52d34a34d25.tar.bz2 px4-firmware-5748a9c964b2c7d5b682a8d539e3c52d34a34d25.zip |
Navigator: Publish mission triplet only when actually updated
Diffstat (limited to 'src/modules/navigator')
-rw-r--r-- | src/modules/navigator/navigator_main.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/modules/navigator/navigator_main.cpp b/src/modules/navigator/navigator_main.cpp index 9066a3b42..e58b9ae11 100644 --- a/src/modules/navigator/navigator_main.cpp +++ b/src/modules/navigator/navigator_main.cpp @@ -468,16 +468,6 @@ Navigator::task_main() advance_current_mission_item(); } } - - /* lazily publish the setpoint only once available */ - if (_triplet_pub > 0) { - /* publish the attitude setpoint */ - orb_publish(ORB_ID(mission_item_triplet), _triplet_pub, &_mission_item_triplet); - - } else { - /* advertise and publish */ - _triplet_pub = orb_advertise(ORB_ID(mission_item_triplet), &_mission_item_triplet); - } } perf_end(_loop_perf); @@ -721,6 +711,16 @@ Navigator::update_mission_item_triplet() _mission_item_triplet.next_valid = true; } } + + /* lazily publish the mission triplet only once available */ + if (_triplet_pub > 0) { + /* publish the mission triplet */ + orb_publish(ORB_ID(mission_item_triplet), _triplet_pub, &_mission_item_triplet); + + } else { + /* advertise and publish */ + _triplet_pub = orb_advertise(ORB_ID(mission_item_triplet), &_mission_item_triplet); + } } void |