I am able to establish a connection between my companion computer and a copter. It responds to ARM command but does not respond to MAV_CMD_CONDITION_YAW command.
# Turn relatively to 0
def turn(self, angle):
# Define the heading change in degrees (-180 to 180, negative for left)
left_turn_angle = angle # 90 degrees left turn
# Send MAV_CMD_CONDITION_YAW command to set the desired heading
self.connection.mav.command_long_send(
self.connection.target_system, # Target system ID
self.connection.target_component, # Target component ID
mavutil.mavlink.MAV_CMD_CONDITION_YAW, # Command ID
0, # Confirmation
left_turn_angle, # Desired heading in degrees
15, # Hold time (0 to continue indefinitely)
1, # Relative offset (1 for relative angle)
0, # Empty (ignored)
0, # Empty (ignored)
0, # Empty (ignored)
0, # Empty (ignored)
)
msg = self.connection.recv_match(type="COMMAND_ACK", blocking=True)
print(msg)
msg
returns {result: 0}
which means it is ok but drone does not turn. Is it something with Guided
mode? Because I fly in Stabilize or AltHold mode. It is not a mission, I manualy control a drone but it just dont turn