From 6d739e417e45bb87c7cadd8366a1ddc6f233a5ec Mon Sep 17 00:00:00 2001 From: Rohan Budhiraja <budhiraja@laas.fr> Date: Tue, 20 Dec 2016 15:48:58 +0100 Subject: [PATCH] robot_model->njoints has the kinematic tree --- src/ros_joint_state.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ros_joint_state.cpp b/src/ros_joint_state.cpp index 1ff7087..f359910 100644 --- a/src/ros_joint_state.cpp +++ b/src/ros_joint_state.cpp @@ -38,7 +38,7 @@ namespace dynamicgraph namespace { void buildJointNames (sensor_msgs::JointState& jointState, se3::Model* robot_model) { int cnt = 0; - for (int i=1;i<robot_model->nbodies;i++) { + for (int i=1;i<robot_model->njoints;i++) { // Ignore anchors. if (se3::nv(robot_model->joints[i]) != 0) { // If we only have one dof, the dof name is the joint name. @@ -86,7 +86,7 @@ namespace dynamicgraph } se3::Model* robot_model = dynamic->m_model; - if (robot_model->nbodies == 1) + if (robot_model->njoints == 1) { std::cerr << "no robot in the dynamic entity" << std::endl; return Value (); -- GitLab