Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to replay and record from a driving perspective #7650

Closed
ldt17 opened this issue May 15, 2024 · 5 comments
Closed

How to replay and record from a driving perspective #7650

ldt17 opened this issue May 15, 2024 · 5 comments

Comments

@ldt17
Copy link

ldt17 commented May 15, 2024

May I ask how to replay and record from a driving perspective.

I conducted an experiment using version 0.9.14 by setting up cameras to simulate normal driving. However, I found that some of the data was not collected and I want to replay the record again. But using the start.replaying.py file will track the vehicle from a top view perspective, which is not what I want

@ldt17
Copy link
Author

ldt17 commented May 15, 2024

In other words, may I ask if I can collect the data I need again during the replay process

@PatrickPromitzer
Copy link

I believe you mean this kind of recording
https://carla.readthedocs.io/en/0.9.15/adv_recorder/#recording

If you use Carla to create an recording, it will not save sensor data.
The sensor have to be added and recorded separately.
If you look in the start_replaying.py file, you can see that it will only spawn an default sensor.

If you wan to record sensor data, you can read the sensor_synchronization.py example.
This example is using synchronization mode, to make sure that you received the sensor date before the simulation continues.
Without synchronization mode, it could happen that you finished the simulation and close the connection, but the last few sensor items had no time to transfer to your code or being saved.

@ldt17
Copy link
Author

ldt17 commented May 16, 2024

@PatrickPromitzer Thank you for your reply!

However, my experiment included other external data such as eye tracker, so I was wondering if it was possible to re collect the data through replay recording instead of conducting a new experiment.

Thank you !

@PatrickPromitzer
Copy link

PatrickPromitzer commented May 16, 2024

If I understood it right, you have 3 types of data.

  1. Carla recording
  • Actor data
  1. Sensor data
  • Camera
  1. External data
  • Eye tracker

The sensor_synchronization.py example it will spawn Actors, add sensors to the vehicle, and collect the sensor data.

The Carla recording is spawning the Actors (if I understood it right), but doesn't add Sensors.
In that case, you need to add the sensors yourself, after starting the replay of the recording.

Python Script

  1. start replay
  2. activate synchronization mode (I am not sure if the replay supports that)
  3. add Sensors and listener
  4. world.tick() (send simulation update request)
  5. collect the data
  6. save Sensor data and Simulation data
  7. repeat 4-6 until the replay finished

The tricky part could be, if you have many similar Actors and can't find the Actor you need. For that reason it is a better to add a role name to the important Actors. (ScenarioRunner does that)

Is this the solution you want, or do you want something else?
It that is not what you want, it would be nice to give an example.

@ldt17
Copy link
Author

ldt17 commented May 16, 2024

@PatrickPromitzer Yes, as you said, I am trying your method. Thank you very much!

@Madecu Madecu closed this as completed May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants