Skip to content

Commit

Permalink
AP_DDS: remove instance check for DDS Client
Browse files Browse the repository at this point in the history
this is probably a flow of control problem.

But the code block below this resets some state variables before returning, and will also return false in the same case this removed block does.

Resetting that state might be very important to the caller.
  • Loading branch information
peterbarker committed Sep 5, 2024
1 parent adcf5d3 commit c05441b
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions libraries/AP_DDS/AP_DDS_Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,6 @@ bool AP_DDS_Client::update_topic(sensor_msgs_msg_NavSatFix& msg, const uint8_t i
// https://www.fluentcpp.com/2021/12/13/the-evolutions-of-lambdas-in-c14-c17-and-c20/
// constexpr auto times2 = [] (sensor_msgs_msg_NavSatFix* msg) { return n * 2; };

// assert(instance >= GPS_MAX_RECEIVERS);
if (instance >= GPS_MAX_RECEIVERS) {
return false;
}

auto &gps = AP::gps();
WITH_SEMAPHORE(gps.get_semaphore());

Expand Down

0 comments on commit c05441b

Please sign in to comment.