The VREP pioneer robot and a 2D laser scanner was programmed to navigate through an unknown environment and to a desired location while avoiding obstacles. The algorithm was written in C++ and used ROS to communicate to the robot. This was done by generating a million potential trajectories and choosing the one which would bring it closest to it's goal while still avoiding obstacles. In addition, an emergency break was implemented in case the robot came to close to an obstacle (this usually occurs if it chooses a potential trajectory outside the range of its sensor). Below is an outline of the process, and images of the environments in which the robot was tested.
Outline of Process:
*note: whenever the robot is moving, if any object is less than 20 cm in front of the robot an emergency brake is applied and the robot backs up about 10 cm and the algorithm jumps back to step 1 to recalculate a trajectory.
Orchard Environment
Random Trees Environment
The same process was repeated as above, except this time the algorithm stored previous scans of the environment in a global point cloud array. Each of the scans were added to each other in relation to some fixed point on the map, and, as a result, the robot formed a local map of the areas it had navigated through. This modification drastically minimizes the error of running into objects that the sensor cannot see in one scan, because now the optimal trajectories are chosen with much more information of the surroundings. Below are images of the resulting local maps produced.
After testing the algorithms on VREP, it was time to implement them in a real environment. A Create 2 iRobot was used with a Hokuyo URG Laser Scanner fixed on the top of it. The goal of this project was to create an application that allows the robot to autonomously navigate to a location when a point on a map is clicked. ROS was used to communicate with the robot, C++ was used to navigate the robot, and python was used for the GUI and path planner.
This project was broken into 4 major portions:
Create Robot with Hokuyo Sensor
The algorithms described above (producing random velocity vectors and choosing an optimal one) were implemented on the Create robot, using the create_autonomy package as a low level controller, and using the urg_node package to publish scan messages from the Hokuyo sensor . After this portion of the project, the robot could autonomously navigate from one point to the next without colliding into obstacles.
Instead of storing points in a global point cloud array as implemented in VREP, the slam_gmapping package was used to map an area while the robot was being manually controlled by teleop_twist_keyboard package, and the map was saved with the map_server package. After running the robot and manually mapping out a few hallways, it was apparent that there was loop closure problem with gmapping, which could be caused by slippage, create_autonomy odometry issues, or other random noise.
Example Loop Closure Problems
A GUI was created using python's Tkinter class. This GUI uploads a map pgm file created by map_server and displays it for the user. The user can click on the desired location and the robot will go to that destination.
GUI Key:
In order to make it around tougher maps, it was necessary to implement a path planner. An A* algorithm was implemented as a Python class which the GUI code could then use to generate a path when needed. The path planner reads a map as an OccupancyGrid from the ROS '/map' topic, which the map_server node automatically publishes a given map to. Then the GUI simply has to input a current location and destination, and it gets the shortest path connecting the two.
The image to the right shows the need for a path planner.
After the navigation application was functional it was condensed into 2 launch files that ran the appropriate nodes:
Nowadays, many traditional control problems that require a large amount of computations are being replaced by reinforcement learning techniques. This summer I read much literature on the basics of reinforcement learning (RL) and wanted to include RL in the autonomous navigation techniques I was working on.
This project replicates a simple gridworld reinforcement learning problem in VREP, using the Quadcopter as an agent and trees as obstacles (the problem was still 2D). An action was a .25 meter step in the positive or negative x or y directions, and the state was observed every step of the simulation to be the current x,y position of the agent. The agent began at 0,0 and the goal was to reach 4,4. The agent was restrained from stepping to an x or y greater than 4 or less than 0; such an action simply causes the agent to stay in it's current position.
Rewards were distributed as follows:
Lua scripts were written to remotely control the VREP simulation with ROS. An epsilon greedy Q-Learning algorithm was implemented with a Q table in C++, and the Q table was stored in an external file.
After adjusting the hyperparamters to optimize the learning process, the problem was solved after 2000 episodes. A gif of the agent's navigation after 2000 episodes is shown below.
Gridworld RL Problem in VREP... SOlVED!
More detail can be found in my GoogleDoc linked below.
Code can be found on GitHub: https://github.com/akamboj2/AutonomousNav-RL_Research2018
Please contact me if you have any questions or comments: Abhi Kamboj (akamboj2@illinois.edu)