# Using Pymavlink + ArduSub + ros\_playground

**URL:** <https://discuss.bluerobotics.com/t/using-pymavlink-ardusub-ros-playground/7338>\
**Category:** Blue Robotics Software\
**Tags:** sitl, simulate\
**Created:** [May 7, 2020, 5:24pm UTC](https://discuss.bluerobotics.com/t/using-pymavlink-ardusub-ros-playground/7338 "2020-05-07T17:24:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DJ95](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@DJ95](https://discuss.bluerobotics.com/u/DJ95)\
**Post date:** [May 7, 2020, 5:24pm UTC](https://discuss.bluerobotics.com/t/using-pymavlink-ardusub-ros-playground/7338/1 "2020-05-07T17:24:48Z")

</div>

Hi there,

At this point, I’m able to run sim\_vehicle.py (from Ardupilot) and launch Gazebo\_sitl file to move around the bluerov in the simulation environment.  
Using the “mavros/rc/override” topic, I can send low level thruster commands as well.  
My goal is to have rostopic “mavros/rc/override” and not the other ones, I think this can be achieved with a custom pymavlink script,

This is the custom script that I have till now, I’m missing out something fundamental here, but don’t know what. Please help me out.

```
#!/usr/bin/env python

import rospy
from mavros_msgs.msg import OverrideRCIn
from pymavlink import mavutil

master = None

def rc_callback(data):
	global master
	pwm = [data.channels[0], data.channels[1], data.channels[2], data.channels[3], data.channels[4], data.channels[5], data.channels[6], data.channels[7]] 
	master.mav.rc_channels_override_send(master.target_system, master.target_component, *pwm)

if __name__ == ' __main__':

	rospy.init_node('custom_mavlink_interface')
	rospy.Subscriber("mavros/rc/override", OverrideRCIn, rc_callback)

	master = mavutil.mavlink_connection('tcp:127.0.0.1:5760')
        master.wait_heartbeat()
        print("connected")
	rospy.spin()

```

---

<div class="post-metadata">

**Author:** ![patrickelectric](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/patrickelectric/32/2162_2.png) [@patrickelectric](https://discuss.bluerobotics.com/u/patrickelectric)\
**Post date:** [May 7, 2020, 9:42pm UTC](https://discuss.bluerobotics.com/t/using-pymavlink-ardusub-ros-playground/7338/2 "2020-05-07T21:42:02Z")

</div>

Hi @DJ95,

I’m not sure if this is the problem, but you are missing a ‘/’ in your topic name, it should be: `/mavros/rc/override`
