Skip to content

Commit 1a4adff

Browse files
authored
Merge PR #14 add Ergocub to library
[Add] Ergocub humanoid to library
2 parents ea38e00 + 38a5ea0 commit 1a4adff

File tree

5 files changed

+51
-35
lines changed

5 files changed

+51
-35
lines changed

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ <h2 class="title is-3">Video Presentation</h2>
184184
<section class="hero is-small" id="Introduction">
185185
<div class="hero-body">
186186
<div class="container is-centered">
187-
<h2 class="title is-3 is-centered">Symmetries of robotic systems</h2>
187+
<h2 id="symmetries-of-robotic-systems" class="title is-3 is-centered">Symmetries of robotic systems</h2>
188188
<p class="content has-text-justified">
189189
<p float="left">
190190
In the context of dynamical systems, a symmetry is a state transformation that results in another

morpho_symm/cfg/robot/ergocub.yaml

Lines changed: 47 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,37 +14,63 @@ group_label: C2
1414

1515
# QJ: Joint Space symmetries____________________________________
1616
#[
17-
#'l_hip_pitch', 'l_hip_roll', 'l_hip_yaw', 'l_knee', 'l_ankle_pitch', 'l_ankle_roll', [0... 6)
18-
#'r_hip_pitch', 'r_hip_roll', 'r_hip_yaw', 'r_knee', 'r_ankle_pitch', 'r_ankle_roll', [6...12)
19-
#'torso_roll', 'torso_pitch', 'torso_yaw', [12..15)
20-
# 'l_shoulder_pitch', 'l_shoulder_roll', 'l_shoulder_yaw', 'l_elbow', 'l_wrist_yaw', 'l_wrist_roll',
21-
# 'l_wrist_pitch', 'l_index_add', 'l_index_prox', 'l_index_dist', 'l_middle_prox', 'l_middle_dist',
22-
# 'l_pinkie_prox', 'l_pinkie_dist', 'l_ring_prox', 'l_ring_dist', 'l_thumb_add', 'l_thumb_prox', 'l_thumb_dist', [15...34)
23-
#'neck_pitch', 'neck_roll', 'neck_yaw', 'camera_tilt', [34...38)
24-
# 'r_shoulder_pitch', 'r_shoulder_roll', 'r_shoulder_yaw', 'r_elbow', 'r_wrist_yaw', 'r_wrist_roll',
25-
# 'r_wrist_pitch', 'r_index_add', 'r_index_prox', 'r_index_dist', 'r_middle_prox', 'r_middle_dist',
26-
# 'r_pinkie_prox', 'r_pinkie_dist', 'r_ring_prox', 'r_ring_dist', 'r_thumb_add', 'r_thumb_prox', 'r_thumb_dist' [38...57)
17+
# 'l_hip_pitch', 'l_hip_roll', 'l_hip_yaw', 'l_knee', 'l_ankle_pitch', 'l_ankle_roll', [0...5]
18+
# 'r_hip_pitch', 'r_hip_roll', 'r_hip_yaw', 'r_knee', 'r_ankle_pitch', 'r_ankle_roll', [6...11]
19+
# 'torso_roll', 'torso_pitch', 'torso_yaw', [12..14]
20+
# 'l_shoulder_pitch', 'l_shoulder_roll', 'l_shoulder_yaw', 'l_elbow', 'l_wrist_yaw', 'l_wrist_roll', 'l_wrist_pitch', [15...21]
21+
# 'l_index_add', 'l_index_prox', 'l_index_dist', [22,23, 24]
22+
# 'l_middle_prox', 'l_middle_dist', [25, 26]
23+
# 'l_pinkie_prox', 'l_pinkie_dist', [27, 28]
24+
# 'l_ring_prox', 'l_ring_dist', [29, 30]
25+
# 'l_thumb_add', 'l_thumb_prox', 'l_thumb_dist', [31, 32, 33]
26+
# 'neck_pitch', 'neck_roll', 'neck_yaw', 'camera_tilt', [34, 35, 36, 37]
27+
# 'r_shoulder_pitch', 'r_shoulder_roll', 'r_shoulder_yaw', 'r_elbow', 'r_wrist_yaw', 'r_wrist_roll', 'r_wrist_pitch', [38,..., 44]
28+
# 'r_index_add', 'r_index_prox', 'r_index_dist', [45, 46, 47]
29+
# 'r_middle_prox', 'r_middle_dist', [48, 49]
30+
# 'r_pinkie_prox', 'r_pinkie_dist', [50, 51]
31+
# 'r_ring_prox', 'r_ring_dist', [52, 53]
32+
# 'r_thumb_add', 'r_thumb_prox', 'r_thumb_dist' [54, 55, 56]
2733
#]
2834
# QJ: Joint Space symmetries____________________________________
2935
permutation_Q_js: [
3036
[
31-
6, 7, 8, 9, 10, 11, # 'r_hip_pitch', 'r_hip_roll', 'r_hip_yaw', 'r_knee', 'r_ankle_pitch', 'r_ankle_roll'
32-
0, 1, 2, 3, 4, 5, # 'l_hip_pitch', 'l_hip_roll', 'l_hip_yaw', 'l_knee', 'l_ankle_pitch', 'l_ankle_roll'
33-
12, 13, 14, # 'torso_roll', 'torso_pitch', 'torso_yaw'
34-
38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, # 'r_shoulder_pitch', ..., 'r_thumb_dist'
35-
34, 35, 36, 37, # 'neck_pitch', 'neck_roll', 'neck_yaw', 'camera_tilt'
36-
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33 # 'l_shoulder_pitch', ..., 'l_thumb_dist'
37+
6, 7, 8, 9, 10, 11, # 'r_hip_pitch', 'r_hip_roll', 'r_hip_yaw', 'r_knee', 'r_ankle_pitch', 'r_ankle_roll'
38+
0, 1, 2, 3, 4, 5, # 'l_hip_pitch', 'l_hip_roll', 'l_hip_yaw', 'l_knee', 'l_ankle_pitch', 'l_ankle_roll'
39+
12, 13, 14, # 'torso_roll', 'torso_pitch', 'torso_yaw'
40+
38, 39, 40, 41, 42, 43, 44, # 'r_shoulder_pitch', 'r_shoulder_roll', 'r_shoulder_yaw', 'r_elbow', 'r_wrist_yaw', 'r_wrist_roll',
41+
45, 46, 47, # 'r_index_add', 'r_index_prox', 'r_index_dist'
42+
48, 49, # 'r_middle_prox', 'r_middle_dist'
43+
50, 51, # 'r_pinkie_prox', 'r_pinkie_dist'
44+
52, 53, # 'r_ring_prox', 'r_ring_dist'
45+
54, 55, 56, # 'r_thumb_add', 'r_thumb_prox', 'r_thumb_dist'
46+
34, 35, 36, 37, # 'neck_pitch', 'neck_roll', 'neck_yaw', 'camera_tilt'
47+
15, 16, 17, 18, 19, 20, 21, # 'l_shoulder_pitch', 'l_shoulder_roll', 'l_shoulder_yaw', 'l_elbow', 'l_wrist_yaw', 'l_wrist_roll', 'l_wrist_pitch'
48+
22, 23, 24, # 'l_index_add', 'l_index_prox', 'l_index_dist'
49+
25, 26, # 'l_middle_prox', 'l_middle_dist'
50+
27, 28, # 'l_pinkie_prox', 'l_pinkie_dist'
51+
29, 30, # 'l_ring_prox', 'l_ring_dist'
52+
31, 32, 33 # 'l_thumb_add', 'l_thumb_prox', 'l_thumb_dist'
3753
]
3854
]
3955

