Skip to content
Snippets Groups Projects
Commit 6d739e41 authored by Rohan Budhiraja's avatar Rohan Budhiraja
Browse files

robot_model->njoints has the kinematic tree

parent c4af32d8
No related branches found
No related tags found
No related merge requests found
...@@ -38,7 +38,7 @@ namespace dynamicgraph ...@@ -38,7 +38,7 @@ namespace dynamicgraph
namespace { namespace {
void buildJointNames (sensor_msgs::JointState& jointState, se3::Model* robot_model) { void buildJointNames (sensor_msgs::JointState& jointState, se3::Model* robot_model) {
int cnt = 0; int cnt = 0;
for (int i=1;i<robot_model->nbodies;i++) { for (int i=1;i<robot_model->njoints;i++) {
// Ignore anchors. // Ignore anchors.
if (se3::nv(robot_model->joints[i]) != 0) { if (se3::nv(robot_model->joints[i]) != 0) {
// If we only have one dof, the dof name is the joint name. // If we only have one dof, the dof name is the joint name.
...@@ -86,7 +86,7 @@ namespace dynamicgraph ...@@ -86,7 +86,7 @@ namespace dynamicgraph
} }
se3::Model* robot_model = dynamic->m_model; 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; std::cerr << "no robot in the dynamic entity" << std::endl;
return Value (); return Value ();
......
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