# Uniform velocity for wheels

Hi everyone,

I’m working at the robot model with 3 wheels using the VehicleControl and I’ve noticed that the method that moves the wheel give an acceleration value (accelerate(int wheel, float force)), I want know if there is a way to bring the wheel to a constant velocity. For example if I set the acceleration for the two wheels the velocity increases with uniformly accelerated motion.

Actually there is the setLinearVelocity method but it treats the entire PhysicsRigidBody.

the value is absolute, there is no built-in ramping

@normen said:
the value is absolute, there is no built-in ramping

Sorry but i don't understand what do you mean for "ramping".

It is a “constant velocity” as you put it. The wheel is instantly at maximum rotation when you set the value. Of course the vehicle doesn’t immediately start to move due to inertia abut if you want that then you don’t want physics and should just move the spatials.

I know that the velocity makes a ramp, my problem is that I need to set a constant velocity (obviously after a transitory) for single wheel. The core of my robot comunicates with the two motors (in this case, the two front wheels) giving them a constant velocity to reach, actually there isn’t a method that can check wheel velocity, I can only check the entire robot velocity with gettCurrentVehicleSpeedKmHour method so i can’t make a control like: “if wheel A velocity is > 20 then set acceleration for the wheel A to 0”.

Sorry but I was searching a way to implement that because the only way to steer my robot is to give it two different wheel velocity.

http://i.imgur.com/ZZR99.jpg

:brainsout: …I said it does NOT make a ramp it IS CONSTANT.

Edit: and yes, what you describe basically is the right approach. The acceleration value is more of a force you apply to the wheels.

How can be constant If, setting the two acceleration for the two wheels (A=40 and B=40) I saw clearly that printing in output the velocity of the entire robot with getCurrentVehicleSpeedKmHour I see that it encrease like a ramp? It hasn’t a constant velocity! :?

Edit: let me give you another question, at the moment how can I calculate the angular velocity of the wheel? If i can get this parameter it would be more easy regulate the accelleration to mantain the angular velocity constant.

Do you really want me to repeat everything I say two to three times? Its because of inertia. The force that you apply to the wheels does not ramp.

I’ve edited the post, sorry but there are some language incomprehensions.

There is no angular velocity of the wheel, the rotation is determined by contact and the vehicle speed. Its not a physical factor, its only used to visually rotate the wheel.

As I said for your use using hingejoints and cylinders is probably way better.

well whatever have fun.

I don’t realy know how to approach the problem with hingejoints and cilinders, the vehicle model help me because I can interact with single wheel, that will determine the trajectory. Unfortunately I must use this type of interaction because the software that interact with the 3D robot only comunicate giving velocities for single wheel. However, I’ve noticed that there is a getDeltaRotation for the wheel,if I do: [(rotation2-rotation1)/(t2-t1)] where rotation2 is taked at t2 and rotation1 is taked at t1 I can get the angular velocity, is the correct way?

Sorry about that, the last question, what does mean in the getDeltaRotation definition: “returns how many degrees the wheel has turned since the last physics step”? What kind of step is? I need to know if there is the possibility to use this method to calculate angular velocity.

I’m really sorry but I’m in serious trouble…