You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Following the Ego Vehicle with the CARLA Spectator Camera
106
+
107
+
The `spectator_follow` script locks the CARLA spectator (free) camera to the ego vehicle, so the in-simulator view chases the car automatically instead of having to pan manually. It connects to the running CARLA server, looks up the ego actor by its `role_name`, and updates the spectator transform at a fixed rate.
108
+
109
+
Run it in a separate terminal while CARLA and the Autoware bridge are running:
110
+
111
+
```bash
112
+
ros2 run autoware_carla_interface spectator_follow
|`--role`|`ego_vehicle`|`role_name` attribute of the ego actor to follow |
122
+
|`--distance`|`8.0`| Meters behind the ego vehicle (use `0` for a top-down view) |
123
+
|`--height`|`4.0`| Meters above the ego vehicle |
124
+
|`--pitch`|`-15.0`| Camera pitch in degrees (negative looks down) |
125
+
|`--rate`|`30.0`| Update rate in Hz |
126
+
127
+
For a top-down view directly above the ego vehicle:
128
+
129
+
```bash
130
+
ros2 run autoware_carla_interface spectator_follow --distance 0 --height 30 --pitch -90
131
+
```
132
+
133
+
Press `Ctrl+C` to stop the script. It will keep retrying if the ego actor is not yet spawned, and re-acquire it if it is removed and respawned.
134
+
105
135
## Inner-workings / Algorithms
106
136
107
137
The `InitializeInterface` class is key to setting up both the CARLA world and the ego vehicle. It fetches configuration parameters through the `autoware_carla_interface.launch.xml`.
0 commit comments