Skip to content

Commit

Permalink
Navigator: Do not publish an empty triplet
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzMeier committed May 13, 2016
1 parent 2cc613c commit 2807e53
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/modules/navigator/navigator_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,11 @@ Navigator::publish_position_setpoint_triplet()
/* update navigation state */
_pos_sp_triplet.nav_state = _vstatus.nav_state;

/* do not publish an empty triplet */
if (!_pos_sp_triplet.current.valid) {
return;
}

/* lazily publish the position setpoint triplet only once available */
if (_pos_sp_triplet_pub != nullptr) {
orb_publish(ORB_ID(position_setpoint_triplet), _pos_sp_triplet_pub, &_pos_sp_triplet);
Expand Down

0 comments on commit 2807e53

Please sign in to comment.