gsilano / CrazyS

CrazyS is an extension of the ROS package RotorS, aimed to modeling, developing and integrating the Crazyflie 2.0
Apache License 2.0
160 stars 84 forks source link

Confusing Behavior of Internal Model Controller #62

Closed alvinsunyixiao closed 3 years ago

alvinsunyixiao commented 3 years ago

I have just setup the environment and started running some small tests.

First of all, I ran into similar issue as described in #43, where I simply changed the target from (0, 0, 1) to (1, 1, 1) and it just does not work.

It is mentioned in #51 that crazyflie2_internal_model_controller.launch is working correctly. I gave that a shot, but when I changed the position_final in rotors_gazebo/resources/spline_trajectory.yaml from {x: 0, y: 0, z: 1} to {x: 1, y: 1, z: 1}, the drone still take off and stabilize around (0, 0, 1). I also see the debug printout consistently showing position errors on the X and Y axis.

Is there anything I could be missing?

welcome[bot] commented 3 years ago

Thanks for opening your first issue here! Make sure that no other issues on the same topic have already been opened!

gsilano commented 3 years ago

Hi @alvinsunyixiao! First of all, thank you for this interesting question. I'm aware that both the position_controller.cpp and crazyflie2_internal_model_controller.cpp do not work well when changing the reference position from (0,0,1) (i.e., hovering example) to (1,1,1) or any other point in the 3D space. As you can see from the referred issues or any other issue in the issue tracker, the package was not meant to provide a good controller for the Crazyflie 2.0 nano-quadrotor. The main idea behind it was to have a simulator for the Crazyflie 2.0, which is a valuable tool before performing real experiments.

Unfortunately, I don't have much time to investigate what is wrong. But, if you could help out, I would happy to help you. We may also provide a new control law for the aircraft by asking people at Bitcraze to include it in one of the next firmware releases.

I think this could be easily fixed by tuning the gains of the controller. However, I cannot rule out the presence of instability issues.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.