In the field of unmanned vehicle, SLAM and navigation two parts has always been the focus of researchers, no one car as a mobile robot, the two function is also very important, no one car to an unknown environment, artificial control of unmanned vehicle is built figure, establish a good map, and then use the navigation, which is currently in unmanned vehicle application scenario is very common scenario, However, in the actual application process, there are still limitations. In many application scenarios, unmanned vehicles are required to independently explore and build maps in an unknown environment, rather than build maps under human control. Thus, autonomous exploration is born.

Rrt_exploration is a search algorithm based on RRT path planning algorithm. The reason why RRT algorithm is used is that RRT has a strong tendency for unknown regions. In RRT exploration, RRT is mainly used to generate boundary points, which is very beneficial for exploring boundary points. A boundary point is the boundary between explored and unknown areas.

Use RRT_Exploration in ROS to build diagrams and official documents

(wiki.ros.org/rrt_explora…

Download rrT_Exploration

1. Open the terminal

2. Go to your workspace/SRC file

cd catkin_ws/src

Replace catkin_ws in the command with your personal workspace name

3. Download rrT_Exploration

git clone

Github.com/hasauino/rr…

2. Download the relevant dependency pack (ROS version is Kinetic)

OpenCV(cv2)

sudo apt-get install python-opencv

Numpy

sudo apt-get install python-numpy

Sklearn

sudo apt-get install python-scikits-learn

gmapping

sudo apt-get install ros-kinetic-gmapping

navigation

sudo apt-get install ros-kinetic-navigation

Compile the workspace

Enter your workspace

CD catkin_ws # Replace catkin_ws in the command with your personal workspace name

2. Compile

catkin_make

At this point, if there are no errors, the RRT_Exploration package has been downloaded and installed, and it’s time to use it. At this point, I recommend creating a launch file for the purpose of using the autonomous Exploration diagram. I divided the independent exploration and drawing building function into two modules, one is the independent exploration function and the other is the drawing building function. The independent exploration function requires RRT_exploration and MOVE_base, and gmapping is used for drawing building here. So your launch file needs to contain three things:

1) rrt_exploration

(2) move_base

(3) gmapping

4. Create the launch file of independent construction diagram

1. Create a launch folder within a feature pack and create a rrt_slam.launch file in the Launch folder

The contents of the file are as follows:

<include file="$(find rrt_exploration)/launch/simple.launch"/> <include file="$(find tiprobot_slam)/launch/tiprobot_gmapping.launch"/> <node pkg="rviz" type="rviz" name="rviz" required="true" args="-d $(find tiprobot_slam)/rviz/tiprobot_explore.rviz"/> <node pkg="move_base" type="move_base" respawn="false" <param name=" footprint_PADDING "value="0.01" /> <param name="move_base_node" output="screen" Name ="controller_frequency" value="5.0" /> <param name="controller_patience" value="3.0" /> <param Name =" Oscillation_timeout "value="30.0" /> <param name=" Oscillation_distance" value="0.5" /> <param name="planner_patience" value="1" /> <param name="controller_patience" value="1" /> <param name="recovery_behavior_enabled" value="false" /> <rosparam file="$(find tiprobot_slam)/config/costmap_common_params.yaml" command="load" ns="global_costmap" /> <rosparam file="$(find tiprobot_slam)/config/costmap_common_params.yaml" command="load" ns="local_costmap" /> <rosparam file="$(find tiprobot_slam)/config/local_costmap_params.yaml" command="load" /> <rosparam file="$(find tiprobot_slam)/config/global_costmap_params.yaml" command="load" /> <rosparam file="$(find tiprobot_slam)/config/base_local_planner_params.yaml" command="load" /> <param name="global_costmap/global_frame" value="/map"/> <param name="global_costmap/robot_base_frame" value="/base_link"/> <param name="global_costmap/laser_scan_sensor/sensor_frame" value="/base_scan"/> <param name="global_costmap/laser_scan_sensor/topic" value="/scan"/> <param name="local_costmap/global_frame" value="/map"/> <param name="local_costmap/robot_base_frame" value="/base_link"/> <param name="local_costmap/laser_scan_sensor/sensor_frame" value="/base_scan"/> <param name="local_costmap/laser_scan_sensor/topic" value="/scan"/> <param name="local_costmap/obstacle_layer/laser_scan_sensor/topic" value="/scan"/> <remap from="cmd_vel" to="cmd_vel"/> </node>Copy the code

