Skip to content

Commit f11982b

Browse files
WangHanSolocopybara-github
authored andcommitted
dm_control: Import of refs/pull/442/head
PiperOrigin-RevId: 617978935 Change-Id: I566a0a9bdf42b50cce7512f73ba2e678035abcd5
1 parent b002aa3 commit f11982b

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

dm_control/mjcf/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ collision occurs.
2222
```python
2323
from dm_control import mjcf
2424

25-
class Arm(object):
25+
class Arm:
2626

2727
def __init__(self, name):
2828
self.mjcf_model = mjcf.RootElement(model=name)
@@ -38,7 +38,7 @@ class Arm(object):
3838
self.forearm.add('geom', name='forearm', type='capsule',
3939
pos=[0, 0, -0.15], size=[0.045, 0.15])
4040

41-
class UpperBody(object):
41+
class UpperBody:
4242

4343
def __init__(self):
4444
self.mjcf_model = mjcf.RootElement()
@@ -430,10 +430,10 @@ ensure that two models do not become subtly "incompatible". For example:
430430

431431
```python
432432
model_1 = mjcf.RootElement()
433-
model_1.compiler.angle = 'radians'
433+
model_1.compiler.angle = 'radian'
434434

435435
model_2 = mjcf.RootElement()
436-
model_2.compiler.angle = 'degrees'
436+
model_2.compiler.angle = 'degree'
437437

438438
model_1.attach(model_2) # Error!
439439
```
@@ -446,14 +446,14 @@ become problematic is:
446446
model_1 = mjcf.RootElement()
447447

448448
model_2 = mjcf.RootElement()
449-
model_2.compiler.angle = 'degrees'
449+
model_2.compiler.angle = 'degree'
450450

451451
model_1.attach(model_2) # No error, but all angles in model_1 are now wrong!
452452
```
453453

454454
Here, `model_1` assumes MuJoCo's default angle unit of radians. Since it does
455455
not explicitly assign a value to `compiler.angle`, PyMJCF does not detect a
456-
conflict with `angle=degrees` in `model_2`. All angles in `model_1` are now
456+
conflict with `angle=degree` in `model_2`. All angles in `model_1` are now
457457
incorrectly interpreted as degrees.
458458

459459
### Elements outside of `<worldbody>`

0 commit comments

Comments
 (0)