carla-simulator / carla

Open-source simulator for autonomous driving research.
http://carla.org
MIT License
11.35k stars 3.68k forks source link

Record on move like AirSim #6351

Open Taekbum opened 1 year ago

Taekbum commented 1 year ago

Hi. I'm trying to save rgb sensor data from replay. What I want to do is save image only when the ego vehicle moves in the replay. Since I couldn't find convenient setting similar to 'RecordOnMove' in AirSim, I implemented it by the following code: (in _parse_image method of Cameramanager class)

if self.recording: file_name = os.path.join(self.folder_name, '{}.png'.format(image.frame)) if self.prev_location is not None: current_location = self._parent.get_location() x_curr= current_location.x; y_curr = current_location.y; z_curr = current_location.z x_prev = self.prev_location.x; y_prev = self.prev_location.y; z_prev = self.prev_location.z if x_curr != x_prev or y_curr != y_prev or z_curr != z_prev: image.save_to_disk(file_name) else: image.save_to_disk(file_name) self.prev_location = self._parent.get_location() else: self.prev_location = None

However, the images saved from different replay were not synchronized. Do you know the reason? Are there any solutions? Thank you.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.