Skip to content

Commit f3c8852

Browse files
yuvaltassacopybara-github
authored andcommitted
Replace mju_error_i and mju_error_s with mju_error.
PiperOrigin-RevId: 918279903 Change-Id: I73fd64fee8321bf283689f8b18e39ad720d551f1
1 parent 6537a36 commit f3c8852

10 files changed

Lines changed: 16 additions & 16 deletions

File tree

mjpc/agent.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ void Agent::GUI(mjUI& ui) {
634634
// necessary casting when reading such values.
635635

636636
} else {
637-
mju_error_s("Selection list not found for %s", name);
637+
mju_error("Selection list not found for %s", name);
638638
return;
639639
}
640640
shift += 1;

mjpc/planners/cross_entropy/planner.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ void CrossEntropyPlanner::Initialize(mjModel* model, const Task& task) {
7272
model, "sampling_representation");
7373

7474
if (num_trajectory_ > kMaxTrajectory) {
75-
mju_error_i("Too many trajectories, %d is the maximum allowed.",
76-
kMaxTrajectory);
75+
mju_error("Too many trajectories, %d is the maximum allowed.",
76+
kMaxTrajectory);
7777
}
7878
}
7979

mjpc/planners/sample_gradient/planner.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ void SampleGradientPlanner::Initialize(mjModel* model, const Task& task) {
6969
gradient_filter_ = GetNumberOrDefault(1.0, model, "sample_gradient_filter");
7070

7171
if (num_trajectory_ > kMaxTrajectory) {
72-
mju_error_i("Too many trajectories, %d is the maximum allowed.",
73-
kMaxTrajectory);
72+
mju_error("Too many trajectories, %d is the maximum allowed.",
73+
kMaxTrajectory);
7474
}
7575
}
7676

mjpc/planners/sampling/planner.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ void SamplingPlanner::Initialize(mjModel* model, const Task& task) {
6868
sliding_plan_ = GetNumberOrDefault(0, model, "sampling_sliding_plan");
6969

7070
if (num_trajectory_ > kMaxTrajectory) {
71-
mju_error_i("Too many trajectories, %d is the maximum allowed.",
72-
kMaxTrajectory);
71+
mju_error("Too many trajectories, %d is the maximum allowed.",
72+
kMaxTrajectory);
7373
}
7474

7575
winner = 0;

mjpc/tasks/humanoid/stand/stand.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void Stand::ResidualFn::Residual(const mjModel* model, const mjData* data,
9696
}
9797
}
9898
if (user_sensor_dim != counter) {
99-
mju_error_i(
99+
mju_error(
100100
"mismatch between total user-sensor dimension "
101101
"and actual length of residual %d",
102102
counter);

mjpc/tasks/humanoid/walk/walk.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ void Walk::ResidualFn::Residual(const mjModel* model, const mjData* data,
172172
}
173173
}
174174
if (user_sensor_dim != counter) {
175-
mju_error_i(
175+
mju_error(
176176
"mismatch between total user-sensor dimension "
177177
"and actual length of residual %d",
178178
counter);

mjpc/tasks/panda/panda.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void Panda::ResidualFn::Residual(const mjModel* model, const mjData* data,
6464
}
6565
}
6666
if (user_sensor_dim != counter) {
67-
mju_error_i(
67+
mju_error(
6868
"mismatch between total user-sensor dimension "
6969
"and actual length of residual %d",
7070
counter);

mjpc/tasks/quadruped/quadruped.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ void QuadrupedFlat::ResetLocked(const mjModel* model) {
548548
int foot_index = 0;
549549
for (const char* footname : {"FL", "HL", "FR", "HR"}) {
550550
int foot_id = mj_name2id(model, mjOBJ_GEOM, footname);
551-
if (foot_id < 0) mju_error_s("geom '%s' not found", footname);
551+
if (foot_id < 0) mju_error("geom '%s' not found", footname);
552552
residual_.foot_geom_id_[foot_index] = foot_id;
553553
foot_index++;
554554
}
@@ -557,7 +557,7 @@ void QuadrupedFlat::ResetLocked(const mjModel* model) {
557557
int shoulder_index = 0;
558558
for (const char* shouldername : {"FL_hip", "HL_hip", "FR_hip", "HR_hip"}) {
559559
int foot_id = mj_name2id(model, mjOBJ_BODY, shouldername);
560-
if (foot_id < 0) mju_error_s("body '%s' not found", shouldername);
560+
if (foot_id < 0) mju_error("body '%s' not found", shouldername);
561561
residual_.shoulder_body_id_[shoulder_index] = foot_id;
562562
shoulder_index++;
563563
}

mjpc/tasks/walker/walker.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ void Walker::ResidualFn::Residual(const mjModel* model, const mjData* data,
6363
}
6464
}
6565
if (user_sensor_dim != counter) {
66-
mju_error_i("mismatch between total user-sensor dimension "
67-
"and actual length of residual %d", counter);
66+
mju_error("mismatch between total user-sensor dimension "
67+
"and actual length of residual %d", counter);
6868
}
6969
}
7070
} // namespace mjpc

mjpc/utilities.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ double DefaultParameterValue(const mjModel* model, std::string_view name) {
197197
int id =
198198
mj_name2id(model, mjOBJ_NUMERIC, absl::StrCat("residual_", name).c_str());
199199
if (id == -1) {
200-
mju_error_s("Parameter '%s' not found", std::string(name).c_str());
200+
mju_error("Parameter '%s' not found", std::string(name).c_str());
201201
return 0;
202202
}
203203
return model->numeric_data[model->numeric_adr[id]];
@@ -209,7 +209,7 @@ int ParameterIndex(const mjModel* model, std::string_view name) {
209209
mj_name2id(model, mjOBJ_NUMERIC, absl::StrCat("residual_", name).c_str());
210210

211211
if (id == -1) {
212-
mju_error_s("Parameter '%s' not found", std::string(name).c_str());
212+
mju_error("Parameter '%s' not found", std::string(name).c_str());
213213
}
214214

215215
int i;

0 commit comments

Comments
 (0)