Skip to content

Commit 3a9cb28

Browse files
Take into account when some joints are not controlled.
In the case of the Franka robot, the URDF model does not propose position control via ROS control for the fingers. In this case the control vector is smaller than the encoder reading vector. This commit makes the asumption that the not controlled joints are at the end of the control vector. Some work is needed to make this more general.
1 parent fcf298a commit 3a9cb28

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/roscontrol-sot-controller.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,8 @@ void RCSotController::readControl(
941941
std::string &lmapRC2Sot = it_mapRC2Sot->second;
942942
command_ = controlValues[lmapRC2Sot].getValues();
943943
ODEBUG4("angleControl_.size() = " << command_.size());
944-
for (unsigned int i = 0; i < command_.size(); ++i) {
944+
for (unsigned int i = 0; i < std::min(command_.size(), joints_.size());
945+
++i) {
945946
joints_[joints_name_[i]].joint.setCommand(command_[i]);
946947
DataOneIter_.controls[i] = command_[i];
947948
}

0 commit comments

Comments
 (0)