Code from Simulink Coder inside ROS

1 view (last 30 days)
Milos Solaja
Milos Solaja on 22 Feb 2021
Edited: Milos Solaja on 22 Feb 2021
Hello,
currently I am working on a project where I should use Simulation from Simulink as C++ code and integrate it in ROS (robot OS). The idea is to have system that solves some diff. equations and the solutions should be used as input values for a mobile robot. With these values, for example, acceleration of a motor can be precisely calculated and the possible overheating prevented. First what I am trying to do is to modify code so it is able to first add input values with cin each time before simulation starts and return results with cout after that in terminal. Later it should be modified so that it automaticaly works. However, I am using macos and currenlty I am not even able to build and run code from Simulink Coder on my pc with xcode. I am also not sure how to solve this with cin and cout. Could someone tell me what target I should use since I am doing this on mac but later I will switch to Linux because implementation in ROS requires that, and how to get main function as well automaticaly generated? If there is no way to do that, then could someone post an example how main function should look like?
Thank you very much for your time and I will appreciate any kind of help.
Milos

Answers (0)

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!