Welcome to ROSMASTER M1 repository
3. Road Network Labelling
Road Network Description File Annotation
Road Network Description File Annotation1. Course Content2. Road Network Annotation2.1 Starting the Navigation Node2.2 Adding a Waypoint2.3 Adding Edges3. Save the road network description file4. Loading and Modifying Road Network Description4.1 Loading the Road Network Description File4.2 Editing the Road Network
1. Course Content
- Using the route_tool tool to annotate the .geojson format file describing the road network
[!IMPORTANT]
- rviz visualization is used, all running in the virtual machine
Rosmaster-RoadNet-Ubuntu24.04
2. Road Network Annotation
Open ~/.bashrc, uncomment this line, and change it as shown in the image. (After learning the road network planning function, please restore this comment to avoid affecting the previous examples.)
xxxxxxxxxx:wq #Save and exitsource ~/.bashrc #Update environment
2.1 Starting the Navigation Node
- When marking the road network, we need to know the exact location of the vehicle's navigation system on the map. Therefore, we need to use the global positioning of the navigation node here.
- (Host side) Chassis radar driver
xxxxxxxxxxros2 launch yahboomcar_nav laser_bringup_launch.py
- (Virtual machine side) Start visualization
xxxxxxxxxxros2 launch road_net_route rviz_only.launch.py ••tools:=true
- (Host side) Navigation node
xxxxxxxxxx#rdkx5ros2 launch yahboomcar_nav navigation_teb_launch.py map:=/home/sunrise/map/map.yaml#orinros2 launch yahboomcar_nav navigation_teb_launch.py map:=/home/jetson/map/map.yaml[!NOTE]
Startup parameter description
- map The name of the raster map to be loaded; here, we've selected the map saved in the previous lesson.
- The host machine's map is saved by default in the
~/mappath. This path is automatically mounted into the/root/mapdirectory within theros2_kiltedcontainer. Therefore, map files saved on the host machine can be used directly within theros2_kiltedcontainer.
- RViz will display the map and two coordinate systems.
mapis the map coordinate system, andbase_footprintis the coordinate system of the projection point of the vehicle's chassis center onto the ground. We first use2D Pose Estimateto give the vehicle's initial pose on the map we created, roughly its position on the map.

- After giving the approximate position, we can navigate the mobile robot vehicle using keyboard control, gamepad control, or
2D Goal Posein RViz, ensuring the radar/laser contour perfectly matches the map.

2.2 Adding a Waypoint
- Click the
Publish Pointtool in the RViz toolbar to enter waypoint selection mode.

- Then click the left mouse button in the center of the car. The
positionfield in theRoute Tooltab at the lower left will automatically fill in the coordinates of the current point. Then clickCreateto create a waypoint.

- Next, we move the vehicle-mounted robot to the next location where waypoints need to be marked. In this demonstration, we directly move the robot to the next location where waypoints need to be marked.
[!TIP] The mobile robot-mounted robot can be controlled via keyboard, gamepad, or RViz's
2D Goal Posenavigation.

[!WARNING]
- The localization principle here uses AMCL global localization and pose map matching.
- Note: If, during subsequent waypoint marking, a discrepancy is observed between the laser contour and map environment features (due to cumulative errors in the odometer or wheel slippage causing local positioning errors), you can first move and rotate the robot a short distance to allow AMCL localization to take effect and ensure the radar laser contour data perfectly matches the map.
- Repeat the above steps until all waypoints need to be marked (mark waypoints according to your actual needs).

2.3 Adding Edges
- Select Edge in the
Route Tooltab.

- Enter the starting waypoint in
Start Node IDand the ending waypoint inEnd Node ID, then clickCreateto create an edge between waypoints.
[!IMPORTANT] Note!! A road network is a topological structure composed of points and edges. Edges have directions.** Here, the edge created from 1 to 2 is unidirectional. If a bidirectional edge is needed, the edge from 2 to 1 also needs to be created.
- Next, we create the edge from 2 to 1 so that bidirectional travel is possible between road points 1 and 2.

- Repeat the above steps to complete the creation of all edges (whether to create unidirectional or bidirectional edges depends on the user's actual needs).

3. Save the road network description file
- In
Route In the Tool tab, click Save. In the pop-up window, select the path to save the file. Here, we choose to directly overwritemap.geojson` and save it in this path.

- Transfer it directly to the host machine's
~/mappath using the commandscp map sunrise@192.168.11.78:~/map/(enter your actual username and IP address). This path is bound to the/root/mappath inside the Docker container. You can also drag it out from the virtual machine and then transfer it to the host machine.

- If you don't choose to overwrite, you can also... Enter the file name in the name field. It is recommended to keep it consistent with the raster map name for easy differentiation. The file extension must be .geojson. Finally, click
saveto save the road network description file.

- After successful saving, the terminal will print a prompt message.

- Afterwards, we can view the
map.geojsonroad network description file, which contains a JSON format description of waypoints and edge information.

4. Loading and Modifying Road Network Description
4.1 Loading the Road Network Description File
[!TIP]
- If you need to modify the previous road network description file later, such as adding, removing, or editing points and edges, you can load the previous road network description file for editing.
Still following step 2.1 after starting the navigation node,
In the
Route Tooltab, click Load, then select the road network description file to be edited, and clickopento load it.


4.2 Editing the Road Network
- If you need to add new waypoints and edges, the operation is the same as before.
- Click
Editto edit existing waypoints or edges.

- Click
Removeto edit existing waypoints or edges.
