Hello,
I’m trying to set up a Python script to drive the BlueROV2 in response to inputs from an experimental haptic controller but am getting weird outputs to the MANUAL_CONTROL messages. My understanding is that the axes you can control in the message are as follows:
- x = pitch
- y = roll
- z = forward/reverse
- r = yaw
However, whichever of these axes I set (and make the others 0) only the 4 vertical thrusters spin up. I cannot get the other thrusters to move at all. I am using the heavy configuration of the ROV so don’t know if this has to be specified anywhere in the parameters or if the different thruster setup on the heavy changes how I should use this message. I have set the heavy frame in QGC which I assume means it is set on the ROV but I could have misunderstood this?
Any advice would be appreciated. I’ve copied my code (basically stitched two examples together) below.
from pymavlink import mavutil
master = mavutil.mavlink_connection('udpin:0.0.0.0:14550')
master.wait_heartbeat()
print("Connected!")
# Arm
# master.arducopter_arm() or:
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)
# wait until arming confirmed (can manually check with master.motors_armed())
print("Waiting for the vehicle to arm...")
master.motors_armed_wait()
print('Armed!')
master.mav.manual_control_send(
master.target_system,
100,
0,
0,
0,
0)
master.wait_heartbeat()
# Disarm
# master.arducopter_disarm() or:
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)
# wait until disarming confirmed
print("Waiting for the vehicle to disarm...")
master.motors_disarmed_wait()
print('Disarmed!')