4056
# Reflections are determined by joint frame predefined orientation.
4157
reflection_Q_js: [
4258
[
43-
1, -1, -1, 1, 1, -1, # 'l_hip_pitch', 'l_hip_roll', 'l_hip_yaw', 'l_knee', 'l_ankle_pitch', 'l_ankle_roll'
44-
1, -1, -1, 1, 1, -1, # 'r_hip_pitch', 'r_hip_roll', 'r_hip_yaw', 'r_knee', 'r_ankle_pitch', 'r_ankle_roll'
59+
1, 1, 1, 1, 1, 1, # 'l_hip_pitch', 'l_hip_roll', 'l_hip_yaw', 'l_knee', 'l_ankle_pitch', 'l_ankle_roll'
60+
1, 1, 1, 1, 1, 1, # 'r_hip_pitch', 'r_hip_roll', 'r_hip_yaw', 'r_knee', 'r_ankle_pitch', 'r_ankle_roll'
4561
-1, 1, -1, # 'torso_roll', 'torso_pitch', 'torso_yaw'
46-
-1, -1, 1, -1, 1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, # 'r_shoulder_pitch', ..., 'r_thumb_dist'
47-
1, -1, 1, 1, # 'neck_pitch', 'neck_roll', 'neck_yaw', 'camera_tilt'
48-
-1, -1, 1, -1, 1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1 # 'l_shoulder_pitch', ..., 'l_thumb_dist'
62+
1, 1, 1, 1, 1, 1, 1, # 'shoulder_pitch', 'shoulder_roll', 'shoulder_yaw', 'elbow', 'wrist_yaw', 'wrist_roll', 'wrist_pitch'
63+
1, 1, 1, # 'index_add', 'index_prox', 'index_dist'
64+
1, 1, # 'middle_prox', 'middle_dist'
65+
1, 1, # 'pinkie_prox', 'pinkie_dist'
66+
1, 1, # 'r_ring_prox', 'ring_dist'
67+
1, 1, 1, # 'thumb_add', 'thumb_prox', 'thumb_dist'
68+
1, -1, -1, 1, # 'neck_pitch', 'neck_roll', 'neck_yaw', 'camera_tilt'
69+
1, 1, 1, 1, 1, 1, 1, # 'shoulder_pitch', 'shoulder_roll', 'shoulder_yaw', 'elbow', 'wrist_yaw', 'wrist_roll', 'wrist_pitch'
70+
1, 1, 1, # 'index_add', 'index_prox', 'index_dist'
71+
1, 1, # 'middle_prox', 'middle_dist'
72+
1, 1, # 'pinkie_prox', 'pinkie_dist'
73+
1, 1, # 'r_ring_prox', 'ring_dist'
74+
1, 1, 1, # 'thumb_add', 'thumb_prox', 'thumb_dist'
4975
]
5076
]

