Git Product home page Git Product logo

kitti_to_rosbag's Introduction

kitti_to_rosbag

Dataset tools for working with the KITTI dataset raw data ( http://www.cvlibs.net/datasets/kitti/raw_data.php ) and converting it to a ROS bag. Also allows a library for direct access to poses, velodyne scans, and images.

Rosbag converter usage example

rosrun kitti_to_rosbag kitti_rosbag_converter calibration_path dataset_path output_path

(No trailing slashes).

rosrun kitti_to_rosbag kitti_rosbag_converter ~/data/kitti/2011_09_26 ~/data/kitti/2011_09_26/2011_09_26_drive_0035_sync ~/data/kitti/2011_09_26/2011_09_26_drive_0035_sync/testbag.bag

Library API Example

#include <opencv2/highgui/highgui.hpp>

#include "kitti_to_rosbag/kitti_parser.h"

int main(int argc, char** argv) {
  google::InitGoogleLogging(argv[0]);
  google::ParseCommandLineFlags(&argc, &argv, false);
  
  const std::string calibration_path = "/Users/helen/data/kitti/2011_09_26";
  const std::string dataset_path =
      "/Users/helen/data/kitti/2011_09_26/2011_09_26_drive_0035_sync";

  kitti::KittiParser parser(calibration_path, dataset_path, true);

  parser.loadCalibration();
  parser.loadTimestampMaps();

  uint64_t timestamp;
  kitti::Transformation pose;
  parser.getPoseAtEntry(0, &timestamp, &pose);

  std::cout << "Timestamp: " << timestamp << " Pose: " << pose << std::endl;

  pcl::PointCloud<pcl::PointXYZI> ptcloud;
  parser.getPointcloudAtEntry(0, &timestamp, &ptcloud);

  std::cout << "Timestamp: " << timestamp << " Num points: " << ptcloud.size()
            << std::endl;

  cv::Mat image;
  parser.getImageAtEntry(0, 3, &timestamp, &image);

  cv::imshow("Display window", image);
  cv::waitKey(0);

  return 0;
}
  

kitti_to_rosbag's People

Contributors

alexmillane avatar helenol avatar rdube avatar zacharytaylor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kitti_to_rosbag's Issues

tf data doesn't seem to exactly match up with gnd truth

Hi,

I generated a bag file of sequence 6 of the KITTI odometry dataset from the raw data recordings using this tool. I then wrote a simple node that uses the rosbag tf to lookup the left camera coordinate pose at each frame and then stores this trajectory. I used the KITTI evaluation tool to plot and evaluate the trajectory.

06

As you can see, it is pretty close to the ground truth which is expected. However, I would expect it to be exactly the same or very near to it as the paper (Are we ready for autonomous driving? the KITTI vision benchmark suite) says: "The ground truth for visual odometry/SLAM is directly given by the output of the GPS/IMU localization unit projected into the coordinate system of the left camera after rectification."

I did a pose by pose comparison and plotted the translation RMSE (distance between the poses) and for the most part it is close, but there is some significant error at some frames. I haven't been able to determine why there is that error as the ground truth is from the GPS/IMU data directly and the tfs are based off of that.

rmse_6_rmse

Do you have any idea what may be the cause?

Thanks,
Vincent

Issue with tf Accuracy

Hi,

I was able to generate the bag with the raw dataset but I noticed that there are some issues with the tf generated by this tool. It is not consistent with what is in the figure from the paper
image

As you can see in a screenshot I made from playing the bag generated of 2011_09_30_drive_0020, the cameras are not in the correct poses. Additionally, it appears that the left and right cameras are flipped, as well as their relative positions (order from left to right is 1, 3, 0, 2 instead of 2, 0, 3, 1). The displacement between the GPS/IMU and the velodyne along the y axis should be 0.32 but it is over a centimeter off while the calibration file was correct).
image

Do you have any ideas about this discrepancy?

Thanks!

Converted 0 entries into a rosbag

Hi,
I am trying to convert a kitti dataset including velodyne points data to ros bag file. but i got nothing described as below.Please help me.Looking forward to your reply.
~/new$ rosrun kitti_to_rosbag kitti_rosbag_converter ~/2011_09_30 ~/2011_09_30/2011_09_30_drive_0018_sync ~/2011_09_30/2011_09_30_drive_0018_sync/testbag.bag
Transform T_vel_imu: 0.999998 0.000755307 -0.00203583 -0.808676
-0.000785403 0.99989 -0.014823 0.319556
0.00202441 0.0148245 0.999888 -0.799723
0 0 0 1
Header: calib_time
Header: corner_dist
Header: S_00
Header: K_00
Header: D_00
Header: R_00
Header: T_00
Header: S_rect_00
S_rect header: S_rect_00 substring: 00
Index: 0
Image size: 1226
370
Header: R_rect_00
R_rect header: R_rect_00 substring: 00
Header: P_rect_00
P_rect header: P_rect_00 substring: 00
Projection mat:
707.091 0 601.887 0
0 707.091 183.11 0
0 0 1 0
Header: S_01
Header: K_01
Header: D_01
Header: R_01
Header: T_01
Header: S_rect_01
S_rect header: S_rect_01 substring: 01
Index: 1
Image size: 1226
370
Header: R_rect_01
R_rect header: R_rect_01 substring: 01
Header: P_rect_01
P_rect header: P_rect_01 substring: 01
Projection mat:
707.091 0 601.887 -379.815
0 707.091 183.11 0
0 0 1 0
Header: S_02
Header: K_02
Header: D_02
Header: R_02
Header: T_02
Header: S_rect_02
S_rect header: S_rect_02 substring: 02
Index: 2
Image size: 1226
370
Header: R_rect_02
R_rect header: R_rect_02 substring: 02
Header: P_rect_02
P_rect header: P_rect_02 substring: 02
Projection mat:
707.091 0 601.887 46.8878
0 707.091 183.11 0.11786
0 0 1 0.00620322
Header: S_03
Header: K_03
Header: D_03
Header: R_03
Header: T_03
Header: S_rect_03
S_rect header: S_rect_03 substring: 03
Index: 3
Image size: 1226
370
Header: R_rect_03
R_rect header: R_rect_03 substring: 03
Header: P_rect_03
P_rect header: P_rect_03 substring: 03
Projection mat:
707.091 0 601.887 -333.46
0 707.091 183.11 1.93013
0 0 1 0.0033185
Timestamps:
1317354879239671138 1317355166873855198
Timestmap map for pose:
0 1317354879239671138
1 1317354879339674871
2 1317354879449844116
3 1317354879549899805
4 1317354879649661572
5 1317354879759723721
6 1317354879859652224
7 1317354879969841973
8 1317354880069681926
9 1317354880179646560
10 1317354880279638825
11 1317354880379646169
12 1317354880489718145
13 1317354880589646284
14 1317354880699630353
15 1317354880799641771
16 1317354880899650506
17 1317354881009691427
18 1317354881109602236
19 1317354881219625026
20 1317354881319646878
21 1317354881429598862
22 1317354881529654388
23 1317354881629602010
24 1317354881739624119
25 1317354881839613629
26 1317354881949679793
27 1317354882049709093
28 1317354882159648197
29 1317354882259575648
30 1317354882359594370
31 1317354882469732926
32 1317354882569617745
33 1317354882679593681
34 1317354882779612005
35 1317354882889604160
36 1317354882989826886
37 1317354883089577182
38 1317354883199584692
39 1317354883299561752
40 1317354883409585864
41 1317354883509616690
42 1317354883609577215
43 1317354883719604098
44 1317354883819547273
45 1317354883929576174
46 1317354884029738174
47 1317354884139570174
48 1317354884239552444
49 1317354884339576167
50 1317354884449598788
51 1317354884549600814
52 1317354884659543630
53 1317354884759555797
54 1317354884869722257
55 1317354884969673069
56 1317354885069590001
57 1317354885179550864
58 1317354885279773518
59 1317354885389531990
60 1317354885489764990
......ignored......
2701 1317355160623931357
2702 1317355160733926111
2703 1317355160833929352
2704 1317355160944105079
2705 1317355161043945401
2706 1317355161154005567
2707 1317355161253894662
2708 1317355161353904540
2709 1317355161464013409
2710 1317355161563973835
2711 1317355161673916462
2712 1317355161773937290
2713 1317355161883923168
2714 1317355161984014987
2715 1317355162083903899
2716 1317355162193907629
2717 1317355162293872327
2718 1317355162403946763
2719 1317355162503930638
2720 1317355162603873968
2721 1317355162713964033
2722 1317355162813877667
2723 1317355162923859411
2724 1317355163024061443
2725 1317355163133890790
2726 1317355163233896092
2727 1317355163333891659
2728 1317355163444061508
2729 1317355163544051407
2730 1317355163653854740
2731 1317355163753851389
2732 1317355163853887192
2733 1317355163964019863
2734 1317355164063900658
2735 1317355164173855766
2736 1317355164273899339
2737 1317355164373840151
2738 1317355164484069158
2739 1317355164583839695
2740 1317355164693841145
2741 1317355164793823284
2742 1317355164903861714
2743 1317355165004056429
2744 1317355165103814526
2745 1317355165213816778
2746 1317355165313846051
2747 1317355165423832648
2748 1317355165523898867
2749 1317355165623843882
2750 1317355165733841017
2751 1317355165833902978
2752 1317355165944063182
2753 1317355166043879561
2754 1317355166143857794
2755 1317355166253838553
2756 1317355166353796730
2757 1317355166463955177
2758 1317355166563847756
2759 1317355166673922370
2760 1317355166773808392
2761 1317355166873855198
Timestamps:
1317354879232045294 1317355166873161582
Timestamps:
1317354879236475648 1317355166877463552
Timestamps:
1317354879236453632 1317355166877464320
Timestamps:
1317354879230314752 1317355166871328000
Timestamps:
1317354879229829120 1317355166870839040
Converted 0 entries into a rosbag.

