I can't seem to find what I'm looking for on the MAVProxy homepage and I'm still in process of looking through the source.
What do I send via MAVProxy for various RC controller override/emulation commands? I thought it would just be
"rc <channel> <value>"
but that doesn't seem to work? Could someone verify that is either incorrect or it is correct and there must be another error?
Thanks.
Edit: it was a different error, that was how it's used to control it.
Replies
Unfortunatley I couldn't find the code for MAVProxy but I found my code using MavUtil.
Because the code was for work, I can only show the initialization and the generic rc sending command. I truly hope it helps you resolve your issue. I'm sure this will be formatted poorly in the window but I hope it helps. If I recall correctly, sending 65535 gives command back to the controller, otherwise only rc_override commands will work.
import mavutil
master = mavutil.mavlink_connection("/dev/iris",115200)
master.wait_heartbeat()
master.mav.request_data_stream_send(master.target_system, master.target_component, mavutil.mavlink.MAV_DATA_STREAM_ALL, 1000, 1)
master.mav.rc_channels_override_send(master.target_system, master.target_component, 0, 0, 0, 0, 0, 0, 0, 0)
master.mav.rc_channels_override_send(master.target_system, master.target_component, 1549, 1462, 65535, 65535, 65535, 65535, 65535, 65535)
function msg_recv():
msg = master.recv_match(blocking=True)
if not msg:
return
msg_type = msg.get_type()
if msg_type == "BAD_DATA":
if mavutil.all_printable(msg.data):
sys.stdout.write(msg.data)
sys.stdout.flush()
elif msg_type == "HEARTBEAT":
state_msg_armed = msg.base_mode & mavutil.mavlink.MAV_MODE_FLAG_SAFETY_ARMED
state_msg_mode = mavutil.mode_string_v10(msg)
#print msg
elif msg_type == "GPS_RAW_INT":
#print(msg)
last_altitude = altitude
altitude = msg.alt/1e03
altitude_difference = altitude - last_altitude
elif msg_type == "ATTITUDE":
#msg.roll, msg.pitch, msg.yaw, msg.rollspeed, msg.pitchspeed, msg.yawspeed
if (msg.yawspeed > max_var):
max_var = msg.yawspeed
#print msg
elif msg_type == "RC_CHANNELS_RAW":
#print(msg)
------------------------------------------------------------
I did find this in a file though:
from pymavlink import mavutil
master = mavutil.mavlink_connection("/dev/ttyACM0", 115200)
master.mav.request_data_stream_send(master.target_system, master.target_component, mavutil.mavlink.MAV_DATA_STREAM_ALL, 1000, 1)
master.arducopter_arm()
#master.arducopter_disarm()
master.mav.rc_channels_override_send(master.target_system, master.target_component, 65535, 65535, 1200, 65535, 65535, 65535, 65535, 65535)
I don't know if it was working or not though. It would be on the old Raspberry Pi that's long gone now if it still existed but once MavProxy was working we started usint MavUtil. Hope it helps!
Like I said the problem was last July and I haven't touched it since. My best advice is to start over with a clean slate. Mine was easy to restart because it was a Raspberry Pi so reformatting was simple but if you're using a laptop, I know it's not so simple :| Not a promise, but I'll see if I can locate my python script that worked tomorrow for you.
I did, but my error was actually in mismatched versions of installed software. Granted this was almost a year ago. Not sure of how much help I could be :(