Jump to content

setAngle in Suspension Joints


photo

Recommended Posts

I need to be explained about this process. this is sample "Creating a Car with Suspension Joints"

image.png.e96a3994e507ece6be7c64347ef6ba47.png

please give me more detail explanation about setAxis10 and setAxis11 than Doc.

and I'm not sure understand content in the if clause. What do those operations do?

Link to comment

Hello, @dongju.jeong,
Let me explain the principle by using a scheme.

suspension.png
The piece of code you provided is intended for calculation of angles for front wheels when steering.

Since the car has some width, its left and right wheels will go along circles of different radiuses (they are shown as orange curves).

That's why we calculate two steering angles for the right (angle_0) and left (angle_1) front joints controlling the corresponding wheels by using a tangent line for the angle of car's direction vector and the dimensions of the car (the width and the base length). This logic is applied only when the car's steering angle differs from zero (at least, more than the predefined value). Otherwise, it is not needed as the car moves straight forward, so the angles are equal.

After that, we simply set steering angles we have just obtained for the front joints by using setAxis10 method: it sets an axis around which a wheel rotates when moving forward (or backward). There's more info in the related Joints article.

The setAxis10 method sets a wheel spindle axis in local coordinates of the frame (based on 1 and 0 axes as shown on the image below) unlike the setAxis11 one operating on local coordinates of the wheel.

axes.png

Please, let us know if there are any more gaps in the info to cover.

Thank you!

Edited by thomalex
The truth is out there
  • Like 1
Link to comment
×
×
  • Create New...