Skip to content

Commit 7bb0d43

Browse files
committed
Added formulas in SE2, Coriolis corrections
Autodiff: for loop calculation corrected Explicit: implementation of explicit calculation using Lie algebra Various tests
1 parent 3bb65cf commit 7bb0d43

File tree

9 files changed

+3375
-306
lines changed

9 files changed

+3375
-306
lines changed

examples/benchmark_planar_pcs_num.py

Lines changed: 118 additions & 60 deletions
Large diffs are not rendered by default.

src/jsrm/systems/planar_pcs_num.py

Lines changed: 1135 additions & 202 deletions
Large diffs are not rendered by default.

src/jsrm/systems/utils.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
def substitute_params_into_all_symbolic_expressions(
10-
sym_exps: Dict, params: Dict[str, jnp.array]
10+
sym_exps: Dict, params: Dict[str, Array]
1111
) -> Dict:
1212
"""
1313
Substitute robot parameters into symbolic expressions.
@@ -43,11 +43,10 @@ def substitute_params_into_all_symbolic_expressions(
4343

4444
return exps
4545

46-
4746
def substitute_params_into_single_symbolic_expression(
4847
sym_exp: sp.Expr,
4948
params_syms: Dict[str, List[sp.Symbol]],
50-
params: Dict[str, jnp.array],
49+
params: Dict[str, Array],
5150
) -> sp.Expr:
5251
"""
5352
Substitute robot parameters into a single symbolic expression.
@@ -72,7 +71,6 @@ def substitute_params_into_single_symbolic_expression(
7271

7372
return sym_exp
7473

75-
7674
def concatenate_params_syms(
7775
params_syms: Dict[str, Union[sp.Symbol, List[sp.Symbol]]],
7876
) -> List[sp.Symbol]:
@@ -85,16 +83,17 @@ def concatenate_params_syms(
8583
params_syms_cat.append(params_sym)
8684
return params_syms_cat
8785

88-
8986
def compute_strain_basis(
9087
strain_selector: Array,
91-
) -> jnp.ndarray:
88+
) -> Array:
9289
"""
9390
Compute strain basis based on boolean strain selector.
9491
Args:
95-
strain_selector: boolean array of shape (n_xi, ) specifying which strain components are active
92+
strain_selector (Array):
93+
boolean array of shape (n_xi, ) specifying which strain components are active
9694
Returns:
97-
strain_basis: strain basis matrix of shape (n_xi, n_q) where n_q is the number of configuration variables
95+
strain_basis (Array):
96+
strain basis matrix of shape (n_xi, n_q) where n_q is the number of configuration variables
9897
and n_xi is the number of strains
9998
"""
10099
n_q = strain_selector.sum().item()
@@ -106,7 +105,6 @@ def compute_strain_basis(
106105
strain_basis = strain_basis.at[i, j].set(1.0)
107106
return strain_basis
108107

109-
110108
@jit
111109
def compute_planar_stiffness_matrix(l: Array, A: Array, Ib: Array, E: Array, G: Array) -> Array:
112110
"""

0 commit comments

Comments
 (0)