forked from Archive/PX4-Autopilot
Navigator: Do not publish an empty triplet
This commit is contained in:
parent
8b41ddd224
commit
a700b02f77
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue