Hi,
I have tried some examples from the guide. But it doesn’t work.
-top side computer connected to raspberry pi via ethernet
-pixhawk connected to raspberry pi via usb
-I changed ip address of top side as “192.168.2.1”
-I’ve tried first example. (rebooting pixhawk)
import time
# Import mavutil
from pymavlink import mavutil
master = mavutil.mavlink_connection('udp:192.168.2.1:14550')
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, # target_system
master.target_component, # target_component
*rc_channel_values) # RC channel list, in microseconds.
set_rc_channel_pwm(2, 1600)
set_rc_channel_pwm(4, 1600)
set_rc_channel_pwm(8, 1900)
What could be the problem?