Error while building map in slam_gmapping.
I have recorded the rosbag data by simulating the robot in gazebo. when i try to build the map with the command rosrun gmapping slam_gmapping scan:=/rrbot/laser/scan _base_frame:=Base_plate
by playing back the logged data i endup with bellow error
[ WARN] [1453398305.145461344]: Laser has to be mounted planar! Z-coordinate has to be 1 or -1, but gave: -0.03982
My robot model
After few iterations, i was able to build the map by modifying joint origin in my URDF file from <origin xyz="0 -0.040 0.2" rpy="-29.85 4.75 0"/>
to <origin xyz="0 -1 0.2" rpy="-29.85 4.75 0"/>
but my robot model become weird as below.
URDF file
<?xml version="1.0"?>
<robot
name="JMbot1.1">
<link
name="Base_plate">
<inertial>
<origin
xyz="9.28103095721513E-18 -0.00236910483921667 1.69476737537172E-19"
rpy="0 0 0" />
<mass
value="0.553781193313651" />
<inertia
ixx="0.00613802647719325"
ixy="-5.56633892187664E-20"
ixz="1.95355359086701E-19"
iyy="0.0102825986842358"
iyz="3.22575373206078E-19"
izz="0.00414996381570526" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://jmbot1_description/meshes/Base_plate.STL" />
</geometry>
<material
name="">
<color
rgba="0.749019607843137 0.749019607843137 0.749019607843137 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://jmbot1_description/meshes/Base_plate.STL" />
</geometry>
</collision>
</link>
<link
name="Wheel_R">
<inertial>
<origin
xyz="-0.0394771489417549 -5.20417042793042E-18 1.73472347597681E-18"
rpy="0 0 0" />
<mass
value="0.450643534719172" />
<inertia
ixx="0.000916081598048295"
ixy="1.48930401404157E-20"
ixz="-9.81573335914851E-21"
iyy="0.000533948766711724"
iyz="0"
izz="0.000533948766711724" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://jmbot1_description/meshes/Wheel_R.STL" />
</geometry>
<material
name="">
<color
rgba="0.749019607843137 0.749019607843137 0.749019607843137 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://jmbot1_description/meshes/Wheel_R.STL" />
</geometry>
</collision>
</link>
<joint
name="Wheel_R"
type="continuous">
<origin
xyz="0.135 0.015 0"
rpy="1.4389236251236 -2.11732407237853E-18 3.14159265358979" />
<parent
link="Base_plate" />
<child
link="Wheel_R" />
<axis
xyz="1 0 0" />
</joint>
<link
name="Wheel_L">
<inertial>
<origin
xyz="-0.0394771489417549 1.21430643318377E-17 8.67361737988404E-18"
rpy="0 0 0" />
<mass
value="0.450643534719172" />
<inertia
ixx="0.000916081598048295"
ixy="2.90916462871053E-20"
ixz="-2.96782618561828E-20"
iyy="0.000533948766711724"
iyz="5.42101086242752E-20"
izz="0.000533948766711724" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://jmbot1_description/meshes/Wheel_L.STL" />
</geometry>
<material
name="">
<color
rgba="0.749019607843137 0.749019607843137 0.749019607843137 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://jmbot1_description/meshes/Wheel_L.STL" />
</geometry>
</collision>
</link>
<joint
name="Wheel_L"
type="continuous">
<origin
xyz="-0.135 0.015 0"
rpy="0.928716950811488 0 0" />
<parent
link="Base_plate" />
<child
link="Wheel_L" />
<axis
xyz="-1 0 0" />
</joint>
<link
name="Castor_F">
<inertial>
<origin
xyz="-4.16333634234434E-17 0 0.03116425205832"
rpy="0 0 0" />
<mass
value="0.0565552012132997" />
<inertia
ixx="2.44755054701354E-05"
ixy="-6.23799465703127E-37"
ixz="-1.01877548447475E-20"
iyy="2.44755054701354E-05"
iyz="8 ...
Well, you have roll and pitch values, even though the scanner seems to be planar.
Are you sure that those values are correct? I'd say that you would need only a yaw value...
Maybe add or link to your urdf for people to help...
I have added my URDF file for reference. please point out where have i gone wrong.