Skip to content

Commit

Permalink
skip fixed joint, see start-jsk#68 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
k-okada committed Oct 22, 2017
1 parent 86a3b26 commit 415e794
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions denso_ros_control/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ catkin_package(
## Build ##
###########

add_compile_options(-std=c++11)
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(include ${catkin_INCLUDE_DIRS})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ class DensoRobotHW : public hardware_interface::RobotHW
KDL::SegmentMap::const_iterator root_segment = tree.getRootSegment();
std::vector<const KDL::Joint*> joints;
appendJoint(root_segment->second.children[0], joints);
// skip fixed joint https://stackoverflow.com/questions/4478636/stdremove-if-lambda-not-removing-anything-from-the-collection
auto new_end = std::remove_if(joints.begin(), joints.end(),
[](const KDL::Joint*& joint)->bool
{ return joint->getType() == KDL::Joint::None; });
joints.erase(new_end, joints.end());

int num_joints = joints.size();
cmd_.resize(num_joints);
Expand Down

0 comments on commit 415e794

Please sign in to comment.