Source-linked AI summary

Extending the OpenAI Gym for robotics: a toolkit for reinforcement learning using ROS and Gazebo

Iker Zamora, Nestor Gonzalez Lopez, Victor Mayoral Vilches, Alejandro Hernandez Cordero

arXiv:1608.05742v2cs.RO

TL;DR

Robotics reinforcement learning lacks a controlled, standardized environment for comparing techniques, while real-robot trials are costly and time-consuming. This paper extends OpenAI Gym with ROS and Gazebo, creating a robotics toolkit that benchmarks algorithms under the same virtual conditions. In the reported Turtlebot benchmark, Sarsa reached cumulated rewards near 3500, compared with around 2500 for Q-Learning, within a highly discretized environment.

  • Problem

    Robotics benchmarking remains unresolved, while real-robot reinforcement-learning trials impose high economic and time costs.

  • Method

    The paper integrates OpenAI Gym, ROS, and Gazebo, then benchmarks Q-Learning and Sarsa in the same Turtlebot simulation environment and hyperparameter setting.

  • Results

    Sarsa obtained cumulated rewards near 3500, while Q-Learning obtained around 2500 in the Turtlebot benchmark.

  • Takeaways & Limitations

    The toolkit provides a controlled virtual benchmarking system for comparing robotics reinforcement-learning techniques.

  • Takeaways & Limitations

    The benchmark uses only five integer LIDAR readings sampled from a 270° horizontal field of view in a highly discretized environment.

Abstract

from arXiv · show

This paper presents an extension of the OpenAI Gym for robotics using the Robot Operating System (ROS) and the Gazebo simulator. The content discusses the software architecture proposed and the results obtained by using two Reinforcement Learning techniques: Q-Learning and Sarsa. Ultimately, the output of this work presents a benchmarking system for robotics that allows different techniques and algorithms to be compared using the same virtual conditions.

Introduction

The paper addresses the need for controlled, API-consistent robotics benchmarking by extending OpenAI Gym with simulation and ROS-based integration. It targets comparable evaluation of robotic reinforcement-learning techniques.

  • Robotics reinforcement learning can design sophisticated behaviors, but requires simple environments for validation before real-world application.
  • OpenAI Gym provides an episodic reinforcement-learning structure focused on maximizing expected total reward and achieving acceptable performance quickly.The proposed work follows Gym’s baseline structure while adding robotics-oriented infrastructure.
  • The toolkit combines the Gym API with ROS and Gazebo to support reinforcement-learning validation using robotic hardware and simulation.Gazebo supplies 3D modeling and rendering, while ROS provides libraries and tools for robot applications.
  • The work aims to provide a controlled, well-defined API environment for comparing robotics techniques and speeding robotic-solution development.

Background

The background motivates simulation-based robotics reinforcement learning because real-robot trials are costly, time-consuming, and potentially dangerous. Prior approaches combine simulated learning with real-world information through mental rehearsal.

  • Robotics reinforcement learning is used to learn difficult-to-code behaviors and optimize problems without accepted closed-form solutions.
  • High per-trial economic and time costs are a central problem when training reinforcement-learning systems in robotics.
  • Gazebo-based simulation helps address robotics-training difficulties by saving costs, reducing time, and speeding simulation.
  • Mental rehearsal combines simulated learning with real-world information so the simulated environment can better reflect reality before policy transfer.

Architecture

The proposed architecture connects OpenAI Gym, ROS, and Gazebo into a robotics simulation stack with Gym-like APIs and modifiable environment assets. ROS mediates interaction between Gym environments and Gazebo.

  • Architecture: The architecture has three main software blocks: OpenAI Gym, ROS, and Gazebo.ROS connects Gym environments to Gazebo, which provides physics, graphics, and programmatic and graphical interfaces.
  • Architecture: Gazebo requires a robot definition, such as a URDF, to simulate the robot.The provided passages identify URDF as Unified Robot Description Format.
  • Architecture: Every robot is required to interface with ROS to maintain an organized architecture.
  • Architecture: The toolkit retains OpenAI Gym-like APIs and adds a gazebo environment collection containing environments, assets, and installation files.The installation files are organized to make the infrastructure easier for end users to modify.
  • Architecture: The architecture includes ROS packages for robots and may include an autopilot such as APM, whose robots require a specific ROS/Gazebo communication plugin.

