Simulator Recorder



This feature allows to record and reenact a previous simulation. All the events happened are registered in the recorder file. There are some high-level queries to trace and study those events.

  • Simulation playback
  • Queries

Recording

Learn how to Record Microsoft Flight Simulator. If you enjoy flying Microsoft Flight Simulator, then why not learn to record your screen, so you can share yo. The iSAFT SpaceWire Simulator / Recorder is an advanced Data Front End with traffic generation capabilities that simulates SpaceWire devices or Instruments, enabling S/C integration tests before the availability of Flight Models. It also constitutes a high performing, modern network traffic capture, recording and analysis tool for the.

All the data is written in a binary file on the server side only. However, the recorder is managed using the carla.Client.

Actors are updated on every frame according to the data contained in the recorded file. Actors in the current simulation that appear in the recording will be either moved or re-spawned to emulate it. Those that do not appear in the recording will continue their way as if nothing happened.

Important

By the end of the playback, vehicles will be set to autopilot, but pedestrians will stop.

The recorder file includes information regarding many different elements.

  • Actors — creation and destruction, bounding and trigger boxes.
  • Traffic lights — state changes and time settings.
  • Vehicles — position and orientation, linear and angular velocity, light state, and physics control.
  • Pedestrians — position and orientation, and linear and angular velocity.
  • Lights — Light states from buildings, streets, and vehicles.

To start recording there is only need for a file name. Using , / or : characters in the file name will define it as an absolute path. If no path is detailed, the file will be saved in CarlaUE4/Saved.

By default, the recorder is set to store only the necessary information to play the simulation back. In order to save all the information previously mentioned, the argument additional_data has to be configured when starting the recording.

Note

Additional data includes: linear and angular velocity of vehicles and pedestrians, traffic light time settings, execution time, actors' trigger and bounding boxes, and physics controls for vehicles.

To stop the recording, the call is also straightforward.

Note

As an estimate, 1h recording with 50 traffic lights and 100 vehicles takes around 200MB in size.

Simulation playback

A playback can be started at any point during a simulation. Besides the path to the log file, this method needs some parameters.

ParameterDescriptionNotes
startRecording time in seconds to start the simulation at.If positive, time will be considered from the beginning of the recording.
If negative, it will be considered from the end.
durationSeconds to playback. 0 is all the recording.By the end of the playback, vehicles will be set to autopilot and pedestrians will stop.
cameraID of the actor that the camera will focus on.Set it to 0 to let the spectator move freely.


Setting a time factor

The time factor will determine the playback speed. It can be changed any moment without stopping the playback.

Simulator Recorder
ParameterDefaultFast motionSlow motion
time_factor1.0>1.0 <1.0


Important

If time_factor>2.0, the actors' position interpolation is disabled and just updated. Pedestrians' animations are not affected by the time factor.

Tape Recorder Simulator

When the time factor is around 20x traffic flow is easily appreciated.

Recorded file

The details of a recording can be retrieved using a simple API call. By default, it only retrieves those frames where an event was registered. Setting the parameter show_all would return all the information for every frame. The specifics on how the data is stored are detailed in the recorder's reference.

  • Opening information. Map, date and time when the simulation was recorded.

  • Frame information. Any event that could happen such as actors spawning or collisions. It contains the actors' ID and some additional information.

  • Closing information. Number of frames and total time recorded.

Queries

Collisions

Vehicles must have a collision detector attached to record collisions. These can be queried, using arguments to filter the type of the actors involved in the collisions. For example, h identifies actors whose role_name = hero, usually assigned to vehicles managed by the user. There is a specific set of actor types available for the query.

  • h = Hero
  • v = Vehicle
  • w = Walker
  • t = Traffic light
  • o = Other
  • a = Any

Note

The manual_control.py script assigns role_name = hero for the ego vehicle.

The collision query requires two flags to filter the collisions. The following example would show collisions between vehicles, and any other object.

The output summarizes time of the collision, and type, ID and description of the actors involved.

Important

Simulation Recording Software

As it is the hero or ego vehicle who registers the collision, this will always be Actor 1.

The collision can be reenacted by using the recorder and setting it seconds before the event.

In this case, the playback showed this.

Blocked actors

Simulation recording software

Detects vehicles that where stucked during the recording. An actor is considered blocked if it does not move a minimum distance in a certain time. This definition is made by the user during the query.

ParameterDescriptionDefault
min_timeMinimum seconds to move `min_distance`.30secs.
min_distanceMinimum centimeters to move to not be considered blocked.10cm.

Note

Signal simulator recorder

Sometimes vehicles are stopped at traffic lights for longer than expected.

The following example considers that vehicles are blocked when moving less than 1 meter during 60 seconds.

The output is sorted by duration, which states how long it took to stop being 'blocked' and move the min_distance.

The vehicle 173 was stopped for 336 seconds at time 36 seconds. Reenact the simulation a few seconds before the second 36 to check it out.

Sample python scripts

Some of the provided scripts in PythonAPI/examples facilitate the use of the recorder.

  • start_recording.py starts the recording. The duration of the recording can be set, and actors can be spawned at the beginning of it.
ParameterDescription
-fFilename.
-n (optional)Vehicles to spawn. Default is 10.
-t (optional)Duration of the recording.
  • start_replaying.py starts the playback of a recording. Starting time, duration, and actor to follow can be set.
ParameterDescription
-fFilename.
-s (optional)Starting time. Default is 10.
-d (optional)Duration. Default is all.
-c (optional)IDof the actor to follow.
  • show_recorder_file_info.py shows all the information in the recording file. By default, it only shows frames where an event is recorded. However, all of them can be shown.
ParameterDescription
-fFilename.
-s (optional)Flag to show all details.

Simulator Record Screen

  • show_recorder_collisions.py shows recorded collisions between two flags of actors of types A and B. -t = vv would show all collisions between vehicles.
ParameterDescription
-fFilename.
-tFlags of the actors involved.
h = hero
v = vehicle
w = walker
t = traffic light
o = other
a = any
  • show_recorder_actors_blocked.py lists vehicles considered blocked. Actors are considered blocked when not moving a minimum distance in a certain time.
ParameterDescription
-fFilename.
-t (optional)Time to move -d before being considered blocked.
-d (optional)Distance to move to not be considered blocked.

Now it is time to experiment for a while. Use the recorder to playback a simulation, trace back events, make changes to see new outcomes. Feel free to say your word in the CARLA forum about this matter.

Simulator Recorder (was SimCap) allows you to grab screenshots for the App Store with a single button click. Create professional-quality demonstration videos and walkthroughs with ease. Show potential customers your game or app in action. Promote it on YouTube and other video sharing sites.

Features

Signal Simulator Recorder

  • Capture video and screenshots quickly and easily with a single click.
  • Encodes to standard H.264 QuickTime moive format.
  • Encodes voice-over audio as AAC with a choice of three quality options.
  • Records audio from the Simulator using the open source Soundflower audio plug-in.
  • SimCap grabs sequences of screenshots, making choosing that perfect action shot for the App Store easier than ever.
  • Simulator Recorder records just the iPhone Simulator screen, no matter where its window is or what orientation it's in. No more fiddling around setting up immovable recording rectangles or cropping down full screen videos.
  • Choose to show mouse (finger) position, taps and multi-touch in videos.
  • Simulator Recorder can automatically crop away the iPhone status bar.
  • Available as 14-day free trial, after which time movies are watermarked.