Improve grip feeling on hinge vehicle

Post Reply
Killpippo
Posts: 2
Joined: Sat Feb 01, 2020 10:40 am

Improve grip feeling on hinge vehicle

Post by Killpippo » Sun Feb 02, 2020 5:06 pm

Hello,
I recently started to implement vehicle (tank) simple simulation starting from HingeVehicle demo.
While I'm generally satisfied of the result, I still see, during turns, the movement is pretty inefficient.
Here's a video to demonstrate:
https://www.youtube.com/watch?v=PvbYnNukpUs

I believe I should improve wheels' steer angles for a better result, but any advise is appreciated.

As souce code, I just modified HingeVehicle.cpp sample to add another pair of wheels and steer logic. Parameters are pretty much the same.

Thank you

User avatar
drleviathan
Posts: 572
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: Improve grip feeling on hinge vehicle

Post by drleviathan » Mon Feb 03, 2020 7:46 pm

The video looks good. As a viewer of the video is hard to "feel" the inefficiencies you are talking about. Perhaps they are more apparent to the driver of the real-time simulation. In any case I will mention the ideas I had after watching the video:

(1) During a turn the radius of the two tracks (inner and outer) are different. To minimize wheel slippage you would want to angle the outer steering wheels differently to agree with the angle of their circle's pie section to which they correspond.

The way I would do this would be to provide as steering input the radius of the the arc you want the center of the vehicle to take. If you know the radius and the dimensions of your vehicle, then you can compute the radiuses of the inner and outer tracks and also the length of the arcs between the front and back wheels of each track. From this you can compute the angles the wheels should have from geometry: the angle of each wheel, relative to its vehicle's rotation, should be half the value of the arc of those wheels along the circle of their motion. Since the inner and outer wheels will portend a different arc on their circle you'll end up with different angles for each set.

(2) To minimize wheel slippage: you would also want to change the rotation speeds. Spin the outer wheels faster according to their linear speed along the arc of their circle. The angular_velocity would be the same in each case, but their linear velocity along the arc of motion would be different.

linear_velocity = radius * angular_velocity

That ^^^ formula is true when angular_velocity is in units of radians/second.

(3) Your wheels are wide, which means there is a fair amount of speed variation between their inner and outer edges. There would be no way to reduce slippage from that without either (a) making your wheels thinner, or maybe (b) using multiple sets of thin wheels stacked up, each with its own angular velocity according to its radius of motion.

Killpippo
Posts: 2
Joined: Sat Feb 01, 2020 10:40 am

Re: Improve grip feeling on hinge vehicle

Post by Killpippo » Mon Feb 03, 2020 11:32 pm

Hi @drleviathan,
thank you so much for the response, indeed you exactly pointed all the issues.

1) Corrected the differential steer angle calculation
Before:
https://www.youtube.com/watch?v=whVKgv2Ycoc

After:
https://www.youtube.com/watch?v=OacYf0EsvnY
With the additional benefit to apply different turn radius by simply apply analog controlled, like a gamepad, within a min and max radius.

2) I will apply correction as well. Already with the radius correction, the movement lost a lot the feeling to drive in a mud field.

3) Unsure to apply this change, my goal is indeed to drive these big-foot like machines. Maybe I can sacrifice a bit of precision in order to achieve that.
Also I want wheels will be massive obstacle around the ground once the vehicles become destructible (I'll detach the constraint to the cylinder collider)

Thanks

Post Reply