Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Projecttask1.py is a python file Projecttask1.launch is a launch file please let the code be in the mentioned language 1. [35 points] Create a ROS
Projecttask1.py is a python file
Projecttask1.launch is a launch file
please let the code be in the mentioned language
1. [35 points] Create a ROS Python node (projecttask1.py) to execute the motion in Figure 1 for two robots in ROS Stage. Small black circles show the beginning points of the robots (Figure 1:left) and the small squares show the stop points of the robots (Figure 1:right). The robots initially face each other. The arrows show the directions that the robot moves. The distance that the robot travels in the up and down directions (i.e. in the y axis) is the same. Motion-pattern: Both robots start moving toward each other, when they detect each other with their sensors, they move up/down, turn right/left and move straight until they detect the wall with their sensors; then they move down/up, turn left/right and continue moving straight until they detect each other again with their sensors. This motion pattern is executed by each robot three times (i.e. for three rounds). After three rounds, the robots should stop facing each other. Create a launch file (projecttaski.launch) that starts this Python node for both robots and the ROS Stage. In your world file, you can set the image of the environment as a closed environment that does not include obstacles in it (see Figure 1). You should use the robots' sensors so that the robots do not collide with each other and do not hit the walls. You can define a fixed distance for the robot when it is traveling in up or down direction (i.e. in the y axis). However, do not define a fixed distance for the robot when it is traveling in right or left direction (i.e. in the x axis). This should be controlled by the robots' sensors. That is, the robot should understand when it should stop and return back. Robot-1 Goal Point Robot-2 Goal Point Robot-1 Robot-2 Figure 1 Sample Executions of the Tasks 1. [35 points] Create a ROS Python node (projecttask1.py) to execute the motion in Figure 1 for two robots in ROS Stage. Small black circles show the beginning points of the robots (Figure 1:left) and the small squares show the stop points of the robots (Figure 1:right). The robots initially face each other. The arrows show the directions that the robot moves. The distance that the robot travels in the up and down directions (i.e. in the y axis) is the same. Motion-pattern: Both robots start moving toward each other, when they detect each other with their sensors, they move up/down, turn right/left and move straight until they detect the wall with their sensors; then they move down/up, turn left/right and continue moving straight until they detect each other again with their sensors. This motion pattern is executed by each robot three times (i.e. for three rounds). After three rounds, the robots should stop facing each other. Create a launch file (projecttaski.launch) that starts this Python node for both robots and the ROS Stage. In your world file, you can set the image of the environment as a closed environment that does not include obstacles in it (see Figure 1). You should use the robots' sensors so that the robots do not collide with each other and do not hit the walls. You can define a fixed distance for the robot when it is traveling in up or down direction (i.e. in the y axis). However, do not define a fixed distance for the robot when it is traveling in right or left direction (i.e. in the x axis). This should be controlled by the robots' sensors. That is, the robot should understand when it should stop and return back. Robot-1 Goal Point Robot-2 Goal Point Robot-1 Robot-2 Figure 1 Sample Executions of the Tasks
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started