nav2d with Turtlebot and Asus Xtion Pro

asked 2016-03-21 06:47:00 -0500

BastiaanVDW gravatar image


I installed and tried the nav2d navigation package for my Turtlebot. I use an Asus Xtion as camera. When I try to run the files, I think everything goes well, but when I call 'rosservice call /StartMapping 3', I get the normal 'response:0', but nothing happens with the robot. Afterwards when I call 'rosservice call /StartExploration 2', I get also the same response, but in another terminal I find these errors: I modified the tutorial3 launch file as shown below (like I found it somewhere on this site):


 <!-- Some general parameters -->

  <param name="use_sim_time" value="false" />
  <rosparam file="$(find nav2d_tutorials)/param/ros2.yaml"/>

  <arg name="base"    value="$(optenv TURTLEBOT_BASE kobuki)"/>  <!--create, roomba -->
  <arg name="battery"   value="$(optenv TURTLEBOT_BATTERY /proc/acpi/battery/BAT0)"/>   <!--/proc/acpi/battery/BAT0 --> 
  <arg name="gui" default="true"/> 
  <arg name="stacks"    value="$(optenv TURTLEBOT_STACKS hexagons)"/>  <!-- circles, hexagons --> 
  <arg name="3d_sensor" value="$(optenv TURTLEBOT_3D_SENSOR asus_xtion_pro)"/>  <!-- kinect, asus_xtion_pro --> 

 <!-- Fake laser -->

  <node pkg="nodelet" type="nodelet" name="laserscan_nodelet_manager" args="manager"/>
  <node pkg="nodelet" type="nodelet" name="depthimage_to_laserscan"
           args="load depthimage_to_laserscan/DepthImageToLaserScanNodelet laserscan_nodelet_manager">
  <param name="scan_height" value="10"/>
  <param name="output_frame_id" value="/camera_depth_frame"/>
  <param name="range_min" value="0.45"/>
  <remap from="image" to="/camera/depth/image_raw"/>
  <remap from="scan" to="/kinect_scan"/>

 <!-- Start the Operator to control the simulated robot -->
 <node name="Operator" pkg="nav2d_operator" type="operator" >
<remap from="scan" to="base_scan"/>
<remap from="cmd_vel" to="cmd_vel_mux/input/teleop" />
<rosparam file="$(find nav2d_tutorials)/param/operator2.yaml"/>
<rosparam file="$(find nav2d_tutorials)/param/costmap2.yaml" ns="local_map" />

 <!-- Start Mapper to genreate map from laser scans -->
 <node name="Mapper" pkg="nav2d_karto" type="mapper">
<remap from="scan" to="base_scan"/>
<rosparam file="$(find nav2d_tutorials)/param/mapper2.yaml"/>

 <!-- Start the Navigator to move the robot autonomously -->
 <node name="Navigator" pkg="nav2d_navigator" type="navigator">
<rosparam file="$(find nav2d_tutorials)/param/navigator2.yaml"/>

 <node name="GetMap" pkg="nav2d_navigator" type="get_map_client" />
 <node name="Explore" pkg="nav2d_navigator" type="explore_client" />
 <node name="SetGoal" pkg="nav2d_navigator" type="set_goal_client" />

 <!-- RVIZ to view the visualization -->
 <node name="RVIZ" pkg="rviz" type="rviz" args=" -d $(find nav2d_tutorials)/param/tutorial3.rviz" />


I don't know much about ROS, and I'm very new to these software packages. Can someone take a look to these files (I included the tf_tree, the rqt_dot file and the parameter files)

Have I forgotten an essential step? Do I have to run some other things?


edit retag flag offensive close merge delete


In your ros.yaml file, why is your laser frame also base_link? Also, I don't think you need to remap from scan to base_scan. That was only for the stage simulator.

pgigioli gravatar imagepgigioli ( 2016-03-21 13:20:24 -0500 )edit

The laser frame was indeed a mistake, I changed it with the real laser frame. After deleting the remapping, the turtlebot is still doing nothing...

BastiaanVDW gravatar imageBastiaanVDW ( 2016-03-22 18:00:59 -0500 )edit

Keep the edits I suggested and also change the remapping of cmd_vel to "mobile_base/commands/velocity". This will send velocity commands directly to the mobile base. This should at least make the /StartMapping work.

pgigioli gravatar imagepgigioli ( 2016-04-04 10:20:26 -0500 )edit