Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make free_joint_state parsing more generalized #943

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,18 @@ class IKFastInvKinFactory : public InvKinFactory
// Get the free joint states
if (YAML::Node free_joint_states_node = config["free_joint_states"])
{
for (auto it = free_joint_states_node.begin(); it != free_joint_states_node.end(); ++it)
for (std::size_t idx = 0; idx < free_joint_states_node.size(); ++idx)
{
// Check the joints specification
if (it->second.size() != free_joints_required)
if (free_joint_states_node[idx].size() != free_joints_required)
{
std::stringstream ss;
ss << "IKFastInvKinFactory, Number of active joints (" << active_joints.size()
<< ") must equal the sum of the number of nominal joints (" << n_joints
<< ") and the number of free joints (" << free_joint_states_map.size() << ")";
throw std::runtime_error(ss.str());
}
free_joint_states_map[it->first.as<std::size_t>()] = it->second.as<std::vector<double>>();
free_joint_states_map[idx] = free_joint_states_node[idx].as<std::vector<double>>();
}
}
else
Expand Down
Loading