I am also planning to integrate Acados into ROS so that I can subscribe to sensor data and publish control signals of MPC for driving F1/10 car. So, when I am exporting C code, does ROS part interfere?
Does Acados work with ROS?
Hi @nirajbas94,
Admittedly, I didnât user ROS myself yet.
But I know that it was used in at least two applications already.
Here, the generated C code was embedded into a ROS node.
This embedding into a ROS node is done outside of acados.
It would be great to document the workflow somehow in acados itself.
@tmmsartor knows much more about this.
One application that uses acados through ROS has a public Github repo:
Best,
Jonathan
Hi Jonathan,
I have implemented MPC in acados using python 3.7. However I have ROS working with python 2.7 and it doesnât support python 3.7 to the best of my knowledge. I was wondering if you have any workflow on how to use complied code of acados in python 2.7? Even simple guidelines would be helpful.
On top of that for embedded implementation on real robot, I would also like to use complied code from acados in c++. Please let me know if you have any guidelines for this as well.
Regards,
Jay
He
Does âitâ mean ROS here?
I am quite sure there are people using ROS with Python 3, e.g.
https://medium.com/@beta_b0t/how-to-setup-ros-with-python-3-44a69ca36674
For porting your example to a C++ framework, please check out the files in c_generated_code
.
It contains a main*.c
file, and a Makefile that shows how to compile and link it against the shared libaries.
You can adapt the main file or perform similar calls to acados in your C++ code.
Best
Jonathan
Hi Jonathan,
yes I meant ROS doesnât work with Python 3.7
I tried this and several other guidelines on how to compile ROS packages for Python 3 but itâs not enough in my case as there are several other package not mentioned in this blog that are used by me and they canât be readily compiled for Python 3.
Maybe this is my only option. Thanks again for your support!
Cheers,
Jay
@jay101 have you looked at the ROS crazyflie_controller node source code of the bcbarbara/crazyflie_nmpc repo? It is an excellent starting point on how to get an Acados controller running with ROS and C++.
I will be glad to help if you run with any issue after checking that repo.
Cheers!
Hi Guido,
I am following this repo to interface ROS and C++. If I run into any issues I will certain get in touch with you. Thanks a lot for extending your kind help!
cheers,
Jay
Hello Guido Sanchez,
I am trying to run the project by following the wiki of your recommended repo.
My first issue is that I am unable to successfully install the old version of t_renderer
. I replaced the old acados package in the code with the new version of acados (which can automatically install t_renderer). So this problem is solved (I think).
Currently, the problem is: I attempted to run the code generation Python file: python3 generate_c_code.py
, but it resulted in an error NameError: name 'acados_ocp_nlp' is not defined
.
Does this mean the syntax is outdated? If does, I donât know if there is a ânew starting pointâ for me to learn ACADOS with ROS.
Best,
Shawn
Hi @Shawn
I looked into the ROS repo you linked to and it is using a very outdated version of acados.
This should allow you to use recent acados with that repo:
Cheers!