Experiments with Real Vehicles
Once your motion planner works in simulation, you can run it with the muCars in the lab. The workflow is the same as in simulation (see Running the Lab); this page lists what is different and what to check before and during an experiment.
Important
Before your first experiment, get access and an introduction as described in Running Your Planner in the Lab, and follow the Lab Rules and Safety. Never run an experiment with real vehicles alone for the first time.
Differences to the Simulation
A planner that works in simulation does not automatically work with real vehicles. The most common differences:
Localization: the pose comes from the IPS camera instead of a perfect simulation. It is noisy, arrives with a delay and can drop out, e.g. when a vehicle is outside the camera view or its LEDs are covered.
Vehicle dynamics: real vehicles slip, react with a delay and differ slightly from each other. A trajectory that is exactly feasible in simulation may not be feasible on the track, see Vehicle Limits and Simulation.
Timing: the planner, the bridge and the vehicles communicate over Wi-Fi. Messages can be delayed or lost. Commands should be valid slightly in the future (
valid_after_stamp) and cover more than one period.Battery: the speed and acceleration of a vehicle decrease with the battery voltage.
Test your planner in simulation with the same map, vehicle IDs and planner period first, and start with low speeds on the real track.
Checklist Before the Experiment
Central workstation
Start the central workstation and check that it is connected to the lab router, see Network.
Check that the time server is running, because the vehicles synchronize their clocks with it, see Central Workstation:
chronyc trackingStart the Zenoh router, unless it already runs, and the lab in
ROS_DOMAIN_ID=21withRMW_IMPLEMENTATION=rmw_zenoh_cpp, see Middleware and Running the Lab. The muCars only talk to the lab through Zenoh.
Vehicles
Charge the batteries. The vehicle controller reports a warning below 50 % and an error below 12 % battery in the diagnostics.
Place the vehicles on the track within the camera view, ideally on the lanes your planner expects.
Switch the vehicles on. Each vehicle connects to the
CPM-LabWi-Fi and starts the vehicle controller automatically. The IP address of vehicle<id>is192.168.1.<20 + id>:# Check that vehicle 3 is reachable ping 192.168.1.23Wait until the vehicles appear as online in the Control Center.
muCars on the track, switched on and placed on the lanes in the view of the camera
Experiment
Start the map server with the map of the lab track.
Start the IPS with the configuration of your lab, e.g.
munich2.yaml. Check in RViz or Lichtblick that every vehicle is shown at its real position and with the correct heading.Deploy with your planner and Record experiment enabled. Only the vehicles that are online are deployed, so switch off or remove vehicles you do not want to use.
Start the experiment and watch the vehicles. Stop the experiment immediately if a vehicle behaves unexpectedly.
Stop the experiment, wait until the recording is complete and switch the vehicles off.
Safety Mechanisms
Several mechanisms stop the vehicles automatically. Knowing them helps to understand why an experiment stopped:
Event |
Reaction |
|---|---|
Stop in the Control Center |
All vehicles stop, the bridge and the internal planner are stopped. |
A vehicle state is missing for more than 1 s |
The bridge stops the experiment for all vehicles. |
No IPS update for a vehicle for more than 3 s |
The vehicle stops if it follows a path or trajectory. |
The recorder fails |
The control flow stops the experiment. |
A stop trigger on |
The experiment is stopped. Any component, including your planner, can request this. |
A stopped vehicle holds the stop state for at least one second. Every experiment can always be stopped with Stop in the Control Center; keep it within reach during the experiment.
Inspecting a Vehicle
export ROS_DOMAIN_ID=21
# State of vehicle 3, including battery voltage and IPS update age
ros2 topic echo /lab/vehicle_3/vehicleState
# IPS observation of vehicle 3
ros2 topic echo /lab/vehicle_3/vehicleObservation
# Diagnostics of all vehicles, e.g. battery and controller status
ros2 topic echo /diagnostics
If a vehicle is online but not visible in the IPS, check that it is within the camera view and that its LEDs are not covered. See Troubleshooting Guide for network and time synchronization problems.