Tank-drive simulation

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
grobi
Posts: 34
Joined: Wed Sep 23, 2009 5:47 pm

Tank-drive simulation

Post by grobi »

Hi,
I would like to simulate a tank with bepu physics, so far I got two rows of 7 wheel on each side of the tank, I can drive forward and backward but turning does not work. I tried setting one side to a targetspeed and one side to zero speed or brake to simulate the chain-drive behaviour but it does not work. I use the wheelsetting from the VehicleInput of the demos :
w = new Wheel(
new RaycastWheelShape(1.4f, wheelRotation),
new WheelSuspension(2000, 100f, Vector3.Down, 1.3f, new Vector3(-7.5f, -6.0f, -10.0f)),
new WheelDrivingMotor(5.0f, 30000, 10000),
new WheelBrake(1.5f, 2, .02f),
new WheelSlidingFriction(4, 5));
and that might be the problem I think those are settings for a normal car wheel and not for a tank chain.
The model has a weight of 500f to make it "heavy" but at a forward speed of 10 it does a wheelie what should be the best ratio between model weight and wheel targetspeed and which settings for sliding, friction and stuff would fit a tank better?
I also thought of simulation the turning behaviour by actualling turning the wheels at almost 90degrees and correcting just the visual rotation of the wheel to make it look that it does not turn.

Grobi
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Tank-drive simulation

Post by Norbo »

I'm working on a little modification to the VehicleInput to show how to do a tank. The main difficulty is dealing with friction tuning and the fact that a wheel will not apply a force to decelerate if the target speed is smaller than the current speed, allowing the car to coast.

Usually the solution involves some sort of cheating. One valid form of cheating is to steer like you mentioned; the version I'm working on uses another approach that changes wheel properties on the fly.

I'll post it up here soon.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Tank-drive simulation

Post by Norbo »

Here it is! It is organized like the VehicleInput and can be plugged into the same part of the demos.
Attachments
TankInput.zip
(4.33 KiB) Downloaded 243 times
grobi
Posts: 34
Joined: Wed Sep 23, 2009 5:47 pm

Re: Tank-drive simulation

Post by grobi »

Thanks norbo, works great!!!
Post Reply