I am using the webots_ros2_mavic package found here to simulate a drone in Webots. The drone is controlled by publishing a simple Twist message with linear and angular velocity components.

I noticed that when sending commands that are high speeds (such as a value of 5 or greater) to the linear velocity component of the Twist message, the drone tilts forwards when flying. As a result it starts descending/nosediving as it is also flying forwards. I understand that this also happens in real life with real drones.

Is there a way to eliminate this effect in given the code in this package? There is a file called mavic_driver.py in this package which implements a PID controller for the drone's movement. But I am not sure what (if anything at all) needs to be changed to achieve this effect.

I have tried tweaking some of the PID parameters in the mavic_driver.py file but I could not determine which ones, if any, need to be changed.

Setup: Ubuntu 22.04, ROS2 Humble, Webots 2023a



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.