JetRacer ROS AI Kit Advanced Tutorial II: Autonomous Navigation

From Waveshare Wiki
Jump to: navigation, search

Step 1: Enable The Navigation Program

  • Keep the radar rotating firstly, and run the following program to enable the robot.
  • [Note: the chassis node and radar node will be enabled by default when starting the slam mapping node, so please close the robot chassis node and radar node first to avoid conflicts and errors when starting the nav mapping node.]
roslaunch jetracer nav.launch
  • Enter the following command in the virtual machine to view the slam map through the RVIZ image tool.
roslaunch jetracer view_nav.launch
  • The image interface is shown as follows. Since the coordinates of the robot are initialized as the origin of the map after startup, which is inconsistent with the actual position of the robot, you can use the 2D Pose Estimate tool to set the position of the robot, click the green arrow icon, and select the approximate position of the robot in the map. Drag the mouse to make the green arrow point to the front of the car.

Autonomous Navigation01.png

Step 2: Single-point Navigation

  • After setting the robot position correctly, make the radar data roughly coincide with the map, and ACML will reposition and correct it when navigating.

Autonomous Navigation02.png

  • You can use the 2D NaV Goal tool, you can publish the navigation target position, and the robot will automatically plan the path to navigate to the target position.

Step 3: Multi-point Navigation

  • On the basis of the single-point navigation above, run the following command in the robot to start multi-point cruise.
rosrun jetracer multipoint_nav.py
  • Click Publish Point to add a waypoint, the robot will navigate between the waypoints.

Autonomous Navigation03.png

Step 4: Map While Navigating

  • Run the following command on the robot side to start the navigation program.
roslaunch jetracer slam_nav.launch
  • Run the following command in the virtual machine to start the rviz image tool to view.
roslaunch jetracer view_nav.launch
  • Click the 2D NaV Goal tool, you can publish the navigation target position, the robot will automatically explore the path to navigate to the target point, and scan the map to publish.

Autonomous Navigation10.png

  • After scanning the map, run the following command in the robot to keep the map.
cd ~/catkin_ws/src/jetracer/maps && ./savemap.sh
  • At the same time, you can run the following programs to start multi-point cruise.
rosrun jetracer multipoint_nav.py