Description
RobotModel::buildGroupStates compares the number of values an SRDF group_state supplies for a joint against that joint's variable count (moveit_core/robot_model/src/robot_model.cpp:364-368):
RCLCPP_ERROR(getLogger(),
"The model for joint '%s' requires %d variable values, "
"but only %d variable values were supplied in default state '%s' for group '%s'",
jt->first.c_str(), static_cast<int>(vn.size()), static_cast<int>(jt->second.size()),
group_state.name_.c_str(), jmg->getName().c_str());
If the joint is fixed in the URDF, getVariableNames() is empty, so vn.size() is 0 while the SRDF supplied 1 value. The message that comes out is:
The model for joint 'panda_finger_joint1' requires 0 variable values,
but only 1 variable values were supplied in default state 'close' for group 'hand'
which is self-contradictory — "only 1 ... were supplied" when 0 are required — and says nothing about the actual cause.
Why the wording matters here
The vn.size() == 0 case is qualitatively different from the others. Everywhere else the message means "you gave the wrong number of values, fix the SRDF numbers". Here it means "this joint has no degrees of freedom in the URDF you loaded, so it should not appear in this group_state at all" — usually because the URDF and SRDF are out of sync, e.g. a gripper whose finger joints were fixed for simulation while the SRDF still carries the open/close states for them.
That is a common enough situation (any URDF where a joint was fixed after the SRDF was written) that the current wording sends people looking in the wrong place — at the numbers in the SRDF, rather than at the joint type in the URDF.
Suggested fix
Special-case the empty variable list:
if (vn.empty())
{
RCLCPP_ERROR(getLogger(),
"Group state '%s' for group '%s' supplies %d value(s) for joint '%s', "
"but that joint is fixed in the robot model and has no variables. "
"Remove it from the group state, or make it movable in the URDF.",
group_state.name_.c_str(), jmg->getName().c_str(),
static_cast<int>(jt->second.size()), jt->first.c_str());
}
else
{
// existing message
}
Happy to send this as a PR if the wording looks right to you.
ROS Distro
Jazzy
OS and version
Ubuntu 24.04 (container)
Source or binary build?
Binary
If binary, which release version?
The exact patch version was not recorded. The report does not depend on it: the code and the message are identical on main (current) and jazzy (4d84106), at the same line numbers.
Which RMW are you using?
Default (rmw_fastrtps_cpp)
Steps to Reproduce
- Take a URDF/SRDF pair where a joint referenced by an SRDF
group_state is type="fixed" in the URDF. This arises naturally when a gripper's finger joints are fixed for a simulation build while the SRDF still carries its open/close group states for them.
- Load the pair into any node that builds a
RobotModel (servo_node, move_group, ...).
- Read the error on stderr.
Expected behavior
An error that names the cause — the joint is fixed and has no variables, so it does not belong in the group state.
Actual behavior
The model for joint '<name>' requires 0 variable values, but only 1 variable values were supplied in default state '<state>' for group '<group>' — which reads as a contradiction and points at the value count rather than at the joint type.
Description
RobotModel::buildGroupStatescompares the number of values an SRDFgroup_statesupplies for a joint against that joint's variable count (moveit_core/robot_model/src/robot_model.cpp:364-368):If the joint is fixed in the URDF,
getVariableNames()is empty, sovn.size()is 0 while the SRDF supplied 1 value. The message that comes out is:which is self-contradictory — "only 1 ... were supplied" when 0 are required — and says nothing about the actual cause.
Why the wording matters here
The
vn.size() == 0case is qualitatively different from the others. Everywhere else the message means "you gave the wrong number of values, fix the SRDF numbers". Here it means "this joint has no degrees of freedom in the URDF you loaded, so it should not appear in thisgroup_stateat all" — usually because the URDF and SRDF are out of sync, e.g. a gripper whose finger joints were fixed for simulation while the SRDF still carries the open/close states for them.That is a common enough situation (any URDF where a joint was fixed after the SRDF was written) that the current wording sends people looking in the wrong place — at the numbers in the SRDF, rather than at the joint type in the URDF.
Suggested fix
Special-case the empty variable list:
Happy to send this as a PR if the wording looks right to you.
ROS Distro
Jazzy
OS and version
Ubuntu 24.04 (container)
Source or binary build?
Binary
If binary, which release version?
The exact patch version was not recorded. The report does not depend on it: the code and the message are identical on
main(current) andjazzy(4d84106), at the same line numbers.Which RMW are you using?
Default (rmw_fastrtps_cpp)
Steps to Reproduce
group_stateistype="fixed"in the URDF. This arises naturally when a gripper's finger joints are fixed for a simulation build while the SRDF still carries itsopen/closegroup states for them.RobotModel(servo_node,move_group, ...).Expected behavior
An error that names the cause — the joint is fixed and has no variables, so it does not belong in the group state.
Actual behavior
The model for joint '<name>' requires 0 variable values, but only 1 variable values were supplied in default state '<state>' for group '<group>'— which reads as a contradiction and points at the value count rather than at the joint type.