2. Description of the file content

rrt_exploration

Just use include, simple. Launch is a launch file for a single robot using RRT_exploration.

gmapping

There are many reference documents for gmapping, so I won’t go into them here.

move_base

The point of this section is that while RRT_Exploration creates the simple.launch file for a single robot, most people still have problems with it. The reason is straightforward here.

Most of the problems are with this sentence, notice

Name =”move_base_node”, that’s the root of the problem,

Rrt_exploration authors write their code with this name, but most ROS users use the name move_base. The source code uses move_base_node, and there is no interface in the launch file to change the name of move_base. Therefore, when rrT_exploration is used, most people will find that MOVE_base cannot connect with RRT_Exploraiton, resulting in the failure of autonomous exploration function. There are two solutions:

This is the simplest, quickest and most recommended method: name the move_base node move_base_node in the launch file.

(2) Change the name of move_base_node in the source code. This is not recommended, because there are many places to change the efficiency is not high, but also prone to error.

Move_base:

<param name="controller_frequency" value="5.0" /> <param name="controller_patience" value="3.0" /> <param name="controller_patience" value="3.0" Name =" Oscillation_timeout "value="30.0" /> <param name=" Oscillation_distance" value="0.5" /> <param name="planner_patience" value="1" /> <param name="controller_patience" value="1" /> <param Name ="recovery_behavior_enabled" value="false" /> This parameter is configured by the author and should be debuggable based on the algorithm. You are advised to use the default set of parameters. <param name="global_costmap/global_frame" value="/map"/> <param name="global_costmap/robot_base_frame" value="/base_link"/> <param name="global_costmap/laser_scan_sensor/sensor_frame" value="/base_scan"/> <param name="global_costmap/laser_scan_sensor/topic" value="/scan"/> <param name="local_costmap/global_frame" value="/map"/> <param name="local_costmap/robot_base_frame" value="/base_link"/> <param name="local_costmap/laser_scan_sensor/sensor_frame" value="/base_scan"/> <param Name ="local_costmap/laser_scan_sensor/topic" value="/scan"/Copy the code

The parameters of the global cost map are similar to those of the local cost map

The first four parameters represent

Global coordinate name: in the author’s setting, the global cost map is map, and the local cost map is ODOM. After testing, I feel that the local cost map is better changed to MAP, so I use map here.

Robot base coordinates: This is basically the same for everyone, usually base_link or base_footprint.

Sensor coordinate name: This may be different, you can use rosrun rqt_tf_tree rqt_tf_tree command to check the tf name of the laser, according to the name of your own robot.

Sensor data topic name: Most of this should be SCAN, which is also modified according to the name of the robot.

Use rrT_Exploration based autonomous exploration capabilities

Just to show you a little bit of the running process. What I use here is turtlebot3 simulation to test.

1. Start the TurtleBot3 simulation

roslaunch turtlebot3_gazebo turtlebot3_stage_4.launch

roslaunch turtlebot3_bringup turtlebot3_remote.launch

2. Start rrt_slam. Launch

roslaunch rrt_exploration rrt_slam.launch

I put the launch file in the RRT_Exploration package, and adjust the command to suit your personal situation.

Publish Point in RVIz sets four points (recommended as four vertices in a rectangular area) as the scope of exploration, and a fifth Point is set near the robot.

Effect display:

The effect of independent exploration is good.

  • End –

With the rapid development of technology, AMu Lab will keep up with the pace of technology and continue to recommend the latest technology and hardware in the robotics industry to you. The greatest value of our training is to see our trainees improve by leaps and bounds. If you are in the robot industry, please follow our official account, we will continue to publish the most valuable information and technology in the robot industry. Amu Lab is committed to the education of cutting-edge IT technology and intelligent equipment to make robot research and development more efficient!