Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On ROS for Robotics Programming

You're reading from   Hands-On ROS for Robotics Programming Program highly autonomous and AI-capable mobile robots powered by ROS

Arrow left icon
Product type Paperback
Published in Feb 2020
Publisher Packt
ISBN-13 9781838551308
Length 432 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Bernardo Ronquillo Japón Bernardo Ronquillo Japón
Author Profile Icon Bernardo Ronquillo Japón
Bernardo Ronquillo Japón
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Section 1: Physical Robot Assembly and Testing
2. Assembling the Robot FREE CHAPTER 3. Unit Testing of GoPiGo3 4. Getting Started with ROS 5. Section 2: Robot Simulation with Gazebo
6. Creating the Virtual Two-Wheeled ROS Robot 7. Simulating Robot Behavior with Gazebo 8. Section 3: Autonomous Navigation Using SLAM
9. Programming in ROS - Commands and Tools 10. Robot Control and Simulation 11. Virtual SLAM and Navigation Using Gazebo 12. SLAM for Robot Navigation 13. Section 4: Adaptive Robot Behavior Using Machine Learning
14. Applying Machine Learning in Robotics 15. Machine Learning with OpenAI Gym 16. Achieve a Goal through Reinforcement Learning 17. Assessment 18. Other Books You May Enjoy

Running the simulation and plotting the results

To run this simulation scenario, we follow the standard approach of first launching a Gazebo environment—part of the cartpole_description package with the model of the robot—and, afterward, we will start the training process:

T1 $ roslaunch cartpole_description main.launch

The result in the Gazebo window should be similar to the following screenshot. Although this is a 3D environment, the model itself behaves like a 2D model, since the cart pole can only slide along the direction of the guide:

For the training process, we have the launch file in the other ROS package, that is, cartpole_v0_training:

T2 $ conda activate gym
T2 $ (gym) roslaunch cartpole_dqn start_training.launch

Be aware that before running the launch file, you have to activate the gym Python environment, which is where you installed OpenAI Gym.

You...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime