Skip to Content
ROS Programming: Building Powerful Robots
book

ROS Programming: Building Powerful Robots

by Anil Mahtani, Luis Sanchez, Enrique Fernandez, Aaron Martinez, Lentin Joseph
March 2018
Intermediate to advanced content levelIntermediate to advanced
1396 pages
42h 14m
English
Packt Publishing
Content preview from ROS Programming: Building Powerful Robots

Connecting to rosbridge_server

The whole initialization of this project is written inside a single function called init(). Let's take a look at all the things inside this function.

The first part of the code connects to rosbridge_server if it is running. The following code snippet does this:

        var ros = new ROSLIB.Ros({ 
          url : 'ws://localhost:9090' 
        }); 

As you can see, we are creating an object of ROSLIB.Ros for communicating with rosbridge_server. When this code runs, it will connect to rosbridge_server, which is listening on ws://localhost:9090. Instead of running both on the same system, we can provide the IP address of the system that is running ROS and rosbridge_server.

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

Programming Robots with ROS

Programming Robots with ROS

Morgan Quigley, Brian Gerkey, William D. Smart
Machine Learning Design Patterns

Machine Learning Design Patterns

Valliappa Lakshmanan, Sara Robinson, Michael Munn

Publisher Resources

ISBN: 9781788627436Supplemental Content