Compare commits

..

No commits in common. "e63695a453c35fb4b9caa8f5a62ea0aa6c63850b" and "a5bbfa56ea8b9c8b3e9230a7d7ad876553e89996" have entirely different histories.

6 changed files with 8 additions and 24 deletions

View File

@ -115,15 +115,9 @@ void AMujocoVolumeActor::BindPostPhysicDelegate(UserClass* Object, void(UserClas
PostPhysicUpdateDelegate.BindUObject(Object, Func); PostPhysicUpdateDelegate.BindUObject(Object, Func);
} }
void AMujocoVolumeActor::InitializeMujoco(TMap<FString, FString> ContactExclusion)
void AMujocoVolumeActor::InitializeMujoco()
{ {
InitializeMujocoScene_WithContactExclusion(TMap<FString, FString>{}); if (!Options)
}
void AMujocoVolumeActor::InitializeMujocoScene_WithContactExclusion(const TMap<FString, FString>& ContactExclusion)
{
if (!Options)
{ {
return; return;
} }
@ -176,8 +170,6 @@ void AMujocoVolumeActor::InitializeMujocoScene_WithContactExclusion(const TMap<F
return; return;
} }
// TODO Here we should check for mujoco dll if we are on windows and LOG an error if there is not + gently quit the game
std::array<char, 1024> ErrMsg{}; std::array<char, 1024> ErrMsg{};
MujocoModel = MakeMujocoModelPtr(mj_loadXML(TCHAR_TO_ANSI(*ExportFilename), nullptr, ErrMsg.data(), ErrMsg.size())); MujocoModel = MakeMujocoModelPtr(mj_loadXML(TCHAR_TO_ANSI(*ExportFilename), nullptr, ErrMsg.data(), ErrMsg.size()));
if (!MujocoModel) if (!MujocoModel)

View File

@ -33,23 +33,15 @@ class LUCKYMUJOCO_API AMujocoVolumeActor : public AActor
public: public:
AMujocoVolumeActor(); AMujocoVolumeActor();
UFUNCTION(BlueprintCallable, Category = "Mujoco")
/** /**
* Initialize the sim scene in headless mujoco * Initialize the sim scene in headless mujoco
* @param ContactExclusion a list of pairs that should be patched in the xml file for contact exclusion (no friction, no collision)
* TODO ContactExclusion should be stored as a property of MujocoActor and not passed in the scene init
* TODO This require to cast the Actor in addition to the components list
*/ */
UFUNCTION(BlueprintCallable, Category = "Mujoco") void InitializeMujoco(TMap<FString, FString> ContactExclusion);
void InitializeMujoco();
/**
* Initialize the sim scene in headless mujoco with a list of contact exclusion
* @param ContactExclusion a list of pairs that should be patched in the xml file for contact exclusion (no friction, no collision)
* TODO Can't use a default empty map as parameter in blueprints? We shouldn't need to have 2 functions
* TODO ContactExclusion should be stored as a property of MujocoActor and not passed in the scene init
* TODO This require to cast the Actor in addition to the components list
*/
UFUNCTION(BlueprintCallable, Category = "Mujoco")
void InitializeMujocoScene_WithContactExclusion(const TMap<FString, FString>& ContactExclusion);
protected: protected:
virtual void BeginPlay() override; virtual void BeginPlay() override;

View File

@ -307,7 +307,7 @@ struct LUCKYMUJOCO_API FMujocoOptions
{ {
GENERATED_BODY() GENERATED_BODY()
/** Override TimeStep setting. When enabled, the default value (0.001) is applied. */ /** Override TimeStep setting. When enabled, the default value (0.002) is applied. */
UPROPERTY(config, EditAnywhere, BlueprintReadWrite, Category = "Mujoco", meta = (InlineEditConditionToggle)) UPROPERTY(config, EditAnywhere, BlueprintReadWrite, Category = "Mujoco", meta = (InlineEditConditionToggle))
bool bOverrideTimeStep = false; bool bOverrideTimeStep = false;