btRaycastVehicle Wheel Rotation and Stuck Bugs

Stryck
Posts: 1
Joined: Sun Nov 15, 2009 12:33 am

btRaycastVehicle Wheel Rotation and Stuck Bugs

Post by Stryck »

Hi,
I'm working with the btRaycastVehicle class and have encountered a few issues that I've been unable to resolve.

Setup:
1. A single btRaycastVehicle with two wheels, Box collision shape (for now).
2. Both wheels use the same suspension setup.
3. The vehicle is confined to a 2D plane via a btGeneric6DofConstraint.
4. The vehicle rides on a btTriangleMesh.

Here is the relevant XML for my vehicle configuration:

Code: Select all

		<!-- Suspension Settings -->
		<SuspensionStiffness	Value=5.0></SuspensionStiffness>
		<SuspensionDamping		Value=2.3></SuspensionDamping>
		<SuspensionCompression	Value=2.4></SuspensionCompression>
		<SuspensionRestLength	Value=6.0></SuspensionRestLength>
		<RollInfluence			Value=0.0></RollInfluence>

		<!-- Global Vehicle Settings -->
		<WheelFriction Value=500></WheelFriction>
		<WheelDirectionCS0		X=+0 Y=-1 Z=+0></WheelDirectionCS0>
		<WheelAxleCS			X=+0 Y=+0 Z=+1></WheelAxleCS>
		<CoordinateSystem		X=+0 Y=+1 Z=+2></CoordinateSystem>

		<!-- Individual wheel Settings -->
		<BackWheelRadius	Value=5.2></BackWheelRadius>
		<FrontWheelRadius	Value=4.7></FrontWheelRadius>
		<BackWheelLoc		X=-12 Y=-2.5 Z=0></BackWheelLoc>
		<FrontWheelLoc		X=+12 Y=-2.5 Z=0></FrontWheelLoc>
		<BackWheelMaxForce Value=1000></BackWheelMaxForce>
		<FrontWheelMaxForce Value=500></FrontWheelMaxForce>
		
		<Component Type=DynamicRigidBody Name=Body Primary=P>
			<Mass Value=100.0></Mass>
			<AlwaysDynamic Value=1></AlwaysDynamic>
			<BlocksRigidBody Value=1></BlocksRigidBody>
			<CollisionCallbacks Value=1></CollisionCallbacks>
			<Shape Type=Box>
				<Size X=15 Y=4 Z=2></Size>
			</Shape>
		</Component>
Issues:
1. The wheels only minimally rotate. I'm using the WheelInfo.m_rotation value (which is supposed to be the absolute rotation), but it is almost always reporting ~0. The DeltaRotation is also nearly zero. The vehicle moves and behaves fairly well however, and works in all other respects.

Debugging the speed vs. wheel rotation gives me a max speed of around 140km/hr as reported by the class, but the wheels do not rotate at any speed.

Debugging the code reveals the wheels are not slipping and are in contact, so I'm not sure what is going on.

2. The vehicle gets stuck if it slows down to zero after moving and colliding with the terrain. No amount of force will make the vehicle move after that point.

Thanks for any help! I can provide more source if needed.