ethz-asl / mav_control_rw

Control strategies for rotary wing Micro Aerial Vehicles using ROS
Apache License 2.0
352 stars 160 forks source link

drift off/diverge when yaw 90 degree #30

Closed fx815 closed 5 years ago

fx815 commented 5 years ago

Hi! I am using the nonlinear MPC on a small drone controlled by Betaflight. I use RC signal to control the attitude and use vicon to estimate odometry. I did the system ID and some dynamic tuning and it hovers very accurately when have 0 degree yaw command. However, if I give command/pose a 90 degree yaw orientation, it turns to 90 degree and begin to drift like a spiral, then it reaches a sort of stable status and loiters. It is very strange because I have used this MPC on Pixhawk and M100, and they all flies fine. Any ideas why this is happening? Thanks.

Best regards, Feng

fx815 commented 5 years ago

Found the issue. The linear and angular velocity should be in body frame in the odometry message. I used world.

caomuqing commented 5 years ago

thanks for this, it helped resolving my issue as well!