Architecture

This page maps the CPM Lab from the repositories down to the nodes, domains and topics. The design pages describe the components in detail.

        ---
config:
  layout: elk
  startOnLoad: false

---
flowchart LR
   subgraph UI["User interface"]
      CC[Control Center<br/>RViz panel / Lichtblick]
   end
   subgraph D21["Lab domain (ROS_DOMAIN_ID=21), namespace /lab"]
      CF[Control flow]
      MS[Map server]
      IPS[IPS]
      REC[Experiment recorder]
      VC["Vehicle controllers<br/>(muCars or simulated)"]
      VIS[Map visualization]
   end
   subgraph D1["Planner domain (ROS_DOMAIN_ID=1), namespace /planner"]
      BR[Bridge]
      HLC[Motion planner]
   end
   CC -->|services| CF
   CF -->|catalog, state, status| CC
   CF -. starts .-> MS & IPS & REC & BR & HLC
   CF -. starts simulated .-> VC
   MS -->|map| BR & VIS & CF
   IPS -->|vehicleObservation| VC
   VC -->|vehicleState| BR & IPS & CF
   BR -->|command| VC
   BR <-->|vehicle_states, map, system_trigger, command| HLC
   REC -. records .-> D21
    

Components of the CPM Lab and their ROS domains

The bridge is a single process with one node in each domain, so it appears in both.

Repositories and Packages

The workspace ros2-workspace-lab contains the meta package cpm_lab (launch files and RViz configuration) and the component repositories as submodules in src/. ros2-workspace-vehicle builds the vehicle controller for the muCars from the same components.

Repository

Package

Executables, launch files and role

bridge

cpm_lab_control_flow

cpm_lab_control_flow_node, default.launch.xml. Starts and stops all other processes on request, see Design: Control Flow.

cpm_lab_bridge

bridge_node, default.launch.xml. Connects the lab and planner domains, see Design: Bridge.

common-interfaces

cpm_lab_lab_msgs, cpm_lab_map_msgs, cpm_lab_control_flow_msgs, cpm_lab_evaluation_msgs, cpm_lab_commonroad_msgs

Messages and services, see Interface Reference and Changing Messages and Services.

maps

cpm_lab_map_server, cpm_lab_maps

cpm_lab_map_server_node; the Lanelet2 maps of the lab, see Design: Map Server.

cpm_lab_map_server_visualization

Converts the map into RViz markers (/lab/map_markers).

cpm_lab_lanelet2_extension_cpp, cpm_lab_lanelet2_extension_py

Projection and message conversion of Lanelet2 maps for C++ and Python.

cpm_lab_lane_control_light

lane_control_light_node, lane_control_node: the lane control lights of the lab.

indoor-positioning-system

cpm_lab_indoor_positioning_system

The IPS, see Understanding the Indoor Positioning System.

cpm_lab_ips_calibration

cpm_calibrate, see IPS Camera Calibration.

mid-level-controller

cpm_lab_mid_level_controller

The vehicle controller and its simulation, see Understanding the Vehicle Controller.

high-level-controller

cpm_lab_central_routing, cpm_lab_path_tracking, cpm_lab_example_planner_py, cpm_lab_sfb_py, cpm_lab_sigmarl_control, cpm_lab_manual_control_cpp, cpm_lab_manual_control_py

Motion planners, each with a default.launch.xml, see Understanding the Motion Planner.

evaluation

cpm_lab_experiment_recorder, cpm_lab_evaluation

The recorder and cpm_eval, see Design: Recording and Evaluation.

visualization

cpm_lab_control_center and the RViz plugins

The Control Center and the RViz displays, see Design: Visualization.

lichtblick (separate)

Lichtblick extensions

The Control Center and displays for Lichtblick, see Visualization with Lichtblick.

Launch Files

The meta package cpm_lab has three launch files. All start the control flow and the map visualization (cpm_lab_headless.launch.xml); everything else is started by the control flow on request.

Launch file

Adds

cpm_lab_rviz.launch.xml

RViz with the Control Center panel (rviz/default.rviz)

cpm_lab_foxglove.launch.xml

The Foxglove bridge on port 8765 for Lichtblick

cpm_lab_headless.launch.xml

Nothing; meant to be included, e.g. on a headless central workstation

Conventions

  • Domains and namespaces: nodes in the lab domain use /lab, nodes in the planner domain /planner. Vehicle topics are /lab/vehicle_<id>/<topic> with IDs 1 to 20.

  • Components: nodes are rclcpp_components with a default.launch.xml and their parameters in config/default.yaml; the parameters are validated at startup, see Style Guide.

  • Processes: the control flow starts every component as its own process (ros2 run or ros2 launch) with the domain ID it needs, so a crash only affects that component.

  • QoS: vehicle states, commands in the lab domain and observations are best effort; commands from the planner are reliable; the map and the control flow state are transient local, so late subscribers receive the last message.

  • User data: everything a user creates goes to $CPM_LAB_HOME (default ~/cpm_lab): experiments/, calibrations/, maps/ and ips/, see User Data Directory.