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:
Daniel Agar
2020-03-11 09:06:33 -04:00
committed by GitHub
parent 88c9761f1f
commit 9585055e9e
38 changed files with 919 additions and 200 deletions
+1 -11
View File
@@ -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()) {