Robot Patrol

  1. Open the third terminal and launch the move_base node:

     roslaunch handsfree_2dnav navigation.launch map_name:=my_map
    
  2. Open the fourth terminal and open the RVIZ visualization tool:

      rosrun rviz rviz -d `rospack find handsfree_bringup`/rviz/navigation.rviz
    
  3. Initial position calibration: the initial position can be calibrated with 2D Pose Estimate until the robot's position in the map is the same as the robot's actual position.

    rviz_mapping

The initial position of the robot after opening Rviz is in the bottom right corner of the interface, at this point we have to initialize the actual position of the robot by calibrating it with `2D Pose Estimate` until the robot's position in the map is the same as the actual position of the robot. During the calibration process we can select the actual position of the robot by the nearby references.  


Explanation of picture markers:  
```
a:uncheck the checkbox to better view the calibration position.  
b:The black lines are obstacles on the map
c:The red line is the actual obstacle scanned by the Lidar
d:Location of the robot
```
As shown in the figure below, if the obstacles shown in the Lidar scan coincide with the obstacles on the map after the robot has changed its position, the position is relatively accurately calibrated:   

![pose](./img/pose.jpg)
  1. Get the coordinates of the target point by Publish Point: click Publish Point above the visualization tool, by moving the mouse you can see the coordinates at the bottom left of the visualization tool, the coordinates are the coordinates of the mouse on the map, the first two numbers of coordinates are x and y, We only need to record the number of x and y, then move the mouse to the four target points to get the corresponding coordinates (without clicking), note: the coordinates of the four target points must be in the gray moveable area, and try to make the distance between the four target points as large as possible:

    Point

  1. Open a fifth terminal and run the following two commands to modify the python file:

     cd
     gedit handsfree/handsfree_ros_ws/src/handsfree/handsfree_tutorials/script/
     6_application/1_patrol/multi_point_patrol.py
    

    You need to modify the coordinates of the points according to the map you have built:
    4point

  2. Open the fifth terminal and run the python file:

     rosrun handsfree_tutorials multi_point_patrol.py
    

pose

results matching ""

    No results matching ""