From 0604b8bd73aef9dad0aae6b6f74340fff3de53fb Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Tue, 13 Aug 2024 14:14:30 +1200 Subject: [PATCH] examples: fix sysid/compid of battery example --- examples/battery/battery.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/battery/battery.cpp b/examples/battery/battery.cpp index a52611c177..8c89ef0658 100644 --- a/examples/battery/battery.cpp +++ b/examples/battery/battery.cpp @@ -36,7 +36,10 @@ int main(int argc, char** argv) return 1; } - Mavsdk mavsdk{Mavsdk::Configuration{Mavsdk::ComponentType::GroundStation}}; + // We identify ourselves as a battery component MAV_COMP_ID_BATTERY. + // To match the autopilot we use sysid 1 which is the default, so likely + // matching. If other sysids are used, we'd have to adapt this. + Mavsdk mavsdk{Mavsdk::Configuration{1, 180, false}}; ConnectionResult connection_result = mavsdk.add_any_connection(argv[1]); if (connection_result != ConnectionResult::Success) {