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
+1 -9
View File
@@ -72,11 +72,6 @@ PrecLand::PrecLand(Navigator *navigator) :
void
PrecLand::on_activation()
{
// We need to subscribe here and not in the constructor because constructor is called before the navigator task is spawned
if (_target_pose_sub < 0) {
_target_pose_sub = orb_subscribe(ORB_ID(landing_target_pose));
}
_state = PrecLandState::Start;
_search_cnt = 0;
_last_slewrate_time = 0;
@@ -111,10 +106,7 @@ void
PrecLand::on_active()
{
// get new target measurement
orb_check(_target_pose_sub, &_target_pose_updated);
if (_target_pose_updated) {
orb_copy(ORB_ID(landing_target_pose), _target_pose_sub, &_target_pose);
if (_target_pose_sub.update(&_target_pose)) {
_target_pose_valid = true;
}