Skip to content

Commit 3d03fb0

Browse files
Fix system discovery
1 parent bb6941d commit 3d03fb0

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/mavsdk/core/mavsdk_impl.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -300,13 +300,10 @@ void MavsdkImpl::receive_message(mavlink_message_t& message, Connection* connect
300300

301301
std::lock_guard<std::recursive_mutex> lock(_systems_mutex);
302302

303-
// The only situation where we create a system with sysid 0 is when we initialize the connection
304-
// to the remote.
303+
// If we have a system with sysid 0, it is the "fake" system we built to initialize the
304+
// connection to the remote. We can remove it now that a remote system is discovered.
305305
if (_systems.size() == 1 && _systems[0].first == 0) {
306-
LogDebug() << "New: System ID: " << static_cast<int>(message.sysid)
307-
<< " Comp ID: " << static_cast<int>(message.compid);
308-
_systems[0].first = message.sysid;
309-
_systems[0].second->system_impl()->set_system_id(message.sysid);
306+
_systems.clear();
310307
}
311308

312309
bool found_system = false;

0 commit comments

Comments
 (0)