34 std::scoped_lock lock(dataMutex);
37 if (!(reportedJointAnglesBool && reportedJointVelocitiesBool && globalPos))
46 for (
size_t i = 0; i < allRobotNodeSet.size(); i++)
48 std::string
name = allRobotNodeSet[i]->getName();
50 if (
name ==
"VirtualCentralGaze" ||
name ==
"Hand Palm 1 L" ||
name ==
"Hand Palm 1 R")
54 newValues[
name] = reportedJointAngles[
name] +
58 robot->setJointValues(newValues);
61 VirtualRobot::RobotNodeSetPtr kinematicChain = robot->getRobotNodeSet(headIKName);
64 VirtualRobot::RobotNodePrismaticPtr virtualJoint;
66 for (
size_t i = 0; i < kinematicChain->getSize(); i++)
69 if (kinematicChain->getNode(i)->getName().compare(
"VirtualCentralGaze") == 0)
71 virtualJoint = std::dynamic_pointer_cast<VirtualRobot::RobotNodePrismatic>(
72 kinematicChain->getNode(i));
76 VirtualRobot::GazeIK ikSolver(kinematicChain, virtualJoint);
77 ikSolver.enableJointLimitAvoidance(
true);
80 Eigen::Vector3f targetPosition = globalPos->toEigen();
81 bool solutionFound = ikSolver.solve(targetPosition);
86 for (
size_t i = 0; i < kinematicChain->getSize(); i++)
88 std::string jointName = kinematicChain->getNode(i)->getName();
89 if (jointName.compare(
"VirtualCentralGaze") != 0)
91 targetJointAngles[jointName] = kinematicChain->getNode(i)->getJointValue();
95 std::scoped_lock lock(
mutex);
107 std::string headIKName,
110 std::scoped_lock lock(
mutex);
115 VirtualRobot::RobotNodeSetPtr nodeSetPtr = this->robot->getRobotNodeSet(nodeSetName);
116 this->allRobotNodeSet = nodeSetPtr->getAllRobotNodes();
117 this->headIKName = headIKName;
118 this->robotStateComponent = robotStateComponent;
124 std::scoped_lock lock(
mutex);
126 this->armar4 = armar4;
127 this->velocityBased = velocityBased;
133 std::scoped_lock lock(dataMutex);
135 reportedJointAnglesBool =
true;
136 this->reportedJointAngles =
values;
142 std::scoped_lock lock(dataMutex);
144 reportedJointVelocitiesBool =
true;
145 this->reportedJointVelocities =
values;
150 const FramedPositionBasePtr& targetPosition)
152 std::scoped_lock lock(dataMutex);
154 globalPos = FramedPositionPtr::dynamicCast(targetPosition);
160 std::scoped_lock lock(dataMutex);
163 reportedJointVelocitiesBool =
false;
164 reportedJointAnglesBool =
false;