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

How to crate a map with gmapping and hokuyo laser

asked 2014-06-09 02:45:09 -0600

guigui gravatar image

updated 2014-06-11 22:43:10 -0600

I have already install my hokuyolaser ( urg_node ) and it's working perfectly when I see the data on rviz. But when I launch " roslaunch turtlebot_navigation gmapping_demo.launch" , after i had launch roscore - minimal.launch - urg_node , it's my kinect data on the screen.

I want to save a map with my lidar and not with my kinect.

How should I do to save a map with my Hokuyo and not with my kinect? This is my file gmapping_demo.launch :

<launch> <include file="$(find turtlebot_bringup)/launch/3dsensor.launch">
<arg name="rgb_processing" value="false"/>
<arg name="depth_registration" value="false"/>
<arg name="depth_processing" value="false"/>

<arg name="scan_topic" value="/scan"/> </include>
<include file="$(find turtlebot_navigation)/launch/includes/gmapping.launch.xml"/>
<include file="$(find turtlebot_navigation)/launch/includes/move_base.launch.xml"/>
</launch<>

I want to change for my hokuyo but how ?

Thanks a lot


I have create my file : laser_gmapping_demo.launch and now, my laser working and I can make a map. Thanks for all answer.

<launch>


  <node pkg="urg_node" type="urg_node" name="laser_scan">
    <param name="port" value="/dev/ttyACM0"/>
    <param name="frame_id" value="base_link"/>
    <param name="calibrate_time" type="bool" value="true"/>  
    <param name="intensity" type="bool" value="false"/>
    <param name="min_ang" value="-2.356194437"/>   
    <param name="max_ang" value="2.35619443"/>    
    <param name="cluster" value="1"/>
    <remap from="scan" to="base_scan" />
  </node>

  <node pkg="tf" type="static_transform_publisher" name="base_link_to_base_laser_link" args="0.058 0 0.125 0.0 0.0 3.1416 /base_link /base_laser_link 100" />
  <node pkg="tf" type="static_transform_publisher" name="base_footprint_to_base_link" args="0 0 0 0 0 0  /base_footprint /base_link 100" />


  <!-- Run self-filter -->
  <node name="gmapping" pkg="gmapping" type="slam_gmapping" args="scan:=base_scan" output="screen">
    <param name="linearUpdate" value="0.1" />
    <param name="angularUpdate" value="0.05" /> 
    <param name="xmin" value="-20" />   
    <param name="ymin" value="-20" />
    <param name="xmax" value="20" />    
    <param name="ymax" value="20" />
    <param name="maxUrange" value="6" />        
  </node>

  <!--- Run gmapping -->
  <include file="$(find turtlebot_navigation)/config/gmapping.launch.xml" >
    <arg name="scan_topic" value="scan_filtered" />
  </include>

  <!--- Run Move Base and Robot Pose EKF -->
  <include file="$(find turtlebot_navigation)/laser/move_base_laser.launch" />

</launch>
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2014-06-09 07:11:16 -0600

dornhege gravatar image

You need to give gmapping the correct laser topic. I assume that the standard turtlebot config uses the laser scans from the kinect as default. Just check what topic is used for your hokuyo and change the remapping in the gmapping_demo.launch.

edit flag offensive delete link more
1

answered 2014-06-10 21:00:32 -0600

Ken_in_JAPAN gravatar image

updated 2014-06-10 21:07:08 -0600

At first, you need to execute the next command on your terminal of turtlebot PC after connecting hokuyo USB wth turtlebot PC.

 sudo chmod a+rw /dev/ttyACM0
You might know that. Next, You need to edit launch file. I edited minimal.launch to use both kinect and hokuyo on my turtlebot.

minimal.launch
<launch>
  <arg name="base"       default="$(optenv TURTLEBOT_BASE kobuki)"/>  
  <arg name="battery"    default="$(optenv TURTLEBOT_BATTERY /sys/class/power_supply/BAT0)"/>  
                                                                
  <arg name="stacks"     default="$(optenv TURTLEBOT_STACKS hexagons)"/>  
  <arg name="3d_sensor"  default="$(optenv TURTLEBOT_3D_SENSOR kinect)"/>  
  <arg name="sensor"  default="$(optenv TURTLEBOT_SENSOR hokuyo)"/>
  <arg name="simulation" default="$(optenv TURTLEBOT_SIMULATION false)"/>
  <arg name="tf_prefix" default="" />

  <param name="/use_sim_time" value="$(arg simulation)"/>

  <include file="$(find turtlebot_bringup)/launch/includes/robot2.launch.xml">
    <arg name="base" value="$(arg base)" />
    <arg name="stacks" value="$(arg stacks)" />
    <arg name="3d_sensor" value="$(arg 3d_sensor)" />
    <arg name="sensor" value="$(arg sensor)" />
  </include>

  <include file="$(find turtlebot_bringup)/launch/includes/mobile_base.launch.xml">
    <arg name="base" value="$(arg base)" />
  </include>

  <include file="$(find turtlebot_bringup)/launch/includes/netbook.launch.xml">
    <arg name="battery" value="$(arg battery)" />
  </include>

  <!-- launch the hokuyo sensor -->
  <include file="$(find turtlebot_bringup)/launch/hokuyo/hokuyo.launch">
    <arg name="name" value="hokuyo" />
    <arg name="tf_prefix" value="$(arg tf_prefix)" />
    <arg name="publish_tf" value="false" /> 
  </include>
</launch>

I brought hokuyo.launch with sudo apt-get install ros-hydro-hokuyo. I move my turtlebot with this launch. I hope that your turtlebot will move.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2014-06-09 02:45:09 -0600

Seen: 5,575 times

Last updated: Jun 11 '14