Problems with gmapping and Husky A200
Hi to all,
I'm trying to build a 2D map by using Husky A200, IMU and a SICK laser with ROS Indigo. The IMU sensor is places at the center of the robot while the SICK laser is placed 40 centimeters over the IMU sensor.
I moved the robot indoor for few meters and I recorded a bag file which contains different topics like:
/tf
/scan
/imu/data
/odometry/filtered
...
This is the bag file: download bag 15MB.
Then, I use these commands in order to try to build the map:
roscore
rosparam set use_sim_time true
roslaunch husky_gazebo husky_empty_world.launch
roslaunch husky_viz view_robot.launch
rosrun gmapping slam_gmapping scan:=scan
rosbag play --clock test1.bag
When I run RVIZ, I get some errors and I can't build the map. I set /map as fixed frame. The errors are:
For frame [base_laser]: No transform to fixed frame [map]
frame [laser] does not exist
Should I use /odom as fixed frame?
I think the problem is that I don't have a tf for the laser, but I don't understand how to solve this problem. Can you help me, please?
EDIT: I already tried to use the husky gmapping demo instead of rosrun gmapping slam_gmapping scan:=scan, but I have the same problem. This is the content of the gmapping.launch file used by Husky in the navigation tutorial. Do you think the problem is in this code line:
<remap from="scan" to="$(arg scan_topic)"/>
at the bottom of the file ?
<launch>
<arg name="scan_topic" default="scan" />
<node pkg="gmapping" type="slam_gmapping" name="slam_gmapping">
<rosparam>
odom_frame: odom
base_frame: base_link
map_frame: map
map_update_interval: 0.5 # Publish new map
maxUrange: 5.5 # Should be just less than sensor range
maxRange: 6.1 # Should be just greater than sensor range
particles: 100 # Increased from 80
# Update frequencies
linearUpdate: 0.3
angularUpdate: 0.5
temporalUpdate: 2.0
resampleThreshold: 0.5
# Initial Map Size
xmin: -100.0
ymin: -100.0
xmax: 100.0
ymax: 100.0
delta: 0.05
# All default
sigma: 0.05
kernelSize: 1
lstep: 0.05
astep: 0.05
iterations: 5
lsigma: 0.075
ogain: 3.0
lskip: 0
llsamplerange: 0.01
llsamplestep: 0.01
lasamplerange: 0.005
lasamplestep: 0.005
</rosparam>
<remap from="scan" to="$(arg scan_topic)"/>
</node>
</launch>
I have downloaded and played your bag. I realized that your /scan topic has frame id as "laser" but your tf tree has no transform from "base_link" to "laser". The error msg you saw makes sense too. You might have missed out this transform or made some mistake with the setting up of scan topic
For the scan topic, I only run my SICK with rosrun lms1xx LMS1xx_node _host:=192.168.1.10 without doing anything else. Can you suggest me how to create the transformation for the scan, please? I tried: rosrun tf static_transform_publisher 0 0 1 0 0 0 base_link laser 100 with no result.
Any tip to solve this problem?
It is a good direction to try static transform. Did you run this static transform during recording or playback? I think it s best if you do when recording. Please do so and upload the new bag. I will try to run gmapping with it
I run this tf: rosrun tf static_transform_publisher 0.3 0 0.4 0 0 0 base_link laser 100 while recording a new bag file. What do you think about it? Now I can see the laser in my tf tree, but it isn't working anyway.. :(
I have played your latest bag. I was able to see the map from gmapping. I used both methods (rosrun and your launch file), both are showing the map on rviz. No error is shown in the rosout of gmapping. Maybe you can try to remove and reinstall gmapping? (Im using ros indigo by the way)
Yes, now I'm able to build the 2D map correctly! Just a question: why I'm not able to set a navigation goal and make the robot navigate towards it inside the built map? What I have to do if I want to achieve this result? Gmapping can't do this?
This bug was fixed a while ago but never bloomed here. As for the nav goal, are just running gmapping or the gmpapping demo?
move_base
is used to move the robot.