Skip to main content

Simulation-Data

Simulated Rosbags​

Tested with Python 3.8.10.

Prerequisites​

Comment the python version in kitcar-gazebo-simulation/.python-version (or remove the .python-version file).

In kitcar-gazebo-simulation/simulation/utils/machine_learning/data/record_simulated_rosbag.py change line 88 from

max_duration = kwargs["max_duration"]

to

max_duration = float(kwargs["max_duration"])

Usage​

Convert a simulated "image topic Rosbag" to .png images:

python -m simulation.utils.machine_learning.data.rosbag_to_images --bag 2022-12-04-07-06-46.bag --output_dir out_extract --image_topic /camera/image_raw

Convert a simulated "label topic Rosbag" to a bounding box label file (here: out_extract_label):

python -m simulation.utils.machine_learning.data.rosbag_to_labels --bag 2022-12-04-01-43-40.bag --output_file out_extract_label --label_topic /simulation/label_camera/image_labels

Note: out_extract_label will not be in Darknet format!

To record rosbags of the car driving automatically on a number of roads at once:

  • extract simulated images (w/o labels): kitcar-gazebo-simulation/data/simulated_images/simulated_images.sh
  • extract simulated images with labels: kitcar-gazebo-simulation/data/labeled_images/labeled_images.sh

Further information:

Issues​

TODO: The following command did not work yet:

python -m simulation.utils.machine_learning.data.extract_simulated_images --gui True --road default_road --output_dir out_extract --image_topic /camera/image_raw --label_image_topic /simulation/label_camera/image --label_camera --label_topic /simulation/label_camera/image_labels --label_file out_extract_labels --max_duration 30

record_random_drive.launch (doc) does not work because kitcar_rosbag/record.sh is missing.