ERROR: Laser has to be mounted planar
Hi,
I'm using Ubuntu 14.04 and ROS indigo.
I published the TF using static_transform_publisher from tf package.
Using the following tag to publish the transformation between the base_link and the camera_link:
<node pkg="tf" type="static_transform_publisher" name="link2_broadcaster" args="0 0 1 0 0 0 1 base_link camera_link 100" />
When I started slam_gmapping node it gives the following error:
Laser has to be mounted planar! Z-coordinate has to be 1 or -1, but gave: 0.00000
The problem is solved when I changed the Y coordinate to 1 or -1 . But this is not the right transformation of my robot.
UPDATE:
This is my transformation tree
and this is the launch file I used:
<launch>
<node pkg="tf" type="static_transform_publisher" name="base_to_camera_broadcaster" args="0 0 1 0 0 0 1 base_link camera_link 100" />
<include file="$(find pointcloud_to_laserscan)/launch/pointcloud_to_laserscan.launch"/>
<node pkg="roboteq_motor" type="odom" name="odom"/>
<node pkg="gmapping" type="slam_gmapping" name="slam_gmapping" output="screen">
<rosparam>
odom_frame: odom
map_update_interval: 1.0
maxUrange: 30.0
maxRange: 60.0
sigma: 0.05
kernelSize: 1
lstep: 0.05
astep: 0.05
iterations: 5
lsigma: 0.075
ogain: 3.0
lskip: 0
linearUpdate: 0.5
angularUpdate: 0.436
temporalUpdate: -1.0
resampleThreshold: 0.5
particles: 80
xmin: -1.0
ymin: -1.0
xmax: 1.0
ymax: 1.0
delta: 0.025
llsamplerange: 0.01
llsamplestep: 0.01
lasamplerange: 0.005
lasamplestep: 0.005
base_frame: base_link
</rosparam>
</node>
</launch>
Note: I didn't publish The odom to base_link transformation using static_transform_publisher because the node odom publishes this information using sendTransform. Is that ok? or they are different things?
Have you also tried
args="0 0 1 0 0 0 base_link camera_link 100"
? (Alternative format for static_transform_publisher.)It doesn't look like gmapping is plotting your map in the base_link frame and therefore there is probably another transformation in the chain - take care to see that the sensor frame and the map frame (and not sensor frame and base link frame) are planar wrt to each other.
@slivingston Thank you but didn't work
@2ROS0 How can I make sure that the sensor frame and the map frame are planar? It might me a basic thing but I'm a beginner. Also, I updated the question with an image of my transformation tree, please take a look at it.
Can you update the launch file you're using to start the gmapping node? @saraalsiari
@2ROS0 Yes I updated it and the same problem occurs. Please see the new update in the question.
@saraalsiari, I got the same problem, did you solve it by any chance?