Skip to content
Snippets Groups Projects
Commit a6e5c400 authored by Fabian Paus's avatar Fabian Paus
Browse files

Fix bug in CartesianVelocityController

parent 2fd28919
No related branches found
No related tags found
No related merge requests found
......@@ -128,7 +128,10 @@ Eigen::VectorXf CartesianVelocityController::calculateJointLimitAvoidance()
Eigen::VectorXf CartesianVelocityController::calculateNullspaceVelocity(const Eigen::VectorXf& cartesianVel, float KpScale, VirtualRobot::IKSolver::CartesianSelection mode)
{
Eigen::VectorXf regularization = calculateRegularization(mode);
Eigen::VectorXf vel = cartesianVel * regularization;
// Eigen does not allow product between two column vectors (this fails in Debug mode)
// In Release this causes cartesianVel to be only multiplied by the first element of regularization
// Eigen::VectorXf vel = cartesianVel * regularization;
Eigen::VectorXf vel = cartesianVel.cwiseProduct(regularization);
return KpScale * vel.norm() * calculateJointLimitAvoidance();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment