@@ -72,21 +72,35 @@ def actuation_mapping_fn(
72
72
J_sms = vmap (jacobian_fn , in_axes = (None , None , 0 ))(params , q , sms )
73
73
74
74
def compute_actuation_matrix_for_segment (
75
- chi_sm : Array , J_sm : Array , xi : Array
75
+ r_cham_in : Array , r_cham_out : Array , varphi_cham : Array ,
76
+ chi_pe : Array , chi_de : Array ,
77
+ J_pe : Array , J_de : Array , xi : Array
76
78
) -> Array :
77
79
"""
78
80
Compute the actuation matrix for a single segment.
79
81
Args:
80
- chi_sm: tip position of the segment
81
- J_sm: Jacobian of the segment
82
+ r_cham_in: inner radius of each segment chamber
83
+ r_cham_out: outer radius of each segment chamber
84
+ varphi_cham: sector angle of each segment chamber
85
+ chi_pe: pose of the proximal end (i.e., the base) of the segment as array of shape (3,)
86
+ chi_de: pose of the distal end (i.e., the tip) of the segment as array of shape (3,)
87
+ J_pe: Jacobian of the proximal end of the segment as array of shape (3, n_q)
88
+ J_de: Jacobian of the distal end of the segment as array of shape (3, n_q)
82
89
xi: strains of the segment
83
90
Returns:
84
91
A_sm: actuation matrix of shape (n_xi, 2)
85
92
"""
93
+ # rotation matrix from the robot base to the segment base
94
+ R_pe = jnp .array ([[jnp .cos (chi_pe [2 ]), - jnp .sin (chi_pe [2 ])], [jnp .sin (chi_pe [2 ]), jnp .cos (chi_pe [2 ])]])
95
+ # rotation matrix from the robot base to the segment tip
96
+ R_de = jnp .array ([[jnp .cos (chi_de [2 ]), - jnp .sin (chi_de [2 ])], [jnp .sin (chi_de [2 ]), jnp .cos (chi_de [2 ])]])
97
+
98
+
86
99
# compute the actuation matrix for a single segment
87
100
A_sm = jnp .zeros ((n_xi , 2 ))
88
101
return A_sm
89
102
103
+ A_sms = vmap (compute_actuation_matrix_for_segment )(chi_sms , J_sms , xi )
90
104
91
105
A = jnp .zeros ((n_xi , 2 * num_segments ))
92
106
0 commit comments