mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-29 15:50:35 +08:00
uORB: add bitset for faster orb_exists check and remove uORB::Subscription lazy subscribe hack/optimization
- add PX4 bitset and atomic_bitset with testing - add uORB::Subscription constructor to take ORB_ID enum - move orb test messages into msg/
This commit is contained in:
@@ -3966,17 +3966,7 @@ Commander::offboard_control_update()
|
||||
{
|
||||
const offboard_control_mode_s &offboard_control_mode = _offboard_control_mode_sub.get();
|
||||
|
||||
// if this is the first time entering OFFBOARD the subscription may not be active yet
|
||||
bool force_update = false;
|
||||
|
||||
if (commander_state_s::MAIN_STATE_OFFBOARD) {
|
||||
if (offboard_control_mode.timestamp == 0) {
|
||||
_offboard_control_mode_sub.subscribe();
|
||||
force_update = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (_offboard_control_mode_sub.updated() || force_update) {
|
||||
if (_offboard_control_mode_sub.updated()) {
|
||||
const offboard_control_mode_s old = offboard_control_mode;
|
||||
|
||||
if (_offboard_control_mode_sub.update()) {
|
||||
|
||||
Reference in New Issue
Block a user