morpho_symm/robot_symmetry_visualization.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def main(cfg: DictConfig):
3838
rep_Ed = G.representations["E3"] # rep_Ed(g) is a homogenous transformation matrix ∈ R^(3+1)x(3+1)
3939
rep_Rd = G.representations["R3"] # rep_Rd(g) is an orthogonal matrix ∈ R^3x3
4040
rep_Rd_pseudo = G.representations["R3_pseudo"] # rep_Rd_pseudo(g) is an orthogonal matrix ∈ R^3x3
41-
rep_euler_xyz = G.representations["euler_xyz"] # rep_euler_xyz(g) is an euler angle vector ∈ R^3
4241

4342
# Configuration of the 3D visualization -------------------------------------------------------------------------
4443
# Not really relevant to understand.
@@ -111,12 +110,6 @@ def main(cfg: DictConfig):
111110
gXB = rep_Ed(g) @ XB @ rep_Ed(g).T
112111
orbit_XB_w[g] = gXB # Add new robot base configuration (homogenous matrix) to the orbit of base configs.
113112
orbit_ori_euler_xyz[g] = Rotation.from_matrix(gXB[:3, :3]).as_euler("xyz", degrees=True)
114-
# If people use euler xyz angles to represent the orientation of the robot base, we can also compute the
115-
# symmetric states of the robot base orientation:
116-
g_euler_xyz = rep_euler_xyz(g) @ base_ori_euler_xyz
117-
# Check the analytic transformation to elements of SO(3) is equivalent to the transformation in euler xyz angles
118-
g_euler_xyz_true = Rotation.from_matrix(gXB[:3, :3]).as_euler("xyz", degrees=True)
119-
assert np.allclose(g_euler_xyz, g_euler_xyz_true, rtol=1e-6, atol=1e-6)
120113

121114
# Use symmetry representations to get symmetric versions of Euclidean vectors, representing measurements of data
122115
orbit_f1[g], orbit_f2[g] = rep_Rd(g) @ f1, rep_Rd(g) @ f2
@@ -127,10 +120,6 @@ def main(cfg: DictConfig):
127120
orbit_Rf1[g] = rep_Rd(g) @ Rf1 @ rep_Rd(g).T
128121
orbit_Rf2[g] = rep_Rd(g) @ Rf2 @ rep_Rd(g).T
129122

130-
for g in G.elements:
131-
print(f"Element: {g} euler_xyz(g): \n{rep_euler_xyz(g)}")
132-
print(f"Element: {g} Rd_pseudo(g): \n{rep_Rd_pseudo(g)}")
133-
134123
# Visualization of orbits of robot states and of data ==========================================================
135124
# Use Ctrl and mouse-click+drag to rotate the 3D environment.
136125
display_robots_and_vectors(

morpho_symm/utils/robot_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ def load_symmetric_system(
216216
)
217217
pb = configure_bullet_simulation(gui=True, debug=debug)
218218
robot.configure_bullet_simulation(pb, world=None)
219-
change_robot_appearance(pb, robot)
219+
if robot_cfg.tint_bodies:
220+
change_robot_appearance(pb, robot)
220221
setup_debug_sliders(pb, robot)
221222
listen_update_robot_sliders(pb, robot)
222223

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ allow-direct-references = true # We use custom branch of escnn with some devel
66

77
[project]
88
name = "morpho-symm"
9-
version = "0.1.10"
9+
version = "0.1.11"
1010
keywords = ["morphological symmetry", "locomotion", "dynamical systems", "robot symmetries", "symmetry"]
1111
description = "Tools for the identification, study, and exploitation of morphological symmetries in robotics"
1212
readme = "README.md"

0 commit comments

Comments
 (0)