How to recieve map using turtlebot and kinect

asked 2016-05-08 22:55:42 -0500

zzzZuo gravatar image

updated 2016-05-08 22:58:38 -0500

Im trying to use nav2d package with turtlebot and kinect to map an unknown room. But I couldn't recieve /map from Mapper node.

as you can see on my rqt_graph: image description

tf frame: image description

I can't use /StartMapping 3 and /StartExploration 2. These are the /map and the /Operator/local_map/costmap in RVIZ. image description image description

It has costmap, but has no map.

Here is my launch file:

 <launch>
<!-- Some general parameters -->

<param name="use_sim_time" value="false" />

<rosparam file="$(find nav2d_tutorials)/param/ros.yaml"/>

<arg name="world_file"  default="$(env TURTLEBOT_GAZEBO_WORLD_FILE)"/>

 <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 kinect)"/>  <!-- kinect, asus_xtion_pro --> 

      <include file="$(find gazebo_ros)/launch/empty_world.launch">

      <arg name="use_sim_time" value="true"/>

      <arg name="debug" value="false"/>

      <arg name="gui" value="$(arg gui)" />

      <arg name="world_name" value="$(arg world_file)"/>

      </include> 

      <include file="$(find turtlebot_gazebo)/launch/includes/$(arg base).launch.xml">

      <arg name="base" value="$(arg base)"/>

      <arg name="stacks" value="$(arg stacks)"/>

      <arg name="3d_sensor" value="$(arg 3d_sensor)"/>

      </include>

     <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher">

           <param name="publish_frequency" type="double" value="30.0" />

     </node>

      <!-- 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"/>   <!-- /camera_depth_frame -->

      <param name="range_min" value="0.45"/> 

      <remap from="image" to="/camera/depth/image_raw"/>

      <remap from="scan" to="base_scan"/>  <!-- <remap from="scan" to="base_scan"/>  -->

      </node> 

<!-- 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/operator.yaml"/>

    <rosparam file="$(find nav2d_tutorials)/param/costmap.yaml" ns="local_map" />

</node>

<!-- Start Mapper to genreate map from laser scans -->

<node name="Mapper" pkg="nav2d_karto" type="mapper">

     <remap from="scan" to="base_scan"/>   

       <param name="base_frame" value="base_link"/>

    <param name="odom_frame" value="odom"/>

    <rosparam file="$(find nav2d_tutorials)/param/mapper.yaml"/>

</node>

<!-- Start the Navigator to move the robot autonomously -->

<node name="Navigator" pkg="nav2d_navigator" type="navigator">

    <rosparam file="$(find nav2d_tutorials)/param/navigator.yaml"/>  

</node>

<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" />

</launch>

ros.yaml:

laser_frame: base_laser_link

robot_frame: base_link

odometry_frame: odom

offset_frame: offset

map_frame: map

map_topic: map

laser_topic: scan 

map_service: static_map

costmap.yaml:

global_frame: odom

robot_base_frame: base_link

update_frequency: 5.0

publish_frequency: 1.0

publish_voxel_map: true

static_map: false

rolling_window: true

width: 6.0

height: 6.0

resolution: 0.05

map_type: costmap

track_unknown_space: true

transform_tolerance: 0.3

obstacle_range: 4.0

min_obstacle_height: 0.0

max_obstacle_height: 2.0

raytrace_range: 4.5

robot_radius: 0.18  #turtlrbot radius

inflation_radius: 0.5  #origin 0.75

cost_scaling_factor: 2.0

lethal_cost_threshold: 100

observation_sources: scan

scan: {data_type: LaserScan, expected_update_rate: 0.4 ...
(more)
edit retag flag offensive close merge delete

Comments

What does echo $TURTLEBOT_MAP_FILE give?

janindu gravatar imagejanindu ( 2016-05-09 00:44:37 -0500 )edit

/opt/ros/indigo/share/turtlebot_navigation/maps/willow-2010-02-18-0.10.yaml

zzzZuo gravatar imagezzzZuo ( 2016-05-09 01:07:41 -0500 )edit

Sorry that didn't have anything to do with nav2d package. However I see that you have done remapping from scan to base_scan even though your laser topic is scan in ros.yaml. Would you please comment out the 3 remappings in the launch file and try it again?

janindu gravatar imagejanindu ( 2016-05-09 01:38:18 -0500 )edit

I have commented out the 3 remappings in the launch file, but it still has no map. I really don't know where is the problem caused in this way, thank you for your answer

zzzZuo gravatar imagezzzZuo ( 2016-05-09 02:57:07 -0500 )edit

@zzzZuo Did you solve this problem because I have a similar problem.

paddi00 gravatar imagepaddi00 ( 2016-07-19 15:02:51 -0500 )edit