Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External MPC controller not working properly #111

Open
rakesh55ydv opened this issue Nov 19, 2024 · 2 comments
Open

External MPC controller not working properly #111

rakesh55ydv opened this issue Nov 19, 2024 · 2 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@rakesh55ydv
Copy link

Hello gsilano,
Thanks for you work in creating this wonderful models to work in SITL. I am facing several issues:

  1. I created an MPC controller in matlab to track a helical trajectory and it is working fine. However, when I publish the omega of the rotors in the topic /crazyflie2/gazebo/command/motor_speed , it is not behaving as it should be and model becomes unstable. I played with the rates of the controllers. However, it did not have any affect in the simulation.
  2. Therefore, I decided to use inbuilt position_controller_node.cpp by passing the states coming from my MPC controller in the topic called /crazyflie2/command/trajectory. The position controller node keeps the crazyflie stable, but it is very slow and could not track the trajectory I am publishing. I have kept the trajectory publishing rate fairly low.

Are there any suggestions on how can I make my external controller work ? How to use the inbuilt controllers in this scenario ?

Thanks,
rakesh55ydv

Copy link

welcome bot commented Nov 19, 2024

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

@gsilano gsilano self-assigned this Nov 19, 2024
@gsilano gsilano added the help wanted Extra attention is needed label Nov 19, 2024
@gsilano
Copy link
Owner

gsilano commented Nov 19, 2024

Hi @rakesh55ydv! I'm glad you found my work interesting.

Have you tried following the guide in the Wiki to connect MATLAB with Gazebo? This guide explains how to establish message exchange between the two. While more advanced solutions for synchronization exist today, the method described in the guide should suffice for initial testing.

If you continue to experience instability issues, the problem might lie in the parameters used for the MPC design not matching those in Gazebo. In this case, I recommend reviewing the following files:

The key point is to ensure consistency between the parameters used in your MPC and Gazebo simulations. If needed, you can modify these files to create a Crazyflie setup tailored to your needs.

Regarding the launch file, if it isn't included in the Wiki guide, I suggest creating an empty Gazebo world containing only the Crazyflie with the appropriate configuration settings. An example is provided in this launch file.

Lastly, when setting up your environment, ensure that the ROS version matches your system's configuration (e.g., Kinetic or Melodic for Ubuntu 18.04, or Noetic for Ubuntu 20.04). You can find a complete list of supported ROS releases in the README.md file.

I hope this helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants