Skip to content

Generating Your Own Dataset

Chahat Deep Singh edited this page May 15, 2020 · 4 revisions

Generating Your Own Dataset via Blender

Note: This simulator setup is derived from the University of Zurich group. Source: RPG Davis Simulator

Tested to ROS-Kinetic and ROS-Melodic.

Setting-up Simulation Environment

Create a workspace

PATH_to_ROS_WS=~/prg_ws
cd $PATH_to_ROS_WS/src

Clone UZH's RPG DVS ROS Modified Repository

git clone https://github.com/prgumd/EVDodgeNet
cp -r EVDodgeNet/simulator/* $PATH_to_ROS_WS/src
cd $PATH_to_ROS_WS/src

Install catkin_simple

git clone https://github.com/catkin/catkin_simple

Install OpenEXR (Source)

sudo apt install libopenexr-dev
cd $PATH_to_ROS_WS/src
wget http://excamera.com/files/OpenEXR-1.2.0.tar.gz -O - | tar -xz
cd OpenEXR-1.2.0
sudo python setup.py install
cd $PATH_to_ROS_WS/src

Install Blender Modelling Software

sudo apt-get install blender

(Works with Blender 2.71 to 2.79 only)

Install Python3

sudo apt install python3-dev python3-numpy python3-yaml

If you want to manually change the path for numpy and yaml, please change it in scripts/prepare_dataset.py.

Build and source the simulator

catkin build dvs_simulator_py
echo $PATH_to_ROS_WS/devel/setup.bash >> ~/.bashrc
source ~/.bashrc

For .zsh users

echo $PATH_to_ROS_WS/devel/setup.zsh >> ~/.zshrc
source ~/.zshrc

Generating Dataset

Enter the blender file name (not the entire path) to the launch files Note: The blender file MUST be present in the $PATH_to_ROS_WS/src/rpg_davis_simulator/datasets/scenes/ folder.

  • Edit line 7 and 8:
vim $PATH_to_ROS_WS/src/rpg_davis_simulator/launch/PRG_render.launch
  • Edit line 6:
vim $PATH_to_ROS_WS/src/rpg_davis_simulator/launch/PRG_simulate.launch

Generate Bag Files

roslaunch dvs_simulator_py PRGFlow_render.launch
roslaunch dvs_simulator_py PRGFlow_simulate.launch

Kill rosnode(s) (Optional)

rosnode kill -a
cd ~/prg-sim_ws/rpg_davis_simulator/datasets/rosbags

Load Bag File

Check $PATH_to_ROS_WS/src/rpg_davis_simulator/datasets/rosbags/ folder

BAG_FILE='<Bag_File_Name_in rosbags folder>' #Excluding '.bag'

Create Folder to extract images from Bag File

mkdir -p $BAG_File\/frames
python ../../scripts/bag_to_images.py --output_dir=$BAG_FILE/frames --image_topic=/dvs/image_raw --bag_file=$BAG_FILE\.bag
rostopic echo -b $BAG_FILE\.bag -p /dvs/pose >> $BAG_FILE\/$BAG_FILE\_pose.csv

All available ROS topics

  • /dvs/events: event stream
  • /dvs/camera_info: camera calibration
  • /dvs/pose: groundtruth transformation T_w_cam (transforms points from camera frame to world frame)
  • /dvs/image_raw: intensity image (grayscale, 8bits)
  • /dvs/depth_map: depth map (32bits floating-point)