Skip to content

Commit

Permalink
Merge branch 'master' into feat/Vector3dYamlSupport
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong authored Oct 11, 2023
2 parents ceb251d + bb547ce commit 4bdcc65
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit 4bdcc65

Please sign in to comment.