Modify SimulationState proto to correspond to mj_getState.

PiperOrigin-RevId: 823494487
Change-Id: Ib284e3165ca691f5b690a376f7b28e51122e1bc4
This commit is contained in:
Saran Tunyasuvunakool
2025-10-24 05:50:06 -07:00
committed by Copybara-Service
parent ec8ad21cb5
commit 49a3caf84c
2 changed files with 6 additions and 3 deletions
+4 -2
View File
@@ -49,9 +49,9 @@ void Physics::LoadModel(std::string model_file, const mjVFS* vfs) {
vfs_ = vfs; vfs_ = vfs;
} }
void Physics::ProcessPendingLoad() { bool Physics::ProcessPendingLoad() {
if (!pending_load_.has_value()) { if (!pending_load_.has_value()) {
return; return model_ && data_;
} }
Clear(); Clear();
@@ -68,6 +68,8 @@ void Physics::ProcessPendingLoad() {
on_model_loaded_(model_file); on_model_loaded_(model_file);
InitHistory(); InitHistory();
return model_ && data_;
} }
void Physics::Clear() { void Physics::Clear() {
+2 -1
View File
@@ -93,8 +93,9 @@ class Physics {
// Returns the error message from the simulation. // Returns the error message from the simulation.
std::string_view GetError() const { return error_; } std::string_view GetError() const { return error_; }
bool ProcessPendingLoad();
private: private:
void ProcessPendingLoad();
void InitHistory(); void InitHistory();
void AddToHistory(); void AddToHistory();