mavlink / mavlink-camera-manager

MAVLink Camera Manager Service
MIT License
103 stars 30 forks source link

Question: How to test that mavlink works? #445

Open phuesler opened 1 month ago

phuesler commented 1 month ago

Hi,

Thank you for creating and contributing to this useful project.

I'm struggling to understand the flow of data and hope that you can shed some light on it. Where can I test that I can start/top etc. the camera through mavlink commands? I was hoping this would work with QGrouncControl.

As I understand it, there are 4 components involved:

Which components are connected together? I assumed that QGroundControl and mavlink-camera-manager, there is no need to involve the flight controller. But I'm starting to think that his is wrong. Because I can't get it to work:

I followed the example in the Readme and issued the following commands:

./Tools/autotest/sim_vehicle.py -v ArduCopter
./mavlink-camera-manager-linux-desktop --verbose --mavlink-system-id 1 --mavlink tcpout:0.0.0.0:5760
./QGroundControl.AppImage

I then changed the QGroundControl Application settings to listen on port 5600 for a UDP stream. Once configured in the UI of mavlink-camera-manager, the video shows up in QGroundControl.

When I check the output of mavlink-camera-manager, it doesn't say anything about a successful mavlink connection. It is outputting the same debug message about mavlink HEARTBEAT, regardless of weather QGroundControl is running or not.

2024-10-22T10:47:17.984371Z DEBUG sender_loop: src/lib/mavlink/manager.rs:175: Message sent: MavHeader { system_id: 1, component_id: 100, sequence: 0 }, HEARTBEAT(HEARTBEAT_DATA { custom_mode: 0, mavtype: MAV_TYPE_CAMERA, autopilot: MAV_AUTOPILOT_INVALID, base_mode: (empty), system_status: MAV_STATE_STANDBY, mavlink_version: 3 })

What am I missing here?

joaoantoniocardoso commented 1 month ago

Hi @phuesler,

Yeah, the exactly thing you are missing is to ask for mavproxy for an exclusive endpoint for mavlink camera manager.

./Tools/autotest/sim_vehicle.py -v ArduCopter --mavproxy-args --out=tcpin:0.0.0.0:5777

(note that here I'm using 0.0.0.0, which will allow incoming connections from any network. Feel free to use anything more restrictive, like 127.0.0.1)

and then:

./mavlink-camera-manager-linux-desktop --verbose --mavlink-system-id 1 --mavlink tcpout:127.0.0.1:5777

(note that I'm using 127.0.0.1 here because I'm assuming they are both running in the same machine)

I hope this helps, thanks!

joaoantoniocardoso commented 1 month ago

Oh, just to be clear:

phuesler commented 1 month ago

Thanks for your quick reply and for taking the time.

Unfortunately I see still the same behavior, issuing the above commands.

If it helps, I see this in the SITL console:

COMMAND_ACK: REQUEST_CAMERA_INFORMATION: UNSUPPORTED