Skip to content

Commit

Permalink
BUGFIX: Removing hardcoded enums
Browse files Browse the repository at this point in the history
  • Loading branch information
vikashplus committed Dec 25, 2023
1 parent 94fe08e commit 3b56770
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions robohive/robot/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from robohive.physics.sim_scene import SimScene
from robohive.utils.quat_math import quat2euler
from robohive.utils.prompt_utils import prompt, Prompt
import mujoco
import time
import numpy as np
from collections import deque
Expand Down Expand Up @@ -325,10 +326,10 @@ def configure_robot(self, sim, config_path):
sensor['sim_id'] = sim.model.sensor_name2id(sensor['name'])
sensor_type = sim.model.sensor_type[sensor['sim_id']]
sensor_objid = sim.model.sensor_objid[sensor['sim_id']]
if sensor_type == 8: # mjSENS_JOINTPOS,// scalar joint position (hinge and slide only)
if sensor_type == mujoco.mjtSensor.mjSENS_JOINTPOS: # mjSENS_JOINTPOS,// scalar joint position (hinge and slide only)
sensor['data_type'] = 'qpos'
sensor['data_id'] = sim.model.jnt_qposadr[sensor_objid]
elif sensor_type == 9: # mjSENS_JOINTVEL,// scalar joint position (hinge and slide only)
elif sensor_type == mujoco.mjtSensor.mjSENS_JOINTVEL: # mjSENS_JOINTVEL,// scalar joint position (hinge and slide only)
sensor['data_type'] = 'qvel'
sensor['data_id'] = sim.model.jnt_dofadr[sensor_objid]
else:
Expand Down

0 comments on commit 3b56770

Please sign in to comment.