Skip to content

Commit

Permalink
Don't use deprecated optas methods
Browse files Browse the repository at this point in the history
  • Loading branch information
cmower committed Mar 1, 2023
1 parent fc21c65 commit d76ceea
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lbr_examples/scripts/admittance_control_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ def __init__(
dx_gain: np.ndarray = np.array([1.0, 1.0, 1.0, 20.0, 40.0, 60.0]),
smooth: float = 0.02,
) -> None:

robot = optas.RobotModel(urdf_string=urdf_string)
J = robot.get_geometric_jacobian_function(end_link_name, root_link_name)
self.jacobian = lambda q: J(q).toarray() # toarray: convert casadi.DM -> numpy.ndarray
J = robot.get_global_link_geometric_jacobian_function(end_link_name)
self.jacobian = lambda q: J(
q
).toarray() # toarray: convert casadi.DM -> numpy.ndarray

self.f_threshold_ = f_threshold
self.dq_gain_ = np.diag(dq_gain)
Expand Down

0 comments on commit d76ceea

Please sign in to comment.