Question about odometry
Hello,
I want to use my odometer on my virtual 3wheel robot and I have managed through this code:
<gazebo>
<plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">
<rosDebugLevel>Debug</rosDebugLevel>
<publishWheelTF>True</publishWheelTF>
<publishTF>1</publishTF>
<publishWheelJointState>true</publishWheelJointState>
<alwaysOn>true</alwaysOn>
<updateRate>100.0</updateRate>
<leftJoint>joint_l_wheel</leftJoint>
<rightJoint>joint_r_wheel</rightJoint>
<wheelSeparation>0.20</wheelSeparation>
<wheelDiameter>0.16</wheelDiameter>
<broadcastTF>1</broadcastTF>
<wheelTorque>30</wheelTorque>
<commandTopic>/labrob/cmd_vel</commandTopic>
<odometryFrame>odom</odometryFrame>
<odometryTopic>odom</odometryTopic>
<robotBaseFrame>base_footprint</robotBaseFrame>
<legacyMode>true</legacyMode>
<robotNamespace>labrob</robotNamespace>
</plugin>
</gazebo>
To make gazebo publish on the /labrob/odom
topic. But when I rosotopic echo
it, I see not accurate results, like for example that:
header:
seq: 25109
stamp:
secs: 251
nsecs: 195000000
frame_id: labrob/odom
child_frame_id: labrob/base_footprint
pose:
pose:
position:
x: -0.00832692377833
y: 1.20849063755e-05
z: 0.039996042105
orientation:
x: -2.18465180186e-06
y: -1.97231901816e-05
z: 1.37248233329e-05
w: 0.999999999709
covariance: [1e-05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1e-05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1000000000000.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1000000000000.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1000000000000.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.001]
twist:
twist:
linear:
x: 1.11357837453e-05
y: -1.22072532961e-07
z: 0.0
angular:
x: 0.0
y: 0.0
z: 7.37337779565e-06
covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
---
Regarding the pose.pose.positions
my robot spawns at the origin of the gazebo world, which I believe it defaults at (0,0,0).
Also the pose.pose.position.y
as time passes by, is increasing, while the other two are also changing but in lower rate. My first question is why is the pose.pose.position.y
value increasing in such a high rate ? The same question applies to the other values.
Also about the velocity data twist.twist
even though the velocities echoed are close to zero, which is the real result, since the robot is not moving, are inaccurate. Is this normal or I am doing something wrong ?
Edited:
I noticed that changing some of the values of the base_footprint, also changes the inaccuracy of the odometer, so I am also presenting it below. Maybe the mistake is there:
<link name="base_footprint">
<visual>
<geometry>
<box size="0.001 0.001 0.001"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
</visual>
<inertial>
<mass value="0.0001"/>
<origin xyz="0 0 0"/>
<inertia ixx="1e-6" ixy="0.0" ixz="0.0 ...