Closed paulholmstedt closed 2 years ago
I think what changed is that PX4 no longer sends out MAVLink by default on USB. It only starts sending MAVLink messages once it has received MAVLink.
Therefore, we need to send heartbeats by default in MAVSDK by setting the configuration, something like this:
Mavsdk::Configuration configuration{Mavsdk::Configuration::UsageType::GroundStation};
configuration.set_always_send_heartbeat(true);
Mavsdk mavsdk;
mavsdk.set_configuration(configuration);
And then I should probably change the default to prevent this from happening.
Thanks! That explains the issue I’m seeing.
I'm experiencing the same issue. Reverting to the previous commit also does not seem to work (I can't make the config changes describes by @julianoes as they break a few other scripts I'm running) Any idea when these changes to Mavlink were committed?
I can't make the config changes describes by @julianoes as they break a few other scripts I'm running
How does it break it? You can change the reset of the config, as long as you do set_always_send_heartbeat(true)
.
Any idea when these changes to Mavlink were committed?
Because it allows to have the NuttShell as well as MAVLink on USB. If you hit enter, you get nsh
, if you send MAVLink, you get MAVLink. It's kinda neat but broke existing implementations such as MAVSDK.
Hey @julianoes I figured out the issue. One of my conda environments was interfering with cmake and messing up my interface scripts. Disabling conda from the .bashrc followed by rebuilding PX4 from source at commit https://github.com/PX4/PX4-Autopilot/commit/889a2fddea152f745090669396d279ef254df5dd solved the problem!
After upgrading one of our Cube Orange PX4 Flight Controllers from PX4 firmware Stable Release v1.12.3 to v1.3.0 MAVSDK v1.4.4 (running on Windows 11 operating system compiled with Visual Studio 2022) is not able to establish a serial connection (i.e. serial://COM16:57600) with the autopilot. It does work when using UDP connection. There is a workaround for it which is to first start QGroundControl and close it down, then connect to the same serial port via MAVSDK. As soon as the autopilot is restarted MAVSDK fails to connect again via serial port until QGroundControl has been run once on the same serial port. The issue has been tested on 2 different flight controllers running SITL. Both tested with my own MAVSDK based software as well with the "fly_mission.cpp" example under MAVSDK GitHub. .