![]() The video below shows the solution code in action:Ĭhange the state machine to make e-puck avoid obstacles placed on its way. Try to implement the state machine yourself before checking the solution! A possible solution is available here. If you need inspiration, check the template code available here! Solution In Python you can access the ground sensors as shown below. The simulator also treats the ground sensors as distance sensors because they are of the same type (infrared sensors). To detect the line on the floor you need to use the ground sensors, instead. In Tutorial 4 you made use of the distance sensors around the robot. A state machine diagram that implements a line-follower behavior. You can use the state machine shown in Figure 2 as reference.įigure 2. More information about how to read the ground sensors is given below.ĥ- Test the motor speeds to determine how fast the robot should run and turn in order to follow the line.Ħ- Finally, create a new controller in Python and implement a line-following behavior using what you learned from the steps above. You can use the print function to show the sensor values in the Webots console. Webots screenshot with the world “e-puck_botstudio_with_floor_sensors.wbt”.ģ- You will need to make changes to the file, so you have to save the sample world with a different name on a folder of your choice.Ĥ- Write a simple program to investigate the values returned by the floor sensors when the robot is over the white floor and over the black line. In the next steps you must use the e-puck robot that is loaded with this sample world because it has the floor sensors to detect the line.įigure 1. You should see a world similar to the one shown in Figure 1. Tasksġ- Follow Webots Tutorial 4 to better understand the e-puck model and learn how to control it in Python.Ģ- After finishing tutorial 4, open the line-following sample world: Click on File > Open Sample Worlds and go to robots > gctronic > e-puck and select e-puck_botstudio_with_floor_sensors.wbt. Other 3 infrared sensors are mounted under its base, pointing to the floor, allowing the implementation of a line-following behavior.Ī detailed explanation of the e-puck robot and how to use it in Webots is available in this link. To detect obstacles, the e-puck contains 8 infrared distance sensors around its body. The movement of this type of robot is controlled by independently adjusting the speeds of the left and right wheels. Webots contains a realistic model of e-puck, a small differential-drive mobile robot. If you are still missing any of those, please go back to Lab 1 and complete the corresponding tasks. You must know how to create a robot controller in Python and how to run a simulation.You must have Webots R2022a (or newer) properly configured to work with Python.The goal of this lab is to learn more about controllers in Webots via the implementation of a line-following behavior in Python based on a finite-state machine. Lab 2 – Line-follower with State Machine Robotics Simulation Labs - Set of tutorials to practice robotics concepts with Webots and Python View on GitHub Lab 2 – Line-follower with State Machine Objectives Lab 2 – Line-follower with State Machine | Robotics-Simulation-Labs Skip to the content.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |