Skip to content
Snippets Groups Projects
Commit 157d22da authored by Andre Meixner's avatar Andre Meixner :camera:
Browse files

Fixed createReducedRobotModel for robots where the joint value of 0. is not within joint limits

parent bb9add64
No related branches found
No related tags found
1 merge request!162Feature/improved manip map
Pipeline #15386 passed
......@@ -1066,6 +1066,7 @@ namespace VirtualRobot
// Check joint nodes and set robot joints to default value
std::map<std::string, float> joint_values;
std::map<std::string, bool> enforce_joint_limits;
for (const auto& joint_name : actuatedJointNames)
{
if (robot.hasRobotNode(joint_name))
......@@ -1077,7 +1078,9 @@ namespace VirtualRobot
return nullptr;
}
joint_values[joint_name] = node->getJointValue();
enforce_joint_limits[joint_name] = node->getEnforceJointLimits();
// Set joints do default starting value
node->setEnforceJointLimits(false); // required if 0. is not within in the limits
node->setJointValueNoUpdate(0.);
}
else
......@@ -1244,6 +1247,11 @@ namespace VirtualRobot
reducedModel->setGlobalPose(globalPose);
reducedModel->setJointValues(joint_values);
for (const auto& [joint_name, enforce_limits] : enforce_joint_limits)
{
robot.getRobotNode(joint_name)->setEnforceJointLimits(enforce_limits);
}
cloneRNS(robot, reducedModel);
if(robot.getHumanMapping().has_value())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment