Hinge->setMaxMotorForce physical units

Post Reply
sina
Posts: 1
Joined: Thu Jun 09, 2016 6:23 pm

Hinge->setMaxMotorForce physical units

Post by sina »

Hi,
I'm trying to control a car which has hinge constraints for wheels and I have been checking out the hing2Vehicle example of bullet for this. in a hinge constraint I'm wondering what is the physical unit which setMaxMotorForce() accepts. I tried to figure this out with this experiment :
I have a box chassis with 4 wheels.
each wheel weighs 2.5Kg and chassis weighs 1Kg so total car weighs 11Kg.
the ground(btbox object) has a slop of pi/10
I have set a very high tire friction coeff (1000) so there is no slippage (not a considerable amount).
What I'm trying to do is that if I apply the correct MaxMotorForce the car should stay steady rather than going down the slope due to gravity pull. here are my calculations
Fpull = m*g*sin(pi/10) = 11 * 9.8 * 0.309 = 33.312 N
in which "m" is mass of the vehicle, "g" is gravity and "pi/10" is the ground slope, and Fpull is the force which pulls the car down the slope.
since wheel radius is 1 meter then the torque required to counteract the gravity pull is
T = Fpull/r = 33.312/1 = 33.312 Nm
and also as we have 4 wheels and torques will be distributed equally between them then torque required for each wheel should be 33.31/4 = 8.32 Nm

I did implement a car with specs I have mentioned above and if I do "setMaxMotorForce(TheMotorAxis,8.32)" then the car easily climbs the slope(rather than staying steady and not moving).
I tried reducing this value until the car stays steady and the value has to be 0.0724 ( It took a long time to figure this). I assume bullet is using other units than Nm here but what is that unit?
benelot
Posts: 350
Joined: Sat Jul 04, 2015 10:33 am
Location: Bern, Switzerland
Contact:

Re: Hinge->setMaxMotorForce physical units

Post by benelot »

Just to give you a maybe sub-par answer (better than none). I believe that bullet does not use a particular unit for everything. Dimensions are meters, masses are kgs (I believe), but other than that, I am not sure if there are units for the torque. Just create a constant factor and see if it holds for higher and lower torque settings. If it holds, you found the linear factor to use Nm.
Post Reply