-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modified AWSIM vehicle's turning behavior #176
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this scene needs to be changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restored the original value for m_IndirectSpecularColor
.
|
||
// Vehicle dynamics parameters used for calculating of front wheel angles. | ||
private float wheelBase = 2.787877f; | ||
private float tread = 1.8199022f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wheelbase and tread could be calculated automatically from the positions of the front and rear wheels, I believe. Therefore, it is preferable not to provide these variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modified to have wheelbase and tread calculated from the coordinates of each wheel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why should the Wheel class make changes? I think the Wheel class should just reflect the SteerAngle set from the Vehicle class, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted Wheel.cs
to the original version and moved the relevant part to Vehicle.cs
.
@@ -424,8 +426,31 @@ void UpdateWheelsForce(float acceleration) | |||
var perWheelAcceleration = acceleration / wheels.Length; | |||
|
|||
// Update the acceleration output by each wheel. | |||
foreach (var wheel in wheels) | |||
wheel.UpdateWheelForce(perWheelAcceleration); | |||
var dif1 = Mathf.Sin(Mathf.Asin(1 / Mathf.Sqrt(Mathf.Pow((1 / Mathf.Tan(Mathf.Abs(SteerAngle) * Mathf.Deg2Rad) + tread / wheelBase), 2) + 1))) / Mathf.Sin(SteerAngle * Mathf.Deg2Rad); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to leave comments on the calculations and logic of dif1, dif2, dif3, etc. so that other developers can easily understand them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some comments of dif1, dif2, dif3.
No description provided.