Skip to content

Commit

Permalink
Using the trace in the rotation error.
Browse files Browse the repository at this point in the history
  • Loading branch information
S-Dafarra committed Oct 16, 2023
1 parent b856e8d commit 065423e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def add_kinematics_regularization(
qd=variables.references.frame_quaternion_xyzw,
)["rotation_error"]
problem.add_cost(
expression=cs.sumsqr(cs.DM.eye(3) - rotation_error_kinematics),
expression=cs.sumsqr(cs.trace(rotation_error_kinematics) - 3),
name="frame_rotation_error",
scaling=self.settings.desired_frame_quaternion_cost_multiplier,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ def add_kinematics_regularization(
qd=sym.references.desired_frame_quaternion_xyzw,
)["rotation_error"]
problem.add_expression_to_horizon(
expression=cs.sumsqr(cs.DM.eye(3) - rotation_error_kinematics),
expression=cs.sumsqr(cs.trace(rotation_error_kinematics) - 3),
apply_to_first_elements=False,
name="frame_quaternion_error",
mode=hp.ExpressionType.minimize,
Expand Down

0 comments on commit 065423e

Please sign in to comment.