33 std::scoped_lock lock(dataMutex);
36 if (!(reportedJointAnglesBool && reportedJointVelocitiesBool && globalPos))
45 for (
size_t i = 0; i < allRobotNodeSet.size(); i++)
47 std::string
name = allRobotNodeSet[i]->getName();
49 if (
name ==
"VirtualCentralGaze" ||
name ==
"Hand Palm 1 L" ||
name ==
"Hand Palm 1 R")
56 robot->setJointValues(newValues);
59 VirtualRobot::RobotNodeSetPtr kinematicChain = robot->getRobotNodeSet(headIKName);
62 VirtualRobot::RobotNodePrismaticPtr virtualJoint;
64 for (
size_t i = 0; i < kinematicChain->getSize(); i++)
67 if (kinematicChain->getNode(i)->getName().compare(
"VirtualCentralGaze") == 0)
69 virtualJoint = std::dynamic_pointer_cast<VirtualRobot::RobotNodePrismatic>(kinematicChain->getNode(i));
73 VirtualRobot::GazeIK ikSolver(kinematicChain, virtualJoint);
74 ikSolver.enableJointLimitAvoidance(
true);
77 Eigen::Vector3f targetPosition = globalPos->toEigen();
78 bool solutionFound = ikSolver.solve(targetPosition);
83 for (
size_t i = 0; i < kinematicChain->getSize(); i++)
85 std::string jointName = kinematicChain->getNode(i)->getName();
86 if (jointName.compare(
"VirtualCentralGaze") != 0)
88 targetJointAngles[jointName] = kinematicChain->getNode(i)->getJointValue();
93 std::scoped_lock lock(
mutex);
107 std::scoped_lock lock(
mutex);
111 VirtualRobot::RobotNodeSetPtr nodeSetPtr = this->robot->getRobotNodeSet(nodeSetName);
112 this->allRobotNodeSet = nodeSetPtr->getAllRobotNodes();
113 this->headIKName = headIKName;
114 this->robotStateComponent = robotStateComponent;
119 std::scoped_lock lock(
mutex);
121 this->armar4 = armar4;
122 this->velocityBased = velocityBased;
127 std::scoped_lock lock(dataMutex);
129 reportedJointAnglesBool =
true;
130 this->reportedJointAngles =
values;
136 std::scoped_lock lock(dataMutex);
138 reportedJointVelocitiesBool =
true;
139 this->reportedJointVelocities =
values;
146 std::scoped_lock lock(dataMutex);
148 globalPos = FramedPositionPtr::dynamicCast(targetPosition);
153 std::scoped_lock lock(dataMutex);
156 reportedJointVelocitiesBool =
false;
157 reportedJointAnglesBool =
false;