How to define the braking force in btRaycastVehicle.setBrake

Post Reply
christian-nils
Posts: 1
Joined: Wed Mar 30, 2016 11:31 am

How to define the braking force in btRaycastVehicle.setBrake

Post by christian-nils »

Hello everyone,

In a java-based driving simulator the jbullet library is used to simulate the vehicle's physics. The RaycastVehicle class is used to create the vehicle. This java class is equivalent to the btRaycastVehicle c++ class.
My problem is relatively easy. I want to give a brake force to the function btRaycastVehicle.setBrake(btScalar brake,int wheelIndex) equivalent to a given deceleration. i.e. If I want to decelerate the vehicle with 10m/s^2 what value for (btScalar) brake should have?

In the simulator program, the authors defined the braking force as brakeForce = 0.004375 * vehicleMass * decelerationValue.
I guess the 0.004375 has been evaluated using a heuristic approach.

Anyone of you knows how to define the (btScalar)brake input ? What is the dimension of this variable (force, torque, impulse, ... )?

In the document (https://docs.google.com/document/d/18ed ... ef=2&pli=1) it is said that m_brake is a brake torque. Is it right?

Another point, that maybe someone can help me with, from the line 610 in btRaycastVehicle.cpp we have the definition of the rollingFriction. In the case of an engineForce, the timeStep is taken into account. In the case of brakingForce, the timeStep is not taken into account. Why is that?

Code: Select all

if (wheelInfo.m_engineForce != 0.f)
				{
					rollingFriction = wheelInfo.m_engineForce* timeStep;
				} else
				{
					btScalar defaultRollingFrictionImpulse = 0.f;
					btScalar maxImpulse = wheelInfo.m_brake ? wheelInfo.m_brake : defaultRollingFrictionImpulse;
					btWheelContactPoint contactPt(m_chassisBody,groundObject,wheelInfo.m_raycastInfo.m_contactPointWS,m_forwardWS[wheel],maxImpulse);
					rollingFriction = calcRollingFriction(contactPt);
				}
Thank you for your help,

Greetings,

Christian-Nils
Post Reply