Skip to Content
Mastering ROS for Robotics Programming - Second Edition
book

Mastering ROS for Robotics Programming - Second Edition

by Lentin Joseph, Jonathan Cacace
February 2018
Beginner
580 pages
13h 20m
English
Packt Publishing
Content preview from Mastering ROS for Robotics Programming - Second Edition

Starting with ROS topics and MATLAB callback functions

In this section, we will discuss how to publish and subscribe ROS messages using MATLAB scripts. The first script that we analyze defines a typical template to develop the control loop of our robot. Firstly, we will subscribe to an input topic, and, successively, we will republish its value on an output topic for a certain amount of time. The complete source code is contained in the talker.m, in the code provided with the book, or  you can clone the following Git repository:

$ git clone https://github.com/jocacace/ros_matlab_test

Let's see the content of the talker.m script:

ros_master_ip = 'http://192.168.1.5:11311'; matlab_ip = '192.168.1.13'; rosinit(ros_master_ip, 'NodeHost', matlab_ip); ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering ROS for Robotics Programming - Third Edition

Mastering ROS for Robotics Programming - Third Edition

Lentin Joseph, Jonathan Cacace
Effective Robotics Programming with ROS - Third Edition

Effective Robotics Programming with ROS - Third Edition

Luis Sanchez, Enrique Fernandez Perdomo, Anil Mahtani

Publisher Resources

ISBN: 9781788478953Supplemental Content