Skip to content

Commit 0001594

Browse files
committed
Keep upgraded Highway and MuJoCo code clang-tidy clean
1 parent d17b34b commit 0001594

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

envpool/highway/official_task.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -454,10 +454,8 @@ Road MakeRoundaboutGenericRoad(double radius, int lanes) {
454454
{kPi - alpha, kPi / 2.0 + alpha},
455455
{kPi / 2.0 + alpha, kPi / 2.0 - alpha}}};
456456
for (int lane = 0; lane < lanes; ++lane) {
457-
const Lines lines = lanes == 1 ? Lines{kContinuous, kContinuous}
458-
: lane == 0 ? Lines{kContinuous, kStriped}
459-
: lane == lanes - 1 ? Lines{kNone, kContinuous}
460-
: Lines{kNone, kStriped};
457+
const Lines lines{lane == 0 ? kContinuous : kNone,
458+
lane == lanes - 1 ? kContinuous : kStriped};
461459
for (int segment = 0; segment < 8; ++segment) {
462460
road.network.AddLane(
463461
nodes[segment], nodes[segment + 1],

envpool/mujoco/dmc/mujoco_env.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,11 @@ void MujocoEnv::PhysicsStep(int nstep, const mjtNum* action) {
225225
void MujocoEnv::RandomizeLimitedAndRotationalJoints(std::mt19937* gen) {
226226
for (int joint_id = 0; joint_id < model_->njnt; ++joint_id) {
227227
int joint_type = model_->jnt_type[joint_id];
228-
mjtByte is_limited = model_->jnt_limited[joint_id];
228+
bool is_limited = model_->jnt_limited[joint_id];
229229
mjtNum range_min = model_->jnt_range[joint_id * 2 + 0];
230230
mjtNum range_max = model_->jnt_range[joint_id * 2 + 1];
231231
int qpos_offset = model_->jnt_qposadr[joint_id];
232-
if (is_limited != 0) {
232+
if (is_limited) {
233233
if (joint_type == mjJNT_HINGE || joint_type == mjJNT_SLIDE) {
234234
data_->qpos[qpos_offset] = RandUniform(range_min, range_max)(*gen);
235235
} else if (joint_type == mjJNT_BALL) {

0 commit comments

Comments
 (0)