From e7437b6c6dd2a80ecb213a0080cee3531b49526e Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Mon, 16 Mar 2015 20:13:36 -0400 Subject: [PATCH] Fix matrix dimension bug in operationalSpaceControl --- apps/operationalSpaceControl/Controller.cpp | 6 +++--- apps/operationalSpaceControl/Controller.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/operationalSpaceControl/Controller.cpp b/apps/operationalSpaceControl/Controller.cpp index eec06fcb86804..91736df99c0e3 100644 --- a/apps/operationalSpaceControl/Controller.cpp +++ b/apps/operationalSpaceControl/Controller.cpp @@ -50,10 +50,10 @@ Controller::Controller(dart::dynamics::Skeleton* _robot, mForces.setZero(dof); - mKp.setZero(dof, dof); - mKv.setZero(dof, dof); + mKp.setZero(); + mKv.setZero(); - for (int i = 0; i < dof; ++i) + for (int i = 0; i < 3; ++i) { mKp(i, i) = 750.0; mKv(i, i) = 250.0; diff --git a/apps/operationalSpaceControl/Controller.h b/apps/operationalSpaceControl/Controller.h index e691f8d78c992..ff3e3e493f42a 100644 --- a/apps/operationalSpaceControl/Controller.h +++ b/apps/operationalSpaceControl/Controller.h @@ -75,10 +75,10 @@ class Controller Eigen::VectorXd mForces; /// \brief Proportional gain for the virtual spring forces at the end effector - Eigen::MatrixXd mKp; + Eigen::Matrix3d mKp; /// \brief Derivative gain for the virtual spring forces at the end effector - Eigen::MatrixXd mKv; + Eigen::Matrix3d mKv; }; #endif // APPS_OPERATIONALSPACECONTROL_CONTROLLER_H_