diff --git a/include/mc_rtc/gui/RobotMsg.h b/include/mc_rtc/gui/RobotMsg.h index 36643b2d7d..c25f4270ea 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); } };