Robot rotates angularly in rviz when linealy accelerated using teleop
Hi,
I am new to ros. I'm trying to implement gmapping
on my custom robot. I am in the initial stage and using ros_arduino_bridge
to publish the odometry and control the motors. I have used teleop_twist_keyboard
to manually navigate the real robot. While doing so, if I linearly move the robot, the robot rotates angularly in rviz,i.e when real robot moves forward, robot model in rviz rotates left. Similarly, when real robot moves in reverse, robot model in rviz rotates right.So I assume that the linear and angular motion are inverted in rviz and real motion. Where would be the probable mistake? How to rectify it?
Here is the odom data published:
header:
seq: 1110
stamp:
secs: 1521979250
nsecs: 547859907
frame_id: "odom"
child_frame_id: "base_link"
pose:
pose:
position:
x: -0.0323011953631
y: 0.131932086548
z: 0.0
orientation:
x: 0.0
y: 0.0
z: -0.668663666459
w: -0.743564994575
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]
twist:
twist:
linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0
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]
---
header:
seq: 1111
stamp:
secs: 1521979250
nsecs: 663502931
frame_id: "odom"
child_frame_id: "base_link"
pose:
pose:
position:
x: -0.0323011953631
y: 0.131932086548
If any other data is needed, please let me know. Thanks in advance. z: 0.0
The tf from odom to base_link is used by rviz, not the odom topic. More information is needed, e.g. where the tf is generated.