navigator move to new uORB::Subscription

This commit is contained in:
Daniel Agar
2019-06-05 20:28:44 -04:00
parent 79eb74be3f
commit e4ad994763
8 changed files with 55 additions and 173 deletions
+2 -8
View File
@@ -90,10 +90,6 @@ void FollowTarget::on_activation()
}
_rot_matrix = (_follow_position_matricies[_follow_target_position]);
if (_follow_target_sub < 0) {
_follow_target_sub = orb_subscribe(ORB_ID(follow_target));
}
}
void FollowTarget::on_active()
@@ -106,9 +102,7 @@ void FollowTarget::on_active()
bool updated = false;
float dt_ms = 0;
orb_check(_follow_target_sub, &updated);
if (updated) {
if (_follow_target_sub.updated()) {
follow_target_s target_motion;
_target_updates++;
@@ -117,7 +111,7 @@ void FollowTarget::on_active()
_previous_target_motion = _current_target_motion;
orb_copy(ORB_ID(follow_target), _follow_target_sub, &target_motion);
_follow_target_sub.copy(&target_motion);
if (_current_target_motion.timestamp == 0) {
_current_target_motion = target_motion;