dronekit / dronekit-python

DroneKit-Python library for communicating with Drones via MAVLink.
https://readthedocs.org/projects/dronekit-python/
Apache License 2.0
1.5k stars 1.42k forks source link

condition_yaw does not work in python #1179

Open kazmifactor opened 1 year ago

kazmifactor commented 1 year ago

I am using the following function in python. Whenever I pass the paramters it does not work. other functions like arm_and_takeoff, set_velocity_body does work. So, there is nothing wrong with the integration of hardware and software.

If i want to yaw towards left for 30 degrees localy. i pass condition_yaw(30, -1, 1) or if i want to yaw 10 degrees to the right i pass condition_yaw(10, 1, 1),

If anyone have any idea what i am doing wrong, or if this is an issue with the function. pls do let me know.

def condition_yaw(heading, direction, relative):
    msg = vehicle.message_factory.command_long_encode(
        0, 0,  # target system, target component
        mavutil.mavlink.MAV_CMD_CONDITION_YAW,  # command
        0,  # confirmation
        heading,  # param 1, yaw in degrees
        0,  # param 2, yaw speed deg /s
        direction,  # param 3, direction -1 ccw, 1 cw
        relative,  # param 4, relative offset 1, absolute angle 0
        0, 0, 0)  # param 5 ~ 7 not used
    # send command to vehicle
    vehicle.send_mavlink(msg)
Chepa14 commented 1 year ago

@kazmifactor Did you find a solution? I stuck with the same problem...