mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-20 20:03:54 +08:00
status_display: remove unused vehicle_attitude topic
This commit is contained in:
@@ -83,11 +83,6 @@ bool StatusDisplay::check_for_updates()
|
||||
got_updates = true;
|
||||
}
|
||||
|
||||
if (_subscriber_handler.vehicle_attitude_updated()) {
|
||||
orb_copy(ORB_ID(vehicle_attitude), _subscriber_handler.get_vehicle_attitude_sub(), &_vehicle_attitude);
|
||||
got_updates = true;
|
||||
}
|
||||
|
||||
return got_updates;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,9 +27,6 @@ void SubscriberHandler::subscribe()
|
||||
_vehicle_status_flags_sub = orb_subscribe(ORB_ID(vehicle_status_flags));
|
||||
}
|
||||
|
||||
if (_vehicle_attitude_sub < 0) {
|
||||
_vehicle_attitude_sub = orb_subscribe(ORB_ID(vehicle_attitude));
|
||||
}
|
||||
}
|
||||
|
||||
void SubscriberHandler::unsubscribe()
|
||||
@@ -59,10 +56,6 @@ void SubscriberHandler::unsubscribe()
|
||||
_vehicle_status_flags_sub = -1;
|
||||
}
|
||||
|
||||
if (_vehicle_attitude_sub >= 0) {
|
||||
orb_unsubscribe(_vehicle_attitude_sub);
|
||||
_vehicle_attitude_sub = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void SubscriberHandler::check_for_updates()
|
||||
@@ -103,10 +96,4 @@ void SubscriberHandler::check_for_updates()
|
||||
_update_bitfield |= (uint32_t)StatusMask::CpuLoad;
|
||||
}
|
||||
|
||||
updated = false;
|
||||
orb_check(_vehicle_attitude_sub, &updated);
|
||||
|
||||
if (updated) {
|
||||
_update_bitfield |= (uint32_t)StatusMask::VehicleAttitude;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,9 +27,6 @@ public:
|
||||
int get_vehicle_command_sub() const { return _vehicle_command_sub; }
|
||||
int get_vehicle_status_sub() const { return _vehicle_status_sub; }
|
||||
int get_vehicle_status_flags_sub() const { return _vehicle_status_flags_sub; }
|
||||
int get_vehicle_attitude_sub() const { return _vehicle_attitude_sub; }
|
||||
// TODO: incorporate an add_topic method, this will push back the sub handler
|
||||
// in the subscriber vector
|
||||
|
||||
/* update checking methods */
|
||||
bool battery_status_updated() const { return _update_bitfield & (uint32_t)StatusMask::BatteryStatus; }
|
||||
@@ -37,7 +34,6 @@ public:
|
||||
bool vehicle_command_updated() const { return _update_bitfield & (uint32_t)StatusMask::VehicleCommand; }
|
||||
bool vehicle_status_updated() const { return _update_bitfield & (uint32_t)StatusMask::VehicleStatus; }
|
||||
bool vehicle_status_flags_updated() const { return _update_bitfield & (uint32_t)StatusMask::VehicleStatusFlags; }
|
||||
bool vehicle_attitude_updated() const { return _update_bitfield & (uint32_t)StatusMask::VehicleAttitude; }
|
||||
|
||||
|
||||
private:
|
||||
@@ -47,16 +43,13 @@ private:
|
||||
VehicleStatusFlags = (0x01 << 2),
|
||||
BatteryStatus = (0x01 << 3),
|
||||
CpuLoad = (0x01 << 4),
|
||||
VehicleAttitude = (0x01 << 5),
|
||||
};
|
||||
|
||||
// TODO: incorporate the subscriber into a vector of int
|
||||
int _battery_status_sub = -1;
|
||||
int _cpuload_sub = -1;
|
||||
int _vehicle_command_sub = -1;
|
||||
int _vehicle_status_sub = -1;
|
||||
int _vehicle_status_flags_sub = -1;
|
||||
int _vehicle_attitude_sub = -1;
|
||||
|
||||
uint32_t _update_bitfield = 0;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user