alireza787b / mavsdk_drone_show

All in one Drone Show and Smart Swarm Solutin for PX4
86 stars 22 forks source link

Offboard command issue #10

Closed arnaudjuin closed 8 months ago

arnaudjuin commented 8 months ago

Hi I am encountering the following issue when I try to use offboard_from_csv.py

Screenshot 2023-10-25 at 15 34 13

Do you have any idea what could be wrong ?

Thank you.

alireza787b commented 8 months ago

Thank you for reaching out. Based on the screenshot you provided and the error, it seems you're encountering an issue related to acceleration commands in the MAVSDK.

Update MAVSDK: Ensure you're using the latest version of MAVSDK. The acceleration commands might not be supported in older versions.

Modify the Code: If you prefer not to update MAVSDK, you can make changes to the code:

        # set_position_velocity_acceleration_ned is not yet available
        # in the default build for MAVSDK-Python Installation with pip3
        # If you need to input acceleration,
        # you should build MAVSDK for yourself.
        await drone.offboard.set_position_velocity_ned(
            PositionNedYaw(*position, current_waypoint[10]),
            VelocityNedYaw(*velocity, current_waypoint[10])
        )
        # await drone.offboard.set_position_velocity_acceleration_ned(
        #     PositionNedYaw(*position, current_waypoint[10]),
        #     VelocityNedYaw(*velocity, current_waypoint[10]),
        #     AccelerationNed(*acceleration, current_waypoint[10])
        # )

I would recommend Use the Official Example I've added as new example in the official MAVSDK Python repository named "offboard from csv". https://github.com/mavlink/MAVSDK-Python/tree/main/examples/offboard_from_csv

You can use that example as it's designed to work with the latest MAVSDK version and should not have this issue.

I hope this helps! Let me know if you have any further questions.

arnaudjuin commented 8 months ago

Works like a charm.

Thanks you so much.

Arnaud