Summary

After successfully loaded a map file from pcl rosbag in JOSM, we’ll see how to draw a lane network, load it in Rviz with Lanelet2 and do global planning with mission planner.

  1. Install Lanelet2 plugin in JOSM
  2. Draw lanes in JOSM
  3. Visualization in Rviz
  4. Global planning demo

End results:

planning_preview

Prerequisite

1 - Install Lanelet2 plugin in JOSM

In lanelet2_map_loader->Lanelet2->lanelet2_maps->josm, there are 3 files: laneletpresets.xml lanelets.mapcsss lines.mapcss

Open JOSM

  • Edit->Preferences->Map Settings -> Map Paint styles -> add (+) select lanelets.mapcss and lines.mapcss
  • Edit->Preferences->Map Settings -> Tagging Presets -> add (+) select laneletpresets.xml

josm_plugin

2 - Draw lanes in JOSM

Open JOSM and load your previous png file generated from rosbag, here for demo purpose:

  • File->New Layer
  • Imagery-> New picture layer from file… ->lanelet2_map_loader->map_loader->data->map.png

Follow these two videos to draw lanes on your map image:

Example result:

Open JOSM

josm_with_lanes

3 - Visualization in Rviz

After generating your own .osm file, in map_loader/launch/lanelet2_map_loader.launch, modify

L1 <arg name="file_name" default="$(find map_loader)/data/hs_pcl.osm"/>
L5 <arg name="pointcloud_map_path" default = "$(find map_loader)/data/ds.pcd"/>
L6 <arg name="pcl_grid_map" default = "$(find map_loader)/data/map.yaml"/>
roslaunch map_loader lanelet2_map_loader.launch

Check pointcloud2 to see your pcd file. rviz_with_lanes

4 - Global planning demo

roslaunch mission_planner mission_planning.launch
  • use 2D Nav Goal to send goal
  • use 2D Pose Estimate to modify start position

You can play with path_resolution in mission_planning.launch to smooth out the global path.

rviz_mission_planner