ActiveJoints.cpp
Go to the documentation of this file.
00001 
00031 #include <ros/ros.h>
00032 #include <urdf_traverser/Functions.h>
00033 #include <urdf_traverser/UrdfTraverser.h>
00034 #include <urdf_traverser/ActiveJoints.h>
00035 
00036 using urdf_traverser::UrdfTraverser;
00037 using urdf_traverser::RecursionParams;
00038 
00042 int checkActiveJoints(urdf_traverser::RecursionParamsPtr& p)
00043 {
00044     urdf_traverser::LinkPtr link = p->getLink();
00045     urdf_traverser::LinkPtr parent = link->getParent();
00046     unsigned int level = p->getLevel();
00047     if (level == 0) return 1;
00048     if (link->parent_joint && !urdf_traverser::isActive(link->parent_joint))
00049     {
00050         ROS_INFO("UrdfTraverser: Found fixed joint %s", link->parent_joint->name.c_str());
00051         return -1;
00052     }
00053     return 1;
00054 }
00055 
00056 bool urdf_traverser::hasFixedJoints(UrdfTraverser& traverser, const std::string& fromLink)
00057 {
00058     urdf_traverser::RecursionParamsPtr p(new RecursionParams());
00059     if (traverser.traverseTreeTopDown(fromLink,
00060                                       boost::bind(&checkActiveJoints, _1), p, false) < 0)
00061     {
00062         return true;
00063     }
00064     return false;
00065 }
00066 
00067 
00068 
00069 
00070 


urdf_traverser
Author(s): Jennifer Buehler
autogenerated on Fri Mar 1 2019 03:38:07