Skip to content

Commit 9140a6a

Browse files
committed
code formatted with 2 spaces
1 parent 99025d6 commit 9140a6a

11 files changed

Lines changed: 2531 additions & 2521 deletions

File tree

dm_control/locomotion/walkers/assets/dog_v2/add_markers.py

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -43,34 +43,35 @@
4343

4444

4545
def add_markers(model):
46-
"""Add markers to the given model.
46+
"""Add markers to the given model.
4747
48-
Args:
49-
model: The model to add markers to.
48+
Args:
49+
model: The model to add markers to.
5050
51-
Returns:
52-
None
53-
"""
54-
bodies = model.find_all("body")
51+
Returns:
52+
None
53+
"""
54+
bodies = model.find_all("body")
5555

56-
total_markers = 0
57-
for body in bodies:
58-
for name, markers_pos in MARKERS_PER_BODY.items():
59-
if name in body.name and "anchor" not in body.name:
60-
marker_idx = 0
61-
for pos in markers_pos:
62-
if "_R" in body.name:
63-
pos[1] *= -1
64-
body.add(
65-
"site",
66-
name="marker_" + body.name + "_" + str(marker_idx),
67-
pos=pos,
68-
dclass="marker",
69-
)
56+
total_markers = 0
57+
for body in bodies:
58+
for name, markers_pos in MARKERS_PER_BODY.items():
59+
if name in body.name and "anchor" not in body.name:
60+
marker_idx = 0
61+
for pos in markers_pos:
62+
if "_R" in body.name:
63+
pos[1] *= -1
64+
body.add(
65+
"site",
66+
name="marker_" + body.name + "_" + str(marker_idx),
67+
pos=pos,
68+
dclass="marker",
69+
)
7070

71-
marker_idx += 1
72-
total_markers += 1
71+
marker_idx += 1
72+
total_markers += 1
7373

74-
for i in range(total_markers):
75-
marker_body = model.worldbody.add("body", name="marker_" + str(i), mocap=True)
76-
marker_body.add("site", name="marker_" + str(i), dclass="mocap_marker")
74+
for i in range(total_markers):
75+
marker_body = model.worldbody.add(
76+
"body", name="marker_" + str(i), mocap=True)
77+
marker_body.add("site", name="marker_" + str(i), dclass="mocap_marker")

0 commit comments

Comments
 (0)