Changed default substepping parameters

This commit is contained in:
Daniel Santos-Olivan 2020-11-03 17:08:53 +01:00 committed by DSantosO
parent 1c08f651d4
commit 301eb9032e
4 changed files with 9 additions and 25 deletions

View File

@ -33,9 +33,9 @@ namespace rpc {
bool substepping = true;
double max_substep_delta_time = 0.016667;
double max_substep_delta_time = 0.01;
int max_substeps = 6;
int max_substeps = 10;
MSGPACK_DEFINE_ARRAY(synchronous_mode, no_rendering_mode, fixed_delta_seconds, substepping,
max_substep_delta_time, max_substeps);
@ -51,8 +51,8 @@ namespace rpc {
bool no_rendering_mode,
double fixed_delta_seconds = 0.0,
bool substepping = true,
double max_substep_delta_time = 0.016667,
int max_substeps = 6)
double max_substep_delta_time = 0.01,
int max_substeps = 10)
: synchronous_mode(synchronous_mode),
no_rendering_mode(no_rendering_mode),
fixed_delta_seconds(

View File

@ -146,8 +146,8 @@ void export_world() {
arg("no_rendering_mode")=false,
arg("fixed_delta_seconds")=0.0,
arg("substepping")=true,
arg("max_substep_delta_time")=0.016667,
arg("max_substeps")=6)))
arg("max_substep_delta_time")=0.01,
arg("max_substeps")=10)))
.def_readwrite("synchronous_mode", &cr::EpisodeSettings::synchronous_mode)
.def_readwrite("no_rendering_mode", &cr::EpisodeSettings::no_rendering_mode)
.def_readwrite("substepping", &cr::EpisodeSettings::substepping)

View File

@ -16,7 +16,6 @@
#include "Runtime/Core/Public/Misc/App.h"
#include "PhysicsEngine/PhysicsSettings.h"
#include "Engine/World.h"
#include <thread>
@ -153,26 +152,11 @@ void FCarlaEngine::OnEpisodeSettingsChanged(const FEpisodeSettings &Settings)
FCarlaEngine_SetFixedDeltaSeconds(Settings.FixedDeltaSeconds);
// Setting parameters for physics substepping
UPhysicsSettings* PhysSett = UPhysicsSettings::Get();
PhysSett->bSubstepping = Settings.bSubstepping;
PhysSett->MaxSubstepDeltaTime = Settings.MaxSubstepDeltaTime;
PhysSett->MaxSubsteps = Settings.MaxSubsteps;
UE_LOG(LogCarla, Error, TEXT("-------------------------------------------------------------"));
UE_LOG(LogCarla, Error, TEXT("Syncronous Mode %d"), Settings.bSynchronousMode);
UE_LOG(LogCarla, Error, TEXT("Substepping %d"), Settings.bSubstepping);
UE_LOG(LogCarla, Error, TEXT("FixedDelta Secs %f"), Settings.FixedDeltaSeconds.Get(0.0));
UE_LOG(LogCarla, Error, TEXT("MaxSubstepDat %f"), Settings.MaxSubstepDeltaTime);
UE_LOG(LogCarla, Error, TEXT("MaxSubsteps %d"), Settings.MaxSubsteps);
//UE_LOG(LogCarla, Error, TEXT("PS: EditChange %d"), PhysSett->CanEditChange(UPhysicsSettings::bSubstepping));
UE_LOG(LogCarla, Error, TEXT("FA: DeltaTime %f"), CurrentEpisode->GetWorld()->GetDeltaSeconds() );
UE_LOG(LogCarla, Error, TEXT("PS: Substepping %d"), PhysSett->bSubstepping);
UE_LOG(LogCarla, Error, TEXT("PS: MaxSubsDt %f"), PhysSett->MaxSubstepDeltaTime);
UE_LOG(LogCarla, Error, TEXT("PS: MaxSubsNum %d"), PhysSett->MaxSubsteps);
}
void FCarlaEngine::ResetSimulationState()

View File

@ -24,7 +24,7 @@ struct CARLA_API FEpisodeSettings
TOptional<double> FixedDeltaSeconds;
double MaxSubstepDeltaTime = 0.016667;
double MaxSubstepDeltaTime = 0.01;
int MaxSubsteps = 6;
int MaxSubsteps = 10;
};