Skip to content

Commit

Permalink
fix casadi_vals
Browse files Browse the repository at this point in the history
  • Loading branch information
nim65s committed Oct 4, 2024
1 parent b23ac5a commit 2bac343
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions toolbox_parallel_robots/actuation.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,11 @@ def mergeq(model, actuation_model, q_mot, q_free):
actuation_model (object): Robot actuation model.
q_mot (numpy.ndarray): The actuated part of q.
q_free (numpy.ndarray): The non-actuated part of q.
casadi_vals (bool, optional): Whether Casadi values are used. Defaults to False.
Returns:
numpy.ndarray: The merged articular configuration vector.
"""
casadi_vals = type(model) == pin.casadi.Model
if not casadi_vals:
if not isinstance(model, pin.casadi.Model):
q = np.zeros(model.nq)
for q_i, mot_ids_q in zip(q_mot, actuation_model.mot_ids_q):
q[mot_ids_q] = q_i
Expand Down Expand Up @@ -119,13 +117,11 @@ def mergev(model, actuation_model, v_mot, v_free):
actuation_model (object): Robot actuation model.
v_mot (numpy.ndarray): The actuated part of v.
v_free (numpy.ndarray): The non-actuated part of v.
casadi_vals (bool, optional): Set to use Casadi implementation or not. Defaults to False.
Returns:
numpy.ndarray: The merged articular velocity vector.
"""
casadi_vals = type(model) == pin.casadi.Model
if not casadi_vals:
if not isinstance(model, pin.casadi.Model):
v = np.zeros(model.nv)
for v_i, mot_ids_v in zip(v_mot, actuation_model.mot_ids_v):
v[mot_ids_v] = v_i
Expand Down

0 comments on commit 2bac343

Please sign in to comment.