0
$\begingroup$

Rosanswers logo

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 :

<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" /> <!-- We must specify an absolute topic name because if not it will be prefixed by "$(arg camera)". Probably is a bug in the nodelet manager : https://github.com/ros/nodelet_core/issues/7

 <arg name="scan_topic" value="/scan" />   </include>     
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>

Originally posted by guigui on ROS Answers with karma: 33 on 2014-06-09

Post score: 1

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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.


Originally posted by dornhege with karma: 31395 on 2014-06-09

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$
0
$\begingroup$

Rosanswers logo

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)"/>  <!-- create, rhoomba -->
  &ltarg name="battery"    default="$(optenv TURTLEBOT_BATTERY /sys/class/power_supply/BAT0)"/>  
                                                                
  <arg name="stacks"     default="$(optenv TURTLEBOT_STACKS hexagons)"/>  <!-- circles, hexagons -->
  &ltarg name="3d_sensor"  default="$(optenv TURTLEBOT_3D_SENSOR kinect)"/>  
  <arg name="sensor"  default="$(optenv TURTLEBOT_SENSOR hokuyo)"/>
  &ltarg 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">
&ltarg name="base" value="$(arg base)" />
    <arg name="stacks" value="$(arg stacks)" />
&ltarg 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">
&ltarg name="base" value="$(arg base)" />
  </include>
  
  <include file="$(find turtlebot_bringup)/launch/includes/netbook.launch.xml">
&ltarg name="battery" value="$(arg battery)" />
  </include>
  
  <!-- launch the hokuyo sensor -->
  <include file="$(find turtlebot_bringup)/launch/hokuyo/hokuyo.launch">
&ltarg name="name" value="hokuyo" />
&ltarg 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.


Originally posted by Ken_in_JAPAN with karma: 894 on 2014-06-10

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.