Hello
I’m working on the AUV. I am using Raspberry pi 3 B+ and pixhawk 4. I am trying the below code to start the engines but nothing is working. Can you help me with this?
from pymavlink import mavutil
import time
master=mavutil.mavlink_connection(’/dev/ttyACM0’,baund=115200)
master.wait_heartbeat()
def set_rc_channel_pwm(id,pwm=1500):
if id < 1:
print("Channel does not exist.")
return
if id < 9:
rc_channel_values = [65535 for _ in range(8)]
rc_channel_values[id - 1] = pwm
master.mav.rc_channels_override_send(master.target_system,master.target_component,*rc_channel_values)
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)
master.motors_armed_wait()
while True:
set_rc_channel_pwm(4,1600)