# How to move a robot to a point while avoiding obstacles?

I am trying to move a robot in a straight line from point A, to point B. The robot's primary sensor is a Hokuyo URG-04LX-UG01 LIDAR that gives me the magnitude and direction of each point it detects in the form of two arrays.

I also have the wheel encoders on each motor of the robot, so I can obtain some odometry of the robot even though its accuracy will diminish over time.

The problem that I have is that there are obstacles in the path of point A and point B that the robot must go around. I am not sure how to take the readings from the LIDAR, and convert them into movements that go around the obstacle, while also heading to B. Sorry if that doesn't make sense, but I am really confused on how to solve this problem.

Is this an easy problem to solve and I am just over complicating it? Does anyone know of a way to do this? Any help or guidance would be greatly appreciated.

• I would recommend looking up RRT (rapidly exploring random trees). There is likely an open source implementation for your software stack (ROS has many). – combo Jul 19 '17 at 19:23

First off, I would highly recommend checking ROS (Robot Operating System) out, the ROS community includes researchers and enthusiasts as well as professionals from all around the world and thus most of what you need to solve the problem is already available there. You would have to just implement what others have done, on your system.

I, rather me and my team, have done the exact same thing as you want and the problem becomes much easier if you are using ROS.

There are pre-built SLAM packages available open source which you can use and for making maps and localizing your robot. Once you have the robot's position in a map that also contains all of the obstacles, you just have to do the path planning so that you do not hit any of the obstacles and reach your goal as fast as possible. Then break your path into neared goal points which are simpler to reach so that just by getting to these points your robot can get to the final goal.

As the problem you have put forth is a rather large problem, I feel it is hard to explain it completely here, but I will try to do as much as I can (When I get time I will add more links to help).

Let us break this problem into several parts,

(Don't worry about some occasional ROS jargon, you'll catch them during the tutorials).

1. If you are unaware of ROS, I suggest taking a look at it and here is a place where you can learn it hands-on.
2. Next you will have to get your sensors working with ROS, this should be easy as for most of them you will have packages already made and open source.
3. Once all your sensors are working with ROS, you will have topics which contain have current sensor data, now you can do anything with them, i would use filters on the data and fuse to find your robots estimated pose. (You should also look into Kalman and Extended Kalman Filters at this point.)
4. Now is the time when you can use some SLAM (Simultaneous Localization and Mapping) algorithms to have a map with obstacles and your robot at all times.
5. Do the Motion Planning, break the path into smaller pieces and feed them to your robot in the format it wants (You will need some knowledge about Control Systems at this point).

From my experience you can use these packages : gmapping, robot-poe-ekf, moveit. (Google these by adding ros)

I hope this helps, and all the best man.

What you are talking about is Robotic Path Planning.