# Autonomous rover using mavlink

**URL:** <https://discuss.px4.io/t/autonomous-rover-using-mavlink/46014>\
**Category:** PX4 Autopilot\
**Created:** [June 14, 2025, 11:18am UTC](https://discuss.px4.io/t/autonomous-rover-using-mavlink/46014 "2025-06-14T11:18:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexDragos](https://discuss.px4.io/letter_avatar_proxy/v4/letter/a/a3d4f5/32.png) [@AlexDragos](https://discuss.px4.io/u/AlexDragos)\
**Post date:** [June 14, 2025, 11:18am UTC](https://discuss.px4.io/t/autonomous-rover-using-mavlink/46014/1 "2025-06-14T11:18:46Z")

</div>

Greetings everyone!

I’m trying to make a rover-type robotic platform move autonomously using a Python program.  
My setup is as it follows:

- transmitter: Radiomaster TX16S with RFD TX-MOD v.2
- receiver: RFD 900ux 2.0
- a rover with 2 stepper motors
- QGroundCotrol for mission command
- Raspberry Pi 5 for automatization

At the moment, I can control the platform in MANUAL mode using the RadioMaster TX16S remote control. Thanks to the Wi-Fi module built into the TX-MOD, I can connect via UDP to the QGC and see the telemetry data. I made a Python program to test the Pixhawk 4 - RPi connection and move the platform for 5 seconds. I will leave the code I used at the end of this post. I used pymavlink for this.

The main problem that arises is that when the remote control is turned on, the rover no longer receives movement commands, but only arms/disarms. If I turn off the remote control, the program arms the pilot, moves the rover and then disarms the pilot.  
The main idea is that I would like to have both options simultaneously. When I run the program on the RPi, it should take over the rover command, execute the movements and then return to manual mode with control from the remote control.

I also tried with OFFBOARD mode, but in that case it doesn’t go into OFFBOARD mode, because the offboard signal is not detected.  
I would like help from someone more experienced in this niche or some advice on what I’m doing/not doing right.

Thanks a lot in advance!

P.S. : To understand a little bit of the logic behind the code, I need to mention something else. RadioMaster sends a PPM signal via External RF to the RFD900ux and further to the pilot via the PPM RC port, and further the pilot outputs the signal via the S-BUS out port to the rover’s CPU (it only accepts S-BUS or I-BUS), thus producing the movement. Link for more detailed description: [S-BUS OUT port on Pixhawk 4](https://discuss.px4.io/t/s-bus-out-port-on-pixhawk-4/43344)

> from pymavlink import mavutil  
> import time
> 
> #MAVLink connection  
> master = mavutil.mavlink\_connection(‘/dev/ttyACM0’, baud=57600)  
> master.wait\_heartbeat()  
> print(“Connected to the system”)
> 
> #Arming  
> master.mav.command\_long\_send(  
> master.target\_system, master.target\_component,  
> mavutil.mavlink.MAV\_CMD\_COMPONENT\_ARM\_DISARM,  
> 0, 1, 0, 0, 0, 0, 0, 0)  
> print(“Arm”)  
> time.sleep(2)
> 
> #Send PWM directly to the servos (1000-2000us)
> 
> for i in range(50):  
> master.mav.servo\_output\_raw\_send(  
> 0, 0,  
> 1500, # MAIN1 - Neutral steering  
> 0, # MAIN2 - Disabled  
> 1600, # MAIN3 - Throttle slightly forward  
> 0, 0, 0, 0, 0  
> )  
> print(“PWM command sent”)  
> time.sleep(0.1)
> 
> #Automatic disarming after test  
> master.mav.command\_long\_send(  
> master.target\_system, master.target\_component,  
> mavutil.mavlink.MAV\_CMD\_COMPONENT\_ARM\_DISARM,  
> 0, 0, 0, 0, 0, 0, 0, 0)  
> print(“Disarm”)

---

<div class="post-metadata">

**Author:** ![system](https://discuss.px4.io/uploads/default/original/3X/7/3/73ce918bdcd64854de904f0c8d9ab70ca9723f2a.png) [@system](https://discuss.px4.io/u/system)\
**Post date:** [September 12, 2025, 11:19am UTC](https://discuss.px4.io/t/autonomous-rover-using-mavlink/46014/2 "2025-09-12T11:19:01Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
