Skip to content

amslabtech/semantickitti2bag

Repository files navigation

semantickitti2bag

This program was running under Python 2.7, which is out of support today This program runs under ROS Melodic (Python 2.7); if you want to use Noetic or later ROS, you need to modify it to run under Python 3.

"semantickitti2bag" contains helpful python programs to convert SemanticKITTI dataset to rosbag file.

You can convert these dataset easy way :D

rviz_2020_08_02

This repository is based on tomas789's kitti2bag and PRBonn's semantic-kitti-api. These code are MIT Licence.

Data organization

Data must be organized in following format.

direct_tree

SemanticKITTI dataset has voxel data, but this repository doesn't handle.

  • image 0 and 1 is monocolor, and image 2 and 3 is colored.
  • velodyne contains the pointcloud for each scan.Each .bin is list of float32 points in [x, y, z, intensity] format.
  • .label file cantains a uint32 label for each point in the corresponding .bin scan. upper 16 bit contains instance id and lower 16 bit contains semantic label(ex.. car, bicycle, people). This program doesn't implement instance id.
  • poses.txt contain pose in world coordinate as homogenerous matrix. But this file must be loaded with calib.txt otherwise you can't get correct pose.
  • times.txt contains timestamps for each data(LiDAR, image, pose) scan
  • sequencenumber.txt(ex.. 00.txt) contains ground truth poses.

How to install it?

git clone https://github.com/amslabtech/semantikitti2bag

How to run it

cd PLACE/OF/semantickitti2bag
python __main__.py -p /home/****/your_dataset_directory/kitti/dataset/ -s 00
  • -s 00 specify sequence number you must write number as 0 to 00, 1 to 01, 11 to 11.

Publishing Topic

  • Camera data -> sensor_msgs/Image
  • /odom_pose -> nav_msgs/Odometry (Ground Truth, Please read Note)
  • /velodyne_points -> sensor_msgs/PointCloud2
  • /vehicle -> nav_msgs/Pose (Ground Truth) rostopic

TF-Tree

  • Map -> World Coordinate
  • ground_truth -> This tree is not Ground Truth. Ignore it.
  • Vehicle -> Vehicle frame(actually ground truth)
  • velodyne -> This coordinate is same as Vehicle coordinate, This is divided for programming convenience. Screenshot from 2021-02-09 16-56-30

Note

  • This program generates odometry data, but actually odometry data is GROUND TRUTH DATA and its velocity's coordinate is World(map) coordinate, bacause Semantic kitti dataset only contain GT poses. Velocity data is generated from transition from t-1 to t. If you have good idea to solve this problem, please post on issue without hesitation.

  • This program was made by python2.7 on ROS melodic. I didn't tested on ROS noetic or Python3 environment. So if you run this on these environment, please notify how was that on issue :)

Author

Update

  • (2021-6-30) In addition, we added a "label" class to the Point cloud field to represent the semantic class from here as well. Thanks for your help in fixing the code.

License

This repository is under MIT License.