Skip to Content
Hands-On ROS for Robotics Programming
book

Hands-On ROS for Robotics Programming

by Bernardo Ronquillo Japón
February 2020
Intermediate to advanced
432 pages
10h 50m
English
Packt Publishing
Content preview from Hands-On ROS for Robotics Programming

Producing your source code

The mygopigo folder is ready so that we can create the package structure and place the files:

  1. Create the src folder inside the package – note that this is a convention we use to standardize where the code is placed in repositories:
$ roscd mygopigo$ mkdir src$ cd src

The roscd ROS command is equivalent to the Linux bash cd command. Its advantage is that you only have to specify the package name in order to move to the package's folder, which is ~/catkin_ws/src/mygopigo/. Then, create a Python file to acquire data from the distance sensor:

$ nano distance-sensor.py
  1. Copy and paste the following lines globally inside the file:
#!/usr/bin/env python# import the modulesfrom di_sensors.easy_distance_sensor import ...
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

Mastering ROS for Robotics Programming

Lentin Joseph
ROS Robotics By Example - Second Edition

ROS Robotics By Example - Second Edition

Lentin Joseph, Carol Fairchild, Dr. Thomas L. Harman

Publisher Resources

ISBN: 9781838551308Supplemental Content