ROS simulink controller is slow

7 visualizaciones (últimos 30 días)
Nathaniel Goldfarb
Nathaniel Goldfarb el 28 de Mayo de 2021
Movida: Jagadeesh Konakalla hace alrededor de 7 horas
I am trying to build a controller in simulink to interact with ROS and custom simulation of my robot. The controller is rather complex, and involves communication with several topics.
When I try to publish the setpoints to the controller the controller runs very slowly to the point it cannot be used. Is there a way I can speed up the controller to make it run in real time? Should I be exported the code to C++ then tuning my model parameters from there? I know that this is very vague question, I apperate any help.
  3 comentarios
Nathaniel Goldfarb
Nathaniel Goldfarb el 29 de Mayo de 2021
I am using 2021a. I working on building the code now. working through some errors.
how much does the location of the message generation matter? I read around and it is there seems to be a performance increase by moving the static message generation outside the look.
Jagadeesh Konakalla
Jagadeesh Konakalla el 4 de Jun. de 2021
Hi,
Let me elaborate on my suggestion.
My understanding is that you are trying to publish messages from Simulink model in Simulation. This is because of necessary message conversions from Simulink but to MATLAB structure to ROS message.
Instead, i am suggesting you to try the code generation workflow. You can build and deploy code from simulink model and run the generated node in the ROS environment where your controller is running. This workflow is faster than the simulation workflow.
Let me know if this helps.
Jagadeesh K

Iniciar sesión para comentar.

Respuestas (1)

Nathaniel Goldfarb
Nathaniel Goldfarb el 4 de Jun. de 2021
Movida: Jagadeesh Konakalla hace alrededor de 7 horas
yes, I am trying to do that now. I am having a problem building and running the model. There is an issue with a custom ROS message. I am in a discussion here

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by