ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

My turtlebot cannot avoid obstacles with Xbox One Kinect

asked 2016-10-09 22:18:06 -0500

graziegrazie gravatar image

updated 2016-10-13 20:15:39 -0500

I use Turtlebot(Kobuki) and Xbox One Kinect(Kinect v2) on Ubuntu16.04 and ROS Kinetic. I succeeded to SLAM and AMCL with turtlebot_navigation package. On the other hand, when turtlebot moved autonomously, it didn't avoid obstacles like walking human. I checked my costmap_common_params.yaml, but I couldn't find any mistakes. If you have some idea, could you please tell me?

When I attached and launch Kinect, I referred to this page. To start SLAM and AMCL, I type following commands. When I launched minimal.launch, 3 nodes(rocon_master, rocon_app_manager, interactions) failed to start. I understand rocon is just a interface to communicate with user, so 3 nodes wake up error don't relate not to avoid obstacles issue.

  1. roslaunch turtlebot_bringup minimal.launch
  2. roslaunch kinect2_bridge kinect2_bridge.launch publish_tf:=true
  3. rosrun depthimage_to_laserscan depthimage_to_laserscan image:=/kinect2/sd/image_depth_rect _output_frame_id:=/base_kinectv2_link
  4. roslaunch turtlebot_navigation gmapping_demo.launch / amcl_demo.launch

To succeed SLAM and AMCL, I mainly changed following files. I didn't change my local_costmap_params.yaml.

  1. 3dsensor.launch
    I commented out from line 43 to the end of file.

  2. turtlebot_library.urdf.xacro
    I added Kinect v2 model. I checked out Kinect v2 one from here and named turtlebot_kinect2_rgb_optical_frame. Furthermore, I defined base_kinect2_link originally. This is because when I used turtlebot_kinect2_rgb_optical_frame, scan data is projected on Y-Z plane, not X-Y plane. I found the reason of this problem is that attitude of turtlebot_kinect2_rgb_optical_frame is not rotated for base_link and base_footprint. So I resolve the problem, I defined base_kinect2_link which attitude is same as base_link and the pose is same as turtlebot_kinect2_rgb_optical_frame.

  3. costmap_common_params.yaml(1), costmap_common_params.yaml(2) I added "sensor_frame" in scan section. The name of the topic publishing Kinect v2 data is "scan".

[CHANGE] I uploaded my configuration files and other ones to GitHub. URL is . If you have a time, please check my files and comment to my problem.

edit retag flag offensive close merge delete


There are other ways to show your configuration files. Upload them to GitHub, put them in as a GIST or use any other of the codes snippet hosters out there...

mgruhler gravatar image mgruhler  ( 2016-10-10 01:38:39 -0500 )edit

Hi, mig. Thank you for your comment. I uploaded my code and configuration files to GitHub and added URL to content. If you check it and comment to me, it's a very glad for me.

graziegrazie gravatar image graziegrazie  ( 2016-10-11 18:29:50 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-10-13 08:22:54 -0500

zhibo gravatar image

It might be because of the laserscan transformation to the robot base, in the yaml file, put min_obstacle_height lower and the max higher.

edit flag offensive delete link more


Hi, zhibo. Thank you for your comment and I'm sorry for my late response. I updated my yamls(common_costmap_params.yaml and ...

graziegrazie gravatar image graziegrazie  ( 2016-10-18 04:39:39 -0500 )edit

local_costmap_params.yaml. But while turtlebot moved autonomously and I suddenly jumped out in front of it, it didn't avoid me. Did I change files as you say?

graziegrazie gravatar image graziegrazie  ( 2016-10-18 04:48:09 -0500 )edit

0.0 won't work for sure, I'd put 0.01 and the max at 1, then if it detects, you can adjust the values.

zhibo gravatar image zhibo  ( 2016-10-18 06:18:17 -0500 )edit

sorry for my late response. I changed min_obstacle_height and max to 0.01 and 1.0, but turtlebot didn't avoid me.

I'll check source code around obstacle avoidance(base local planner and dwa) to resolve this.

If you have other ideas about this problem, could you tell me them?

graziegrazie gravatar image graziegrazie  ( 2016-11-04 00:59:24 -0500 )edit

Question Tools

1 follower


Asked: 2016-10-09 22:18:06 -0500

Seen: 430 times

Last updated: Oct 13 '16