Re: [Playerstage-users] Differential wheels -> Speed & Turn Rate From: Brian Gerkey - 2008-03-03 18:13 On Feb 22, 2008, at 4:04 AM, Andy Guest wrote: > I'm trying to work out if player/stage is set up to handle driving > a robot/simulated robot by setting the speed of two wheels > independently rather than setting a speed and turn-rate. http://www.videredesign.com/docs/ERA-Rev-E-manual.pdf > seems to describe setting the mode to VEL2 but I'm not sure if > that's specific to the work they did or part of player/stage. I > can't find anything on the list archives or the player/stage > documentation on VEL2. Is this what I should be looking at ? > > Alternately if player/stage doesn't have a way to drive the robot > in terms of two wheel speeds does anyone know how I'd convert two > paralled velocities into a single forward velocity and a turn rate ? Player's position2d interface does not allow setting of individual wheel speeds, because it abstracts the exact kinematic configuration of the robot. You can control a position2d device by giving either position or velocity targets in the (x,y,yaw) space. It's up to the individual driver how these targets are converted into commands to motors. If you have desired wheel speeds left_vel and right_vel (linear velocities, in meters / second), and you know the AXLE_LENGTH of the robot, you can convert them to dx and dyaw like so: dx = (left_vel + right_vel) / 2.0; dyaw = (right_vel - left_vel) / AXLE_LENGTH; Regarding the Erratic, if you set 'direct_wheel_vel_control' to 1 in the .cfg file, then the driver will send individual wheel speeds to the robot, rather than sending velocity targets and letting the robot's onboard controller try to smoothly achieve them. You may find that you get snappier (but less smooth) response from the motors in this mode. Note that, regardless of what mode you put the driver in, the position2d interface remains unchanged. brian.