Launch rtabmap_ros with kinect2

Install kinect2 drivers[1]

Assume have installed drivers successfully

Note: A new workspace[2] is needed for building with type "Release"

mkdir -p ~/kinect_ws/src
git clone https://github.com/code-iai/iai_kinect2.git
cd iai_kinect2
rosdep install -r --from-paths .
cd ~/kinect2_ws
catkin_make -DCMAKE_BUILD_TYPE="Release"
source ~/kinect2_ws/devel/setup.bash

Launch[3]

Launch kinect2
roslaunch kinect2_bridge kinect2_bridge.launch publish_tf:=true
Launch rtabmap_ros
rosrun tf static_transform_publisher 0 0 0 -1.5707963267948966 0 -1.5707963267948966 camera_link kinect2_link 100
roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start" rgb_topic:=/kinect2/qhd/image_color_rect depth_topic:=/kinect2/qhd/image_depth_rect camera_info_topic:=/kinect2/qhd/camera_info approx_sync:=false

or

roslaunch rtabmap_ros rgbd_mapping_kinect2.launch resolution:=qhd
rosbag record
rosbag record -O kinect_test /tf /kinect2/qhd/image_color_rect /kinect2/qhd/image_depth_rect /kinect2/qhd/camera_info

What matters to me but it might not be helpful to you

At first I am trying to build multiple packages in the catkin_ws

It seems redundant to create another ros workspace, but there are so many packages in catkin_ws, and -DCATKIN_WHITELIST_PACKAGES=[PACKAGE_NAME] did not work in this situation for iai_kinect2 including several packages either.

Add source ~/kinect2_ws/devel/setup.bash to ~/.bashrc didnot work

Perhaps this line cannot be placed before one line source ~/test_ws/devel/setup.bash.

In the end, it solved by putting the line source ~/kinect2_ws/devel/setup.bash after source ~/test_ws/devel/setup.bash.

I guess maybe the source order should be arranged by the time of the packages creating? I don't know.

References:

[1] Ubuntu16.04 安装Kinect2驱动 - CSDN博客
[2] ROS/Tutorials/CreatingPackage - ROS Wiki
[3] rtabmap_ros/Tutorials/HandHeldMapping - ROS Wiki

转载于:https://www.cnblogs.com/williamc17/p/11417144.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值