Merge pull request #1385 from carla-simulator/manishthani/expose_physx_fixes

Manishthani/expose physx fixes
This commit is contained in:
Néstor Subirón 2019-03-19 13:37:05 +01:00 committed by GitHub
commit 9ac48388bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 5 deletions

View File

@ -7,6 +7,7 @@
* Added `id` property to waypoints, uniquely identifying waypoints up to half centimetre precision
* Added OpenDrive's road offset `s` as property to waypoints
* Fixed python client DLL error on Windows
* Fixed wheel's tire friction from physics control parameters.
* Fixed cleanup of local_planner when used by other modules
## CARLA 0.9.4

View File

@ -220,13 +220,25 @@ void ACarlaWheeledVehicle::ApplyVehiclePhysicsControl(const FVehiclePhysicsContr
Vehicle4W->SteeringCurve.EditorCurveData = PhysicsControl.SteeringCurve;
// Wheels Setup
for (int32 i = 0; i < PhysicsControl.Wheels.Num(); ++i)
TArray<FWheelSetup> NewWheelSetups = Vehicle4W->WheelSetups;
for (int32 i = 0; i < Vehicle4W->WheelSetups.Num(); ++i)
{
Vehicle4W->Wheels[i]->DampingRate = PhysicsControl.Wheels[i].DampingRate;
Vehicle4W->Wheels[i]->SteerAngle = PhysicsControl.Wheels[i].SteerAngle;
Vehicle4W->Wheels[i]->GetWheelSetup().bDisableSteering = PhysicsControl.Wheels[i].bDisableSteering;
Vehicle4W->Wheels[i]->TireConfig->SetFrictionScale(PhysicsControl.Wheels[i].TireFriction);
UVehicleWheel *Wheel = NewWheelSetups[i].WheelClass.GetDefaultObject();
Wheel->DampingRate = PhysicsControl.Wheels[i].DampingRate;
Wheel->SteerAngle = PhysicsControl.Wheels[i].SteerAngle;
NewWheelSetups[i].bDisableSteering = PhysicsControl.Wheels[i].bDisableSteering;
// Assigning new tire config
Wheel->TireConfig = NewObject<UTireConfig>();
// Setting a new value to friction
Wheel->TireConfig->SetFrictionScale(PhysicsControl.Wheels[i].TireFriction);
}
Vehicle4W->WheelSetups = NewWheelSetups;
Vehicle4W->RecreatePhysicsState();
}