Skip to content

Commit

Permalink
Merge pull request #2372 from mavlink/pr-battery-example-id
Browse files Browse the repository at this point in the history
examples: fix sysid/compid of battery example
  • Loading branch information
JonasVautherin authored Aug 13, 2024
2 parents c797232 + 0604b8b commit 1eea017
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/battery/battery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1eea017

Please sign in to comment.