tud-hri / joan

JOAN is an software package that allows to perform human-in-the loop experiments in the open source driving simulator CARLA. JOAN facilitates communication between human input devices and CARLA, the implementation of haptic feedback, systematically storing experiment data, and the automatic execution of experiments with multiple experimental conditions.
Other
11 stars 7 forks source link

How to save camera snapshots #7

Closed KAArunmoli closed 1 year ago

KAArunmoli commented 2 years ago

Hello,

I would love to take snapshots with joan as the Ego vehicle is driven by human. Is it possible to do so in Joan ?

OlgerSiebinga commented 2 years ago

hi @KAArunmoli!

This is something that is not implemented in JOAN yet. But it should be possible to add it to the carlainterface module. Carla itself has camera objects that return image objects to the python side. These images can be saved.

KAArunmoli commented 2 years ago

Hello @OlgerSiebinga,

Thanks for your reply. Could you tell me in which particular function I need to add these changes ? I tried to change the ego_vehicle.py function (in do() function) but was not able to save the images.

OlgerSiebinga commented 2 years ago

as long as you add it in a do() function in carlainterface it should work. You could add it in an agent, or in the main process. As long as you can get the camera object from the carla client, you should be fine.

KAArunmoli commented 2 years ago

@OlgerSiebinga Do you mean do() or do_while_running() ? Because is see the latter in the carlainterface module

OlgerSiebinga commented 2 years ago

You're right! It's do_while_running()

KAArunmoli commented 2 years ago

Hey @OlgerSiebinga. I tried to add the carla command for saving in the do_while_running() function, but the rendering is not happening because i think CARLA takes time to render the images and JOAN doesnt gives it time to render the images and jump to the next frame. I also tried using Queues so that the images are synchronised, but still it doesnt work. Is there any fix for this issue ?

OlgerSiebinga commented 2 years ago

Hi @KAArunmoli. I'm happy to help but I think I need some extra information to help you.

There are some things you could try:

hopefully, this helps.

KAArunmoli commented 2 years ago

Hi @OlgerSiebinga,

  1. I am trying to take the sanp shots of each frame in the simulation as image.
  2. The current behaviour is able to save to save image but the images are just black.
  3. I dont have the repo yet, but I can share the file with your through you mail address. I have made changes in the CarlaInterface Module and the agentclass module (in ego vehicle)