MAVSDK examples cannot connect to both SITL and a real pixhawk connected via usb serial

Hi,

I’m trying to run MAVSDK examples from https://github.com/mavlink/MAVSDK on my linux ubuntu machine.
Building and running any example doesn’t seem to connect to the hardware or SITL.

Here is the output of running the example “fly_mission”:
$ ./fly_mission serial:///dev/ttyACM0:115200
[03:12:55|Info ] MAVSDK version: 0.23.0 (mavsdk_impl.cpp:25)
Waiting to discover system…
[03:12:55|Debug] New: System ID: 1 Comp ID: 1 (mavsdk_impl.cpp:401)
[03:12:55|Debug] Component Autopilot (1) added. (system_impl.cpp:386)
[03:12:55|Debug] Discovered 1 component(s) (UUID: 1) (system_impl.cpp:556)
Discovered system with UUID: 1
Waiting for system to be ready
[03:12:56|Error] Error: UUID changed (system_impl.cpp:241)
[03:12:56|Error] Error: UUID changed (system_impl.cpp:241)
[03:12:56|Warn ] command unsupported (511). (mavlink_commands.cpp:163)
[03:12:56|Error] Error: get param busy timeout: CAL_GYRO0_ID (mavlink_parameters.cpp:456)
[03:12:56|Error] Error: Param for gyro cal failed. (telemetry_impl.cpp:913)
Waiting for system to be ready
[03:12:57|Error] Error: get param busy timeout: CAL_ACC0_ID (mavlink_parameters.cpp:456)
[03:12:57|Error] Error: Param for accel cal failed. (telemetry_impl.cpp:924)
[03:12:57|Error] Error: get param busy timeout: CAL_MAG0_ID (mavlink_parameters.cpp:456)
[03:12:57|Error] Error: Param for mag cal failed. (telemetry_impl.cpp:935)
Waiting for system to be ready
[03:12:58|Error] Error: get param busy timeout: SYS_HITL (mavlink_parameters.cpp:456)
[03:12:58|Error] Error: Param to determine hitl failed. (telemetry_impl.cpp:959)
Waiting for system to be ready
Waiting for system to be ready
Waiting for system to be ready
Waiting for system to be ready
Waiting for system to be ready
Waiting for system to be ready
Waiting for system to be ready

Getting “[Errno 111] Connection refused sleeping” when running with SITL.

Hello,

Unless recent change MAVSdk is only compatible with px4.

It’s hardcoded to px4 and is not mavlink generic.
You would have to code up a plug-in to make it work.

Any idea how to make MAVSDK for with Ardupilot? (Tutorial link…)

There is no compatibility right now. You would need to modify the source.