Navigator: Do not publish an empty triplet

This commit is contained in:
Lorenz Meier 2016-05-13 11:03:35 +02:00
parent 8b41ddd224
commit a700b02f77
1 changed files with 5 additions and 0 deletions

View File

@ -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);