I am using the Pioneer-P3dx robot. The robot subscribes to the /cmd_vel topic. I am using the teleop_twist_keyboard in order to publish messages to that topic and then the robot moves according to the keystrokes. The callback function which is called upon subscription is the following:
Code: Select all
local wheel_radius = 0.2 local wheel_separation = 0.5 local speed_left = (msg['linear']['x'] + msg['angular']['z'] * wheel_separation/2)/wheel_radius local speed_right = (msg['linear']['x'] - msg['angular']['z'] * wheel_separation/2)/wheel_radius simSetJointTargetVelocity(motorLeft, speed_left) simSetJointTargetVelocity(motorRight, speed_right)
For example, for linear velocity of 2 m/s and radius 1 meter the robot moves straight, but if radius is 0.1 meters it does not move straight. Instead it does a curved motion.
I think that there is something with the physics that I miss, could anyone explain?
Thanks in advance!
EDIT: The original post about the simulation step was inaccurate. I figured that out!