Robot Operating System (ROS) is a widely used robot application development platform which provides a series of out-of-the-box libraries and toolkits to help software developers develop and build robot SLAM mapping, path navigation, path tracking, and user-defined algorithms, and it is compatible with physical robots. Furthermore, ROS provides functions of function library, visual simulation, message data interaction, hardware interaction, and device drivers. The visual simulation tool of its experiment can import many models that simulate real scenes, making the simulation experiment infinitely close to the real environment. Furthermore, ROS can also be deployed on mobile robots, enabling mobile agents to have a unique development environment on which mobile robots can achieve more functions.
The autonomous navigation of mobile unmanned vehicle in a given environment needs to integrate several modules and realize them at the same time so as to develop an autonomous navigation system that can drive to preset goals and have no collisions in the process. What is more, these modules include: environment map detection and drawing, robot map positioning, path planning, and path tracking modules. In this chapter, the CBSS algorithm is applied in the ROS platform to develop an autonomous navigation system that can navigate in a given environment, and the system can be transplanted to a physical mobile robot for application in a real-world environment.
4.1. Autonomous Navigation System Settings
The architecture of the autonomous navigation system is divided into four layers: the hardware layer, the data interaction layer, the navigation algorithm layer, and the application layer. Among them, the data interaction layer, navigation algorithm layer, and application layer can be summarized as the software system in the autonomous navigation system. The overall architecture of the autonomous navigation system is shown in
Figure 5.
First of all, when the user needs to perform a robot navigation task to make the mobile robot drive to the user-specified target position, the interaction between the user and the system can be realized through the application layer of the autonomous navigation system. Then, users can set the target points of robot navigation tasks on Rviz visualization software, and Rviz can collect data in real time, dynamically display the process of map construction, and display the driving process of mobile robots on the constructed map in real time.
Gazebo simulation software allows users to build a task environment in a simulation environment, simulate the entire process of task running, debug code according to the task execution status, and optimize algorithm design. Among the architecture of the autonomous navigation system, the navigation algorithm layer includes key algorithms in the autonomous navigation system, including mobile robot autonomous positioning, map construction, CBSS global path planning algorithm, and pure tracking algorithm, among which the CBSS global path planning algorithm can calculate the shortest path from the robot’s current position to the target point according to the known map environment.
The data interaction layer is responsible for interacting with each sensor in the hardware system, converting the data into a format that the hardware system and the software system can receive and process, and publishing the lidar data topics, mileage topics, and control command topics to realize the data communication between modules. Then, the hardware layer mainly obtains information or executes the chassis motion control command of the robot through the hardware. In addition, the laser data of map can be obtained from the laser radar, the mileage data can be obtained from the odometer, the command of serial transmitter can be accepted, and the chassis control command of the mobile robot can be executed according to the kinematic model of the mobile robot.
4.2. Global Path Planning via CBSS Algorithm on Gazebo
This section introduces the application of CBSS in the simulation environment of an autonomous navigation system. Users can build a mobile robot model and environment model through Gazebo, the visual simulator of application layer in autonomous navigation, and test the effectiveness of the algorithm in the simulation environment. Furthermore, the mobile robot model in Gazebo emulator is consistent with the real robot model. The Gazebo emulator can build a complete 3D rendering environment and support sensor noise simulation, robot cluster, and dynamic physical models. These features make experimental results on the Gazebo simulator more realistic.
In the simulation experiment, MBOT, a mobile robot equipped with lidar and a two-wheel differential motion model, is constructed and applied to perform path planning tasks in this environment. In this experiment, the MBOT mobile robot can move forward and backward, and the robot does not need a steering motor and steering wheel. However, it can turn left and right in place and drive in a narrow environment only by controlling the speed difference between the two driving wheels. The appearance of the mobile robot is shown in
Figure 6.
The environment of the simulation experiment was built. First, a wall model was used to build a closed indoor environment, and common indoor furniture such as makeup table and sofa were introduced. Then, a series of obstacles are set in the feasible passage area to construct a 25 m × 15 m indoor environment with obstacles, as is shown in
Figure 6.
The preset environment is a more realistic simulation of the indoor environment. Before the path planning experiment, the mobile robot MBOT is placed in the simulation environment under the coordinates of the global environment reference frame, and then the laser scanning SLAM process is started to create a map that can be used for path planning tasks in the future. So, by controlling the moving trajectory of the mobile robot, the mobile robot can gradually explore the whole space. Furthermore, according to the input of laser radar scanning, clearing figure grid will gradually be passable and obstacle information filled in the region and the exploration by six exploratory stage show, as shown in
Figure 7, a two-dimensional coordinate system represent the ground plane of the map, when robot to complete the exploration to the environment, a two-dimensional grid map can be obtained.
In global path planning, the CBSS algorithm is used to calculate the path point set of feasible paths from the starting point to the end point of evolution, and a fitness function taking Euclidean distance and obstacle collision into consideration is used as the standard to minimize the search. In addition, two different tasks are performed on the environment map to verify the planning effect of the autonomous navigation system and tracking effect of mobile robots after planning.
The experiment specifies two tasks for the path planning experiment. In the two tasks, the CBSS global path planning algorithm is used to optimize and solve the path planning stage, and it is used as the driving path connecting the current position and target position of mobile robot MBOT in the simulation environment. Furthermore, users can assign tasks by specifying moving target points and robot poses in Rviz visualization software with the mouse. Notably, Gazebo mainly displays mobile robot movement in a 3D environment, while Rviz mainly displays mobile robot path planning results and path tracking process on a 2D raster map. When the car needs to turn or turn for a period of time, it will judge based on the probability judgment according to and update the individual speed V and individual position X.
The effects of task execution were shown in six stages in Rviz visualization software, respectively. In Task 1, the starting point and end point of the task are (−11.4 m, −6.62 m) and (10.4 m, 2.12 m), respectively. The experimental results are shown in
Figure 8. Among them, in the global planning algorithm using A* and Dijkstra algorithm, the time required to complete Task 1 is also different, as shown in
Table 1. The table contains the times for each algorithm to execute once and the average elapsed time for ten executions, which can better reflect the advantages of algorithm, The average value of ten executions of CBSS is 61.129 s, while the values of the Dijkstra and A* algorithm are 64.938 s and 72.365 s, respectively, which shows that the time and energy consumption of CBSS are better than those of the other algorithms.
In Task 2, the mobile robot needs to drive from the room at the upper left corner of the map to the room at the lower left corner, and the starting point and ending point are set to be (−11.8 m, −6.34 m) and (−11.2 m, 6.36 m), respectively. In addition, the task execution effect of the robot is displayed in six stages in the Gazebo visual simulator and Rviz visual software. The experimental results are shown in
Figure 9.
In Task 1, the mobile robot needs to drive to the environment behind the obstacles in the upper-left corner; these obstacles create narrow-feasibility channels through the obstacles that are required as part of the optimal collision-free path. In the absence of the CBSS algorithm’s exploration ability, these narrow channels may not be found in the accessible path, and other path schemes calculate a long distance to the target point. In the planning results, it can be seen that the CBSS global path planning algorithm calculates a safe and successful path through the obstacles. Moreover, with the obstacles on the map under the influence of the expansion coefficient, the planned path always maintains a safe distance from the obstacles, and the mobile robot successfully reaches the end after avoiding the obstacles.
In Task 2, the mobile robot needs to drive from the upper-left corner of the map to the lower- left corner, and there was a wide space in the environment of the middle of the road map. Task 2 has many feasible solution paths, but the optimal path should remain in the broad road on the left. More decentralized problems exist in the environment: path planning needs to find the optimal solution for obstacle avoidance and the short circuit diameter length index. Furthermore, in the solution computed by the CBSS global path planning, the path always maintains a wide distance from the obstacles and the left wall and guarantees a safe distance. In task two, the CBSS algorithm finds an optimal solution path, and the mobile robot can drive to the goal without collision.
In order to verify the reliability of the autonomous navigation system and eliminate the interference of accidental errors, 50 repeated tests were carried out in each of the two tasks. Furthermore, the success times of the mobile robot successfully planning the global path and driving safely to the specified position according to the path were recorded, and the success rate was calculated.
According to the results in
Table 2, the overall success rate of both tasks reached more than 95%. The sensor error and random noise will interfere with the overall task execution, but the global path planning based on the CBSS algorithm can still guarantee effectiveness and stability in the autonomous navigation system and enable mobile robots to complete the navigation tasks assigned by users. Hence, in order to make the experimental portion better and more effective,
Table 3 shows the planning and execution times of Task 1 and Task 2.
Below, the algorithm of this paper and various other bionic algorithms, such as BSO and PSO, are compared with GA in order to verify that the reliability of the system of the autonomous navigation algorithm is higher than the other bionic types. To rule out the influence of other factors in the experiment, this experiment also used 20 repetitions for both the algorithm presented in this paper and the other bionic algorithms. In addition, the path planning fitness value proportion and time proportion results for Tasks 1 and 2 of this paper’s algorithm and other bionic algorithms were recorded, as shown in
Table 4. In order to more intuitively compare the fitness values and planning times calculated by the CBSS algorithm and the other algorithms, the experimental values are plotted in the form of histograms in
Figure 10. The histograms more clearly show the experimental data differences between the CBSS algorithm and other algorithms. In addition, in order to verify that this algorithm is the most energy efficient and that the generated path is the shortest,
Table 5 shows that the path generated by this algorithm is significantly shorter than the paths generated by other the algorithms.