In this work we are dealing with rigid body motion planning in a dynamic environment. The work contains a brief overview of motion planning in static and especially in a dynamic environment. We describe and compare sampling-based motion planning algorithms (RRT and RRT *). We have briefly and clearly described the kinematics of a mobile robot with the differential chassis. The main goal of the practical part is to use one of the algorithms for planning and test it on a real robot. To meet this goal, we worked with object recognition using OpenCV, a PID controller for speed control, encoders for monitoring motor speeds and the ROS system.