How To Send Mavlink Commands To SITL

Hello,

I am trying to figure out how I can send mavlink commands to my SITL environment.  I have SITL running on my linux mint VM and I have my own python code generated from mavgen.py which decoded the mavlink messages from SITL.

My SITL experiment is just a generic copter in a loop going to 5 different geo points.  I have a separate script that sends out LAND commands or SETMODE commands which does work on my real drone.  I am just trying to get my SITL environment to receive the commands.  I assume this can be done?

If I run netstat I see

tcp        0      0 0.0.0.0:5760            0.0.0.0:*               LISTEN      8644/arducopter-qua

tcp        0      0 0.0.0.0:5762            0.0.0.0:*               LISTEN      8644/arducopter-qua

tcp        0      0 0.0.0.0:5763            0.0.0.0:*               LISTEN      8644/arducopter-qua

tcp        0      0 127.0.0.1:5760          127.0.0.1:51175         ESTABLISHED 8644/arducopter-qua

udp        0      0 0.0.0.0:5501            0.0.0.0:*                           8644/arducopter-qua

udp        0      0 127.0.0.1:45278         127.0.0.1:5503          ESTABLISHED 8644/arducopter-qua

I am hoping I can just send the commands to one of those ports and I have tried UDP port 5501 and TCP port 5760 and none of them seem to work?

Am I doing something wrong, can this be done, I am hoping someone may have some advice for me as all I want to do is send real hand crafted mavlink commands to my SITL environment and it respond?

Thanks in advance,

Joe

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Hello,

    Could you get this working?

    I am trying to do something similar with PX4 SITL.

    Please let me know if it worked for you.

This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…