run Simulink block on host computer in external mode

4 views (last 30 days)
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: --> In this you need to setup the Hardware Implementation as stated for the External mode to work.
External mode with ROS:
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.
Robotics Team @ Mathworks


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!