run Simulink block on host computer in external mode

3 views (last 30 days)
Hello,
I am working with a LEGO robot using the "Simulink Support Package for LEGO MINDSTORMS EV3 Hardware". I want to publish LEGO sensors' data to a ROS topic. If I use the normal mode, the robot is not working but I can publish to topic. If I use the external mode, I have the following error: "slros_initialize.h: No such file or directory". Both problems seems normal to me. In normal mode, there is no code sent to the EV3. In external mode, the EV3 has to publish to topic but I don't think there is a ROS support. Is it possible to exclude the subsystem that publishes to topic from code generation in order to run it only on the host computer (like scopes that run on the host computer even on external mode)?
I would be very grateful if someone can help me :)

Answers (1)

MathWorks Robotics and Autonomous Systems Team
Hi Arda
If the EV3 can be treated as a generic Linux (which has the ROS installed on it), then you can use ROS codegen capabilities in External Mode with EV3.
NOTE: You need to have ROS installed on EV3 to have ROS deployment (or external mode) to work.
Able to generate code with ROS: https://www.mathworks.com/help/robotics/examples/generate-a-standalone-ros-node-from-simulink.html --> In this you need to setup the Hardware Implementation as stated for the External mode to work.
External mode with ROS: https://www.mathworks.com/help/robotics/ug/enable-external-mode-forrobotics-system-toolbox-models.html
If your EV3 is always connected to MATLAB (via some connection wifi/ethernet) then you can consider running ROS blocks in Robotics System Toolbox to work in Simulation. I.e., you can get the EV3 sensor data in Simulink and then publish it using ROS Publish block and monitor them using ROS Subscribe block -> Extract data (do some processing) and then visualize them -> Simulink Scopes.
Thanks
Robotics Team @ Mathworks

Categories

Find more on LEGO MINDSTORMS EV3 Hardware in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!