Add tendon velocity sensor to MJX.
PiperOrigin-RevId: 685689974 Change-Id: Ib5e65b19c20b74e20cffa66c6baca0d8faaaf3ae
This commit is contained in:
committed by
Copybara-Service
parent
1e7c109887
commit
ac91a7639d
@@ -330,6 +330,8 @@ def sensor_vel(m: Model, d: Data) -> Data:
|
||||
adr = (adr[:, None] + np.arange(3)[None]).reshape(-1)
|
||||
elif sensor_type == SensorType.JOINTVEL:
|
||||
sensor = d.qvel[m.jnt_dofadr[objid]]
|
||||
elif sensor_type == SensorType.TENDONVEL:
|
||||
sensor = d.ten_velocity[objid]
|
||||
elif sensor_type == SensorType.ACTUATORVEL:
|
||||
sensor = d.actuator_velocity[objid]
|
||||
elif sensor_type == SensorType.BALLANGVEL:
|
||||
|
||||
@@ -321,6 +321,7 @@ class SensorType(enum.IntEnum):
|
||||
VELOCIMETER: 3D linear velocity, in local frame
|
||||
GYRO: 3D angular velocity, in local frame
|
||||
JOINTVEL: joint velocity
|
||||
TENDONVEL: scalar tendon velocity
|
||||
ACTUATORVEL: actuator velocity
|
||||
BALLANGVEL: ball joint angular velocity
|
||||
FRAMELINVEL: 3D linear velocity
|
||||
@@ -352,6 +353,7 @@ class SensorType(enum.IntEnum):
|
||||
VELOCIMETER = mujoco.mjtSensor.mjSENS_VELOCIMETER
|
||||
GYRO = mujoco.mjtSensor.mjSENS_GYRO
|
||||
JOINTVEL = mujoco.mjtSensor.mjSENS_JOINTVEL
|
||||
TENDONVEL = mujoco.mjtSensor.mjSENS_TENDONVEL
|
||||
ACTUATORVEL = mujoco.mjtSensor.mjSENS_ACTUATORVEL
|
||||
BALLANGVEL = mujoco.mjtSensor.mjSENS_BALLANGVEL
|
||||
FRAMELINVEL = mujoco.mjtSensor.mjSENS_FRAMELINVEL
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
-velocimeter
|
||||
-gyro
|
||||
-jointvel
|
||||
-tendonvel
|
||||
-actuatorvel
|
||||
-ballangvel
|
||||
-framelinvel
|
||||
@@ -122,6 +123,7 @@
|
||||
<sensor>
|
||||
<torque site="site_torque"/>
|
||||
<tendonpos tendon="fixed"/>
|
||||
<tendonvel tendon="fixed"/>
|
||||
<magnetometer name="magnetometer0" site="site0"/>
|
||||
<velocimeter name="velocimeter0" site="site0"/>
|
||||
<velocimeter name="velocimeter0cutoff" site="site0" cutoff="3e-4"/>
|
||||
@@ -131,6 +133,7 @@
|
||||
<accelerometer name="accelerometer1" site="site1"/>
|
||||
<force site="site_force"/>
|
||||
<tendonpos tendon="spatial"/>
|
||||
<tendonvel tendon="spatial"/>
|
||||
<jointpos name="jointpos0" joint="hinge0"/>
|
||||
<jointpos name="jointpos0cutoff" joint="hinge0" cutoff="1e-4"/>
|
||||
<jointvel name="jointvel0" joint="hinge0"/>
|
||||
|
||||
Reference in New Issue
Block a user