Skip to content

Commit 8a92eca

Browse files
author
Thibault Poignonec
committed
revert impedance rule to normal inverse() (instead of LLT-based inverses)
1 parent 2ba6c10 commit 8a92eca

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

cartesian_vic_controller/src/rules/vanilla_cartesian_impedance_rule.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ bool VanillaCartesianImpedanceRule::compute_controls(
166166
J_dot_
167167
);
168168
RCLCPP_DEBUG(logger_, "Computing J_pinv...");
169-
J_pinv_ = (J_.transpose() * J_ + alpha_pinv_ * I_joint_space_).llt().solve(I_) * J_.transpose();
169+
J_pinv_ = (J_.transpose() * J_ + alpha_pinv_ * I_joint_space_).inverse() * J_.transpose();
170170

171171
if (!model_is_ok) {
172172
success = false;
@@ -181,15 +181,17 @@ bool VanillaCartesianImpedanceRule::compute_controls(
181181
Eigen::Matrix<double, 6, 6> M_inv;
182182
if (parameters_.vic.use_natural_robot_inertia) {
183183
M = vic_input_data.natural_cartesian_inertia;
184-
M_inv = vic_input_data.natural_cartesian_inertia.llt().solve(I_);
184+
// M_inv = vic_input_data.natural_cartesian_inertia.llt().solve(I_);
185+
M_inv = vic_input_data.natural_cartesian_inertia.inverse();
185186
RCLCPP_INFO_THROTTLE(
186187
logger_,
187188
internal_clock_,
188189
5000,
189190
"Using natural robot inertia as desired inertia matrix."
190191
);
191192
} else {
192-
M_inv = M.llt().solve(I_);
193+
// M_inv = M.llt().solve(I_);
194+
M_inv = M.inverse();
193195
}
194196

195197

@@ -295,7 +297,7 @@ bool VanillaCartesianImpedanceRule::compute_controls(
295297
logger_,
296298
internal_clock_,
297299
10000, // every 10 seconds
298-
"WARNING! gravity compensation is disabled!"
300+
"FYI: gravity compensation is disabled."
299301
);
300302
}
301303

0 commit comments

Comments
 (0)