Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How to test that mavlink works? #445

Open
phuesler opened this issue Oct 22, 2024 · 3 comments
Open

Question: How to test that mavlink works? #445

phuesler opened this issue Oct 22, 2024 · 3 comments

Comments

@phuesler
Copy link

phuesler commented Oct 22, 2024

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:

  • A drone running a flight controller that speaks Mavlink. Or a sitl like ArduPilot sim_vehicle.py
  • mavproxy
  • mavlink-camera-manager
  • A GCS like QGroundControl

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
Copy link
Collaborator

joaoantoniocardoso commented Oct 22, 2024

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
Copy link
Collaborator

Oh, just to be clear:

  • The "master" 5760 TCP is the communication between the mavproxy and the autopilot.
  • The UDP 14550 is the default for GCS.
  • so we need an extra endpoint for MCM (5777 TCP, for example)

@phuesler
Copy link
Author

Thanks for your quick reply and for taking the time.

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

  • mavlink-camera-manager is sending mavlink messages to mavproxy who sends it to the autopilot?
  • mavlink-camera-manager is broadcasting its mavlink heartbeats announcing its camera?
  • Does QGroundControl send the camera related messages to ArduPilot and not mavlink-camera-manager directly?
  • What is the expected behavior in QGroundControl when it 'works'?

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

COMMAND_ACK: REQUEST_CAMERA_INFORMATION: UNSUPPORTED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants