Hi, I cannot move servo or send data to my pixhawk.
I can control my pixhawk via RC. I tried to set pixhawk's mode to "Guided, Stabilize, auto, manuel, FBWA" non of them worked.
there is my code:
from pymavlink import mavutil
from pymavlink.dialects.v20 import common as mav_msgs
import os
os.environ["MAVLINK20"] = "1"
mavutil.set_dialect("common")
# Start a connection listening on a UDP port
pixhawk = mavutil.mavlink_connection("COM6", baud=115200, dialect="common")
pixhawk.wait_heartbeat()
print("Heartbeat from system (system %u component %u)" % (pixhawk.target_system, pixhawk.target_component))
while True:
pixhawk_msg = pixhawk.recv_match()
if isinstance(pixhawk_msg, mav_msgs.MAVLink_servo_output_raw_message):
print(pixhawk_msg)
pixhawk.mav.command_long_send(
pixhawk.target_system, pixhawk.target_component,
mavutil.mavlink.MAV_CMD_DO_SET_SERVO,
0, # first transmission of this command
10, # servo instance, offset by 8 MAIN outputs
1200, # PWM pulse-width
0,0,0,0,0 # unused parameters
)
Hi, I cannot move servo or send data to my pixhawk. I can control my pixhawk via RC. I tried to set pixhawk's mode to "Guided, Stabilize, auto, manuel, FBWA" non of them worked.
there is my code:
And the output: