kittito_rosbag入坑教程

kittito_rosbag入坑教程

 

 

github链接:https://github.com/ethz-asl/kitti_to_rosbag

准备

  • ubuntu 16.04
  • ros
    在root下操作

执行

# 使用tmux分屏
# 开一个terminal
roscore

#再开一个terminal rosrun kittito_rosbag kitti_rosbag_converter calibration_path dataset_path output_path
#cd 到数据路径下
touch testbag.bag
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

实际运行的2011_09_26_drive_0001,结果如下:

Timestamps: 
1317013345967791872 1317013357004624640
Timestamps: 
1317013345961661696 1317013356998492672
Timestamps: 
1317013345961178112 1317013356998005504
Converted 108 entries into a rosbag.

查看转换后的rosbag.bag文件信息

rosbag info testbag.bag

结果如下:

path:        testbag.bag
version:     2.0
duration:    11.0s
start:       Sep 26 2011 13:02:25.96 (1317013345.96)
end:         Sep 26 2011 13:02:36.00 (1317013357.00)
size:        786.5 MB
messages:    1296
compression: none [432/432 chunks]
types:       geometrymsgs/PoseStamped      [d3812c3cbc69362b77dc0b19b345f8f5]
             geometry_msgs/TransformStamped [b5764a33bfeb3588febc2682852579b0]
             sensor_msgs/CameraInfo         [c9a58c1b0b154e0e6da7578cb991d214]
             sensor_msgs/Image              [060021388200f6f0f447d0fcd9c64743]
             sensor_msgs/PointCloud2        [1158d486dd51d683ce2f1be655c3c181]
             tf/tfMessage                   [94810edda583a504dfda3829e70d7eec]
topics:      /tf                 108 msgs    : tf/tfMessage
             cam00/camera_info   108 msgs    : sensor_msgs/CameraInfo
             cam00/image_raw     108 msgs    : sensor_msgs/Image
             cam01/camera_info   108 msgs    : sensor_msgs/CameraInfo
             cam01/image_raw     108 msgs    : sensor_msgs/Image
             cam02/camera_info   108 msgs    : sensor_msgs/CameraInfo
             cam02/image_raw     108 msgs    : sensor_msgs/Image
             cam03/camera_info   108 msgs    : sensor_msgs/CameraInfo
             cam03/image_raw     108 msgs    : sensor_msgs/Image
             pose_imu            108 msgs    : geometry_msgs/PoseStamped
             transform_imu       108 msgs    : geometry_msgs/TransformStamped
             velodyne_points     108 msgs    : sensor_msgs/PointCloud2


踩坑之路

错误1:环境依赖出错

解决方案

git clone 下面的9个依赖包到src目录下:

catkinsimple
glog_catkin(同时,apt-get install libgoole-glog-dev)
gflags_catkin (同时,apt-get install libgflags-dev)
minkindr
eigen_catkin
eigen_checks
catkin_boost_python_buildtool
minkindr_ros
numpy_eigen

大概步骤:

cd */src
git clone  #下载上述的9个依赖

cd /catkinws #回到工作空间,catkin_make必须在工作空间下执行
catkin_make #开始编译
source ~/catkin_ws/devel/setup.bash #刷新环境

都调试好后,就可以按照官方给定的方法进行执行了。

https://github.com/ethz-asl/kitti_to_rosbag/issues/15

错误2:git clone所有包后,catkin_make时报错:

[ 1%] Performing configure step for 'glog_src'
[ 5%] Built target gflags_src
/bin/sh: 1: autoreconf: not found
glog_catkin/CMakeFiles/glog_src.dir/build.make:108: recipe for target 'glog_catkin/glog_src-prefix/src/glog_src-stamp/glog_src-configure' failed
make[2]: [glog_catkin/glog_src-prefix/src/glog_src-stamp/glog_src-configure] Error 127
CMakeFiles/Makefile2:956: recipe for target 'glog_catkin/CMakeFiles/glog_src.dir/all' failed
make[1]:
[glog_catkin/CMakeFiles/glog_src.dir/all] Error 2
make[1]: 正在等待未完成的任务....
[ 6%] Built target catkin_boost_python_test
[ 7%] Built target eigen_checks
[ 11%] Built target numpy_eigen_test
Makefile:138: recipe for target 'all' failed
make:
[all] Error 2
Invoking "make -j4 -l4" failed

解决方案:

apt-get install autoconf

错误3:ModuleNotFoundError: No module named ‘em’

Traceback (most recent call last):
File “/opt/ros/kinetic/share/gencpp/cmake/…/…/…/lib/gencpp/gencpp.py”, line 41, in
import genmsg.template_tools
File “/opt/ros/kinetic/lib/python2.7/dist-packages/genmsg/template_tools.py”, line 39, in
import em
ModuleNotFoundError: No module named ‘em’

解决方案:

pip install empy

注意python环境,我这里一开始使用了anaconda3的环境,导致一直报错,可以在

cd ~
gedit .bashrc

将anaconda的else...fi中间内容都注释掉,其他注意事项详见链接

http://www.pianshen.com/article/2083174168/


错误4:AttributeError: 'module' object has no attribute 'Interpreter' #63

解决方案:

pip uninstall em
pip install empy

注意python环境

https://github.com/ros/genmsg/issues/63


错误5:Libraries have been installed in:...

解决方案:https://segmentfault.com/q/1010000006781567

你可能感兴趣的:(ROS,ubuntu)