I’m using mavsdk in python env , and can listen to mavlink msgs and update parameters to a pixhawk cube attached by a usb cable.
But , I cant use the QgroundControl and mavsdk in parallel ! as they both use the same USB port and block each other. I need them both attached at the same time threw the same usb port.
Did anyone encounter this problem? Is there a way in python , to solve this problem?
solved it by using mavlink-router to forward the serial mavlink mssgs to different UDP ports.
then QGC connects to one of the UDP ports and MAVSDK to the other.
Hi, I know this was a long time ago, is there a code example you can share where this was done? This may be something that I will be needing in the near future.
You can also do this using MAVSDK without mavlink-router:
For that, you need to add both connections to the
Mavsdk instance, and set forwarding on for both of them.
Unfortunately, I don’t have an example ready just now, and I can’t find it in the docs, but it should be clear from the API:
* @brief Adds Connection via URL
* Supports connection: Serial, TCP or UDP.
* Connection URL format should be:
* - UDP: udp://[host][:bind_port]
* - TCP: tcp://[host][:remote_port]
* - Serial: serial://dev_node[:baudrate]
* For UDP, the host can be set to either:
* - zero IP: 0.0.0.0 -> behave like a server and listen for heartbeats.
* - some IP: 192.168.1.12 -> behave like a client, initiate connection
* and start sending heartbeats.
* @param connection_url connection URL string.
* @param forwarding_option message forwarding option (when multiple interfaces are used).
* @return The result of adding the connection.
const std::string& connection_url,
ForwardingOption forwarding_option = ForwardingOption::ForwardingOff);