Skip to content

Commit 18cde88

Browse files
committed
Correction for merging
1 parent df770ce commit 18cde88

File tree

3 files changed

+3
-27
lines changed

3 files changed

+3
-27
lines changed

examples/simulate_planar_pcs_sym.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,7 @@ def draw_robot(
150150
# the evolution of the generalized coordinates
151151
q_ts = sol.ys[:, :n_q]
152152
# the evolution of the generalized velocities
153-
q_d_ts = sol.ys[:, n_q:]
154-
155-
s_max = jnp.array([jnp.sum(params["l"])])
156-
157-
forward_kinematics_fn_end_effector = partial(forward_kinematics_fn, params, s=s_max)
158-
forward_kinematics_fn_end_effector = jax.jit(forward_kinematics_fn_end_effector)
159-
forward_kinematics_fn_end_effector = vmap(forward_kinematics_fn_end_effector)
160-
153+
q_d_ts = sol.ys[:, n_q:]
161154

162155
s_max = jnp.array([jnp.sum(params["l"])])
163156

@@ -167,7 +160,6 @@ def draw_robot(
167160

168161
# evaluate the forward kinematics along the trajectory
169162
chi_ee_ts = forward_kinematics_fn_end_effector(q_ts)
170-
chi_ee_ts = forward_kinematics_fn_end_effector(q_ts)
171163
# plot the configuration vs time
172164
plt.figure()
173165
for segment_idx in range(num_segments):
@@ -225,11 +217,9 @@ def draw_robot(
225217
# plot the energy along the trajectory
226218
kinetic_energy_fn_vmapped = vmap(
227219
partial(jax.jit(auxiliary_fns["kinetic_energy_fn"]), params)
228-
partial(jax.jit(auxiliary_fns["kinetic_energy_fn"]), params)
229220
)
230221
potential_energy_fn_vmapped = vmap(
231222
partial(jax.jit(auxiliary_fns["potential_energy_fn"]), params)
232-
partial(jax.jit(auxiliary_fns["potential_energy_fn"]), params)
233223
)
234224
U_ts = potential_energy_fn_vmapped(q_ts)
235225
T_ts = kinetic_energy_fn_vmapped(q_ts, q_d_ts)

src/jsrm/math_utils.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
from jax import numpy as jnp
22
from jax import Array, lax
33

4-
def blk_diag(
5-
a: Array
6-
) -> Array:
7-
from jax import Array, lax
8-
94
def blk_diag(
105
a: Array
116
) -> Array:
@@ -78,7 +73,8 @@ def blk_concat(
7873
c = blk_concat(a)
7974
print("Concatenated matrix:")
8075
print(c)
81-
76+
77+
8278
def compute_weighted_sums(M: Array, vecm: Array, idx: int) -> Array:
8379
"""
8480
Compute the weighted sums of the matrix product of M and vecm,

src/jsrm/systems/utils.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,9 @@
99
from jax import Array
1010
from typing import Dict, List, Tuple, Union
1111

12-
# For documentation purposes
13-
from jax import Array
14-
from typing import Dict, List, Tuple, Union
15-
1612

1713
def substitute_params_into_all_symbolic_expressions(
1814
sym_exps: Dict, params: Dict[str, Array]
19-
sym_exps: Dict, params: Dict[str, Array]
2015
) -> Dict:
2116
"""
2217
Substitute robot parameters into symbolic expressions.
@@ -57,7 +52,6 @@ def substitute_params_into_single_symbolic_expression(
5752
sym_exp: sp.Expr,
5853
params_syms: Dict[str, List[sp.Symbol]],
5954
params: Dict[str, Array],
60-
params: Dict[str, Array],
6155
) -> sp.Expr:
6256
"""
6357
Substitute robot parameters into a single symbolic expression.
@@ -98,7 +92,6 @@ def concatenate_params_syms(
9892

9993
def compute_strain_basis(
10094
strain_selector: Array,
101-
) -> Array:
10295
) -> Array:
10396
"""
10497
Compute strain basis based on boolean strain selector.
@@ -124,9 +117,6 @@ def compute_strain_basis(
124117
return strain_basis
125118

126119

127-
def compute_planar_stiffness_matrix(
128-
l: Array, A: Array, Ib: Array, E: Array, G: Array
129-
) -> Array:
130120
def compute_planar_stiffness_matrix(
131121
l: Array, A: Array, Ib: Array, E: Array, G: Array
132122
) -> Array:

0 commit comments

Comments
 (0)