Skip to content

An example on how to launch and publish custom messages to ROS nodes through MATLAB.

License

Notifications You must be signed in to change notification settings

ichatzinikolaidis/ros_matlab_interface_example

Repository files navigation

How to launch ROS nodes and publish custom ROS messages via MATLAB

This is a kinda hackey way to launch ROS nodes inside MATLAB during development, if you don't want to constantly switch to terminal...

Requirements

Please ensure you have configured the following first:

  1. Install the ROS Toolbox.

  2. Install ROS Custom Message Support through Add-Ons.

  3. Build the package inside the catkin_ws folder, e.g. by running catkin build.

  4. Follow this guide to generate the messages so that we can populate them in MATLAB. Essentially, you need to run rosgenmsg('custom_msgs'), paste the output lines to javaclassspath.txt, and restart MATLAB.

These steps need to be performed once only.

Afterwards, check the file ros_matlab_example.m for a concrete example, making sure that everything is in MATLAB's PATH before running the script.

Extra notes

  • The demonstrated example is a hopper robot where we set a sinusoidal base motion and visualize it in rviz.

  • The robot model is included in the xpp package.

  • The process was tested on MATLAB R2019b.

About

An example on how to launch and publish custom messages to ROS nodes through MATLAB.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published