@@ -26,8 +26,10 @@ def build_ant(num_envs):
26
26
dof_start = i * dof_count
27
27
28
28
# base
29
- builder .joint_q [coord_start : coord_start + 3 ] = [i * 2.0 , 0.70 , 0.0 ]
30
- builder .joint_q [coord_start + 3 : coord_start + 7 ] = wp .quat_from_axis_angle ((1.0 , 0.0 , 0.0 ), - math .pi * 0.5 )
29
+ p = [i * 2.0 , 0.70 , 0.0 ]
30
+ q = wp .quat_from_axis_angle (wp .vec3 (1.0 , 0.0 , 0.0 ), - math .pi * 0.5 )
31
+ builder .joint_q [coord_start : coord_start + 3 ] = p
32
+ builder .joint_q [coord_start + 3 : coord_start + 7 ] = q
31
33
32
34
# joints
33
35
builder .joint_q [coord_start + 7 : coord_start + coord_count ] = [0.0 , 1.0 , 0.0 , - 1.0 , 0.0 , - 1.0 , 0.0 , 1.0 ]
@@ -45,9 +47,9 @@ def build_complex_joint_mechanism(chain_length):
45
47
ax1 = wp .normalize (wp .vec3 (4.0 , - 1.0 , 2.0 ))
46
48
ax2 = wp .normalize (wp .vec3 (- 3.0 , 4.0 , - 1.0 ))
47
49
# declare some transforms with nonzero translation and orientation
48
- tf0 = wp .transform (wp .vec3 (1.0 , 2.0 , 3.0 ), wp .quat_from_axis_angle ((1.0 , 0.0 , 0.0 ), math .pi * 0.25 ))
49
- tf1 = wp .transform (wp .vec3 (4.0 , 5.0 , 6.0 ), wp .quat_from_axis_angle ((0.0 , 1.0 , 0.0 ), math .pi * 0.5 ))
50
- tf2 = wp .transform (wp .vec3 (7.0 , 8.0 , 9.0 ), wp .quat_from_axis_angle ((0.0 , 0.0 , 1.0 ), math .pi * 0.75 ))
50
+ tf0 = wp .transform (wp .vec3 (1.0 , 2.0 , 3.0 ), wp .quat_from_axis_angle (wp . vec3 (1.0 , 0.0 , 0.0 ), math .pi * 0.25 ))
51
+ tf1 = wp .transform (wp .vec3 (4.0 , 5.0 , 6.0 ), wp .quat_from_axis_angle (wp . vec3 (0.0 , 1.0 , 0.0 ), math .pi * 0.5 ))
52
+ tf2 = wp .transform (wp .vec3 (7.0 , 8.0 , 9.0 ), wp .quat_from_axis_angle (wp . vec3 (0.0 , 0.0 , 1.0 ), math .pi * 0.75 ))
51
53
52
54
parent = - 1
53
55
for _i in range (chain_length ):
0 commit comments