From 1c8c40ee19e27bb117954ab4a368eb150e60e854 Mon Sep 17 00:00:00 2001 From: adallard Date: Tue, 16 Apr 2024 10:33:55 +0200 Subject: [PATCH 1/2] [RobotMsh] fix wrong vector conversion for tau, alpha, and alphaD --- include/mc_rtc/gui/RobotMsg.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/include/mc_rtc/gui/RobotMsg.h b/include/mc_rtc/gui/RobotMsg.h index 36643b2d7d..5f1c7c9497 100644 --- a/include/mc_rtc/gui/RobotMsg.h +++ b/include/mc_rtc/gui/RobotMsg.h @@ -58,12 +58,9 @@ struct RobotMsgImpl : public Element { msg_.q.resize(robot.mb().nrParams()); rbd::paramToVector(robot.mbc().q, msg_.q); - msg_.alpha.resize(robot.mb().nrDof()); - rbd::paramToVector(robot.mbc().alpha, msg_.alpha); - msg_.alphaD.resize(msg_.alpha.size()); - rbd::paramToVector(robot.mbc().alphaD, msg_.alphaD); - msg_.tau.resize(msg_.alpha.size()); - rbd::paramToVector(robot.mbc().jointTorque, msg_.tau); + msg_.alpha = rbd::dofToVector(robot.mb(),robot.mbc().alpha); + msg_.alphaD = rbd::dofToVector(robot.mb(),robot.mbc().alphaD); + msg_.tau = rbd::dofToVector(robot.mb(),robot.mbc().jointTorque); } }; From c00f05926078c7a59eb8b8b078ddfd74ac0c3cfe Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 16 Apr 2024 10:07:22 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- include/mc_rtc/gui/RobotMsg.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/mc_rtc/gui/RobotMsg.h b/include/mc_rtc/gui/RobotMsg.h index 5f1c7c9497..c25f4270ea 100644 --- a/include/mc_rtc/gui/RobotMsg.h +++ b/include/mc_rtc/gui/RobotMsg.h @@ -58,9 +58,9 @@ struct RobotMsgImpl : public Element { msg_.q.resize(robot.mb().nrParams()); rbd::paramToVector(robot.mbc().q, msg_.q); - msg_.alpha = rbd::dofToVector(robot.mb(),robot.mbc().alpha); - msg_.alphaD = rbd::dofToVector(robot.mb(),robot.mbc().alphaD); - msg_.tau = rbd::dofToVector(robot.mb(),robot.mbc().jointTorque); + msg_.alpha = rbd::dofToVector(robot.mb(), robot.mbc().alpha); + msg_.alphaD = rbd::dofToVector(robot.mb(), robot.mbc().alphaD); + msg_.tau = rbd::dofToVector(robot.mb(), robot.mbc().jointTorque); } };