Can not build with catkin_make

The error is shown as:
CMake Error at /home/fangkd/catkin_ws/devel/share/catkin_simple/cmake/catkin_simple-extras.cmake:38 (find_package):
By not providing "Findgflags_catkin.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"gflags_catkin", but CMake did not find one.

Could not find a package configuration file provided by "gflags_catkin"
with any of the following names:

gflags_catkinConfig.cmake
gflags_catkin-config.cmake

Add the installation prefix of "gflags_catkin" to CMAKE_PREFIX_PATH or set
"gflags_catkin_DIR" to a directory containing one of the above files. If
"gflags_catkin" provides a separate development package or SDK, be sure it
has been installed.
Call Stack (most recent call first):
kitti_to_rosbag/CMakeLists.txt:5 (catkin_simple)

Compiling error

When I try to compile the code, I have the following error:

/home/user/anaconda3/lib/libpng16.so.16: undefined reference to `inflateValidate@ZLIB_1.2.9'
collect2: error: ld returned 1 exit status
kitti_to_rosbag/kitti_to_rosbag/CMakeFiles/tiny_disp_view.dir/build.make:556: recipe for target '/home/binbin/catkin_ws/devel/lib/kitti_to_rosbag/tiny_disp_view' failed
make[2]: *** [/home/binbin/catkin_ws/devel/lib/kitti_to_rosbag/tiny_disp_view] Error 1
CMakeFiles/Makefile2:5578: recipe for target 'kitti_to_rosbag/kitti_to_rosbag/CMakeFiles/tiny_disp_view.dir/all' failed
make[1]: *** [kitti_to_rosbag/kitti_to_rosbag/CMakeFiles/tiny_disp_view.dir/all] Error 2

No clues on the "libpng16.so.16: undefined reference to `inflateValidate@ZLIB_1.2.9'
collect2: error: ld returned 1 exit status".

abort (core dumped)

Hi all,
I am trying to convert a kitti dataset to ros bag file. but i am getting the error described below.
please help.,

Timestmap map for pose:
terminate called after throwing an instance of 'rosbag::BagIOException'
what(): Error opening file: datasets/kitti/2011_09_26
*** Aborted at 1504541712 (unix time) try "date -d @1504541712" if you are using GNU date ***
PC: @ 0x7fb00104ac37 gsignal
*** SIGABRT (@0x3e800002801) received by PID 10241 (TID 0x7fb00303e9c0) from PID 10241; stack trace: ***
@ 0x7fb00104acb0 (unknown)
@ 0x7fb00104ac37 gsignal
@ 0x7fb00104e028 abort
@ 0x7fb001653535 __gnu_cxx::__verbose_terminate_handler()
@ 0x7fb0016516d6 (unknown)
@ 0x7fb001651703 std::terminate()
@ 0x7fb001651922 __cxa_throw
@ 0x7fb00192e1ca rosbag::ChunkedFile::open()
@ 0x7fb00192e375 rosbag::ChunkedFile::openWrite()
@ 0x7fb001912a3d rosbag::Bag::openWrite()
@ 0x7fb001918185 rosbag::Bag::open()
@ 0x409891 kitti::KittiBagConverter::KittiBagConverter()
@ 0x409136 main
@ 0x7fb001035f45 __libc_start_main
@ 0x4096ea (unknown)
Aborted (core dumped)

Can not use catkin_make to build it

Dear author,
Thank your for your bright and outstanding work.
But when I try use catkin_make to build this package.
Some errors happend

error info

CMake Error at kitti_to_rosbag/kitti_to_rosbag/CMakeLists.txt:4 (find_package):
By not providing "Findcatkin_simple.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"catkin_simple", but CMake did not find one.

Could not find a package configuration file provided by "catkin_simple"
with any of the following names:

catkin_simpleConfig.cmake
catkin_simple-config.cmake

Add the installation prefix of "catkin_simple" to CMAKE_PREFIX_PATH or set
"catkin_simple_DIR" to a directory containing one of the above files. If
"catkin_simple" provides a separate development package or SDK, be sure it
has been installed.

-- Configuring incomplete, errors occurred!
See also "/home/snake/kitti_to_rosbag_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/snake/kitti_to_rosbag_ws/build/CMakeFiles/CMakeError.log".

I do not know how to solve it. SO I come here to make a issue.
Thx!

Is there any instructions?

I am a beginner, it would be appreciative if there is any tutorial or instruction on how to run it.

Is it possible to transform only odometry data set (velodyne laser data, 80 GB) into rosbag?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.