Environments and Robots

The toolkit provides six simulated environments for three robots, with environments pairing a robot and a world while exposing only the environment abstraction. These include Turtlebot circuits and mazes, Erle-Rover obstacle-avoidance mazes, and Erle-Copter office scenarios using LIDAR.

  • The toolkit contains six environments for Turtlebot, Erle-Rover, and Erle-Copter, with each environment pairing a robot and a world.
  • Turtlebot: Turtlebot has four available LIDAR environments: two circuits, a complex maze, and an oval-shaped circuit.
  • Turtlebot: The Turtlebot environments vary in difficulty through features such as diagonal walls, 90-degree turns, narrow tracks, and different wall shapes.
  • Erle-Rover: The Erle-Rover environment is a large maze with wide tracks and 90-degree left and right turns for obstacle-avoidance learning.
  • Erle-Copter: The Erle-Copter environment is an ErleRobotics office without a ceiling, where the robot learns to avoid obstacles.

Results

The toolkit benchmarks Q-Learning and Sarsa under identical Turtlebot, LIDAR, Gazebo, and hyperparameter conditions. Q-Learning learns faster, while Sarsa reaches higher maximum cumulated rewards and smoother behavior.

  • Benchmark setup: The Turtlebot simulation runs at about 60RTF without visualization and 30RTF with the visual interface.Benchmarks use an i7 6700 CPU and non-GPU laser mode.
  • Benchmark setup: The benchmark uses GazeboCircuit2TurtlebotLIDAR-v0, a straight circuit with five right turns and one left turn, using only LIDAR input.Both algorithms use the same hyperparameters and exact environment.
  • Reward and action design: The environment rewards forward motion with 5, turns with 1, and crashes with -200.Forward actions receive more reward to encourage straight-track behavior, while crash penalties discourage obstacle collisions.
  • Q-Learning: Q-Learning uses α = 0.2, γ = 0.9, and ϵ = 0.9 with epsilon decay to a minimum of 0.05.The experiments run for 3000 episodes, with up to 1500 iterations per episode.
  • Sarsa and comparison: Sarsa produces decent results after 1600 episodes, while its smoother behavior reaches values near 3500 compared with around 2500 for Q-Learning.The authors attribute the higher Sarsa maximum rewards to exploiting forward actions on straight tracks; running more Sarsa episodes is expected to increase average rewards.
  • Q-Learning: Q-Learning produces decent results after 2500 episodes, with cumulated rewards around 2000 or higher indicating no crash or more than two laps.The Q-Learning experiment covers 3000 episodes.
  • Sarsa and comparison: Q-Learning learns faster than Sarsa, but it takes riskier turns close to walls; Sarsa exhibits smoother general behavior.The comparison links faster Q-Learning learning to its ability to learn while actions are selected randomly.
  • Interpretation: Both algorithms learn obstacle avoidance despite high variance in the monitored reward plots.The environment uses only five uniformly sampled integer LIDAR readings, making it highly discretized.

Future directions

The toolkit could be extended by broadening robot and autopilot support, accelerating autopilot simulation, increasing environment–agent flexibility, and adding comparison tools.

  • The toolkit could support additional autopilot solutions, including PX4 and Paparazzi, beyond APM.
  • Simulation for robots using autopilots could be accelerated because the current implementation runs at normal, real-time speed.
  • Separating environments from agents would allow different robots to be tested in environments not built specifically for them.
  • The toolkit could provide additional tools for comparing algorithms and recommendations or results for mental rehearsal.
Loading 1608.05742v2…