JetRacer ROS AI Kit Advanced Tutorial II: Autonomous Navigation

From Waveshare Wiki
Revision as of 08:03, 7 November 2022 by Eng52 (talk | contribs) (Created page with "<div class="wiki-pages jet-green-color"> ==Step 1: Enable the navigation program== *Keep the radar rotating firstly, and run the following program to enable the robot. *[Note:...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 jetbot_pro nav.launch
  • Enter the following command in the virtual machine to view the slam map through the RVIZ image tool.
roslaunch jetbot_pro 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 jetbot_pro 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 jetbot_pro slam_nav.launch
  • Run the following command in the virtual machine to start the rviz image tool to view.
roslaunch jetbot_pro 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/jetbot_pro/maps && ./savemap.sh
  • At the same time, you can run the following programs to start multi-point cruise.
rosrun jetbot_pro multipoint_nav.py