Rename a few functions and variables to be a bit more Googley.
PiperOrigin-RevId: 523963645 Change-Id: Ife7ed3f44aa83c64dfbdc3ca78ee6de2092b0d63
This commit is contained in:
committed by
Copybara-Service
parent
2e23594fe8
commit
5646c905cd
+25
-25
@@ -40,27 +40,27 @@ class Simulate {
|
||||
Simulate(std::unique_ptr<PlatformUIAdapter> platform_ui_adapter);
|
||||
|
||||
// Apply UI pose perturbations to model and data
|
||||
void applyposepertubations(int flg_paused);
|
||||
void ApplyPosePerturbations(int flg_paused);
|
||||
|
||||
// Apply UI force perturbations to model and data
|
||||
void applyforceperturbations();
|
||||
void ApplyForcePerturbations();
|
||||
|
||||
// Request that the Simulate UI thread render a new model
|
||||
// optionally delete the old model and data when done
|
||||
void load(const char* file, mjModel* m, mjData* d);
|
||||
void Load(mjModel* m, mjData* d, const char* displayed_filename);
|
||||
|
||||
// functions below are used by the renderthread
|
||||
// load mjb or xml model that has been requested by load()
|
||||
void loadmodel();
|
||||
void LoadOnRenderThread();
|
||||
|
||||
// prepare to render
|
||||
void prepare();
|
||||
void PrepareScene();
|
||||
|
||||
// render the ui to the window
|
||||
void render();
|
||||
void Render();
|
||||
|
||||
// loop to render the UI (must be called from main thread because of MacOS)
|
||||
void renderloop();
|
||||
void RenderLoop();
|
||||
|
||||
// constants
|
||||
static constexpr int kMaxFilenameLength = 1000;
|
||||
@@ -95,9 +95,9 @@ class Simulate {
|
||||
int run = 1;
|
||||
|
||||
// atomics for cross-thread messages
|
||||
std::atomic_int exitrequest = false;
|
||||
std::atomic_int droploadrequest = false;
|
||||
std::atomic_int screenshotrequest = false;
|
||||
std::atomic_int exitrequest = 0;
|
||||
std::atomic_int droploadrequest = 0;
|
||||
std::atomic_int screenshotrequest = 0;
|
||||
std::atomic_int uiloadrequest = 0;
|
||||
|
||||
// loadrequest
|
||||
@@ -107,15 +107,15 @@ class Simulate {
|
||||
int loadrequest = 0;
|
||||
|
||||
// strings
|
||||
char loadError[kMaxFilenameLength] = "";
|
||||
char load_error[kMaxFilenameLength] = "";
|
||||
char dropfilename[kMaxFilenameLength] = "";
|
||||
char filename[kMaxFilenameLength] = "";
|
||||
char previous_filename[kMaxFilenameLength] = "";
|
||||
|
||||
// time synchronization
|
||||
int realTimeIndex;
|
||||
bool speedChanged = true;
|
||||
float measuredSlowdown = 1.0;
|
||||
int real_time_index;
|
||||
bool speed_changed = true;
|
||||
float measured_slowdown = 1.0;
|
||||
// logarithmically spaced realtime slow-down coefficients (percent)
|
||||
static constexpr float percentRealTime[] = {
|
||||
100, 80, 66, 50, 40, 33, 25, 20, 16, 13,
|
||||
@@ -125,8 +125,8 @@ class Simulate {
|
||||
};
|
||||
|
||||
// control noise
|
||||
double ctrlnoisestd = 0.0;
|
||||
double ctrlnoiserate = 0.0;
|
||||
double ctrl_noise_std = 0.0;
|
||||
double ctrl_noise_rate = 0.0;
|
||||
|
||||
// watch
|
||||
char field[mjMAXUITEXT] = "qpos";
|
||||
@@ -142,7 +142,7 @@ class Simulate {
|
||||
// abstract visualization
|
||||
mjvScene scn = {};
|
||||
mjvCamera cam = {};
|
||||
mjvOption vopt = {};
|
||||
mjvOption opt = {};
|
||||
mjvPerturb pert = {};
|
||||
mjvFigure figconstraint = {};
|
||||
mjvFigure figcost = {};
|
||||
@@ -151,9 +151,9 @@ class Simulate {
|
||||
mjvFigure figsensor = {};
|
||||
|
||||
// OpenGL rendering and UI
|
||||
int refreshRate = 60;
|
||||
int windowpos[2] = {0};
|
||||
int windowsize[2] = {0};
|
||||
int refresh_rate = 60;
|
||||
int window_pos[2] = {0};
|
||||
int window_size[2] = {0};
|
||||
std::unique_ptr<PlatformUIAdapter> platform_ui;
|
||||
mjuiState& uistate;
|
||||
mjUI ui0 = {};
|
||||
@@ -161,7 +161,7 @@ class Simulate {
|
||||
|
||||
// Constant arrays needed for the option section of UI and the UI interface
|
||||
// TODO setting the size here is not ideal
|
||||
const mjuiDef defOption[14] = {
|
||||
const mjuiDef def_option[14] = {
|
||||
{mjITEM_SECTION, "Option", 1, nullptr, "AO"},
|
||||
{mjITEM_SELECT, "Spacing", 1, &this->spacing, "Tight\nWide"},
|
||||
{mjITEM_SELECT, "Color", 1, &this->color, "Default\nOrange\nWhite\nBlack"},
|
||||
@@ -184,7 +184,7 @@ class Simulate {
|
||||
|
||||
|
||||
// simulation section of UI
|
||||
const mjuiDef defSimulation[12] = {
|
||||
const mjuiDef def_simulation[12] = {
|
||||
{mjITEM_SECTION, "Simulation", 1, nullptr, "AS"},
|
||||
{mjITEM_RADIO, "", 2, &this->run, "Pause\nRun"},
|
||||
{mjITEM_BUTTON, "Reset", 2, nullptr, " #259"},
|
||||
@@ -194,14 +194,14 @@ class Simulate {
|
||||
{mjITEM_SLIDERINT, "Key", 3, &this->key, "0 0"},
|
||||
{mjITEM_BUTTON, "Load key", 3},
|
||||
{mjITEM_BUTTON, "Save key", 3},
|
||||
{mjITEM_SLIDERNUM, "Noise scale", 2, &this->ctrlnoisestd, "0 2"},
|
||||
{mjITEM_SLIDERNUM, "Noise rate", 2, &this->ctrlnoiserate, "0 2"},
|
||||
{mjITEM_SLIDERNUM, "Noise scale", 2, &this->ctrl_noise_std, "0 2"},
|
||||
{mjITEM_SLIDERNUM, "Noise rate", 2, &this->ctrl_noise_rate, "0 2"},
|
||||
{mjITEM_END}
|
||||
};
|
||||
|
||||
|
||||
// watch section of UI
|
||||
const mjuiDef defWatch[5] = {
|
||||
const mjuiDef def_watch[5] = {
|
||||
{mjITEM_SECTION, "Watch", 0, nullptr, "AW"},
|
||||
{mjITEM_EDITTXT, "Field", 2, this->field, "qpos"},
|
||||
{mjITEM_EDITINT, "Index", 2, &this->index, "1"},
|
||||
|
||||
Reference in New Issue
Block a user