32 #include <RobotComponents/interface/components/RobotIK.h>
33 #include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
34 #include <RobotAPI/interface/core/RobotState.h>
36 #include <VirtualRobot/IK/GenericIKSolver.h>
53 defineRequiredProperty<std::string>(
"RobotFileName",
"Filename of VirtualRobot robot model (e.g. robot_model.xml)");
55 defineOptionalProperty<std::string>(
"RobotStateComponentName",
"RobotStateComponent",
"Name of the robot state component that should be used");
56 defineOptionalProperty<std::string>(
"ReachabilitySpacesFolder",
"Path to a folder containing reachability spaces");
57 defineOptionalProperty<int>(
"NumIKTrials", 10,
"Number of trials to find an ik solution");
58 defineOptionalProperty<std::string>(
"InitialReachabilitySpaces",
"",
"Reachability spaces to load initially (semi-colon separated)");
119 virtual public RobotIKInterface
126 virtual std::string getRobotFilename(
const Ice::Current&)
const;
151 NameValueMap computeIKFramedPose(
const std::string& robotNodeSetName,
166 NameValueMap computeIKGlobalPose(
const std::string& robotNodeSetName,
181 ExtendedIKResult computeExtendedIKGlobalPose(
const std::string& robotNodeSetName,
195 NameValueMap computeCoMIK(
const std::string& robotNodeSetJoints,
const CoMIKDescriptor& desc,
const Ice::Current& = Ice::emptyCurrent)
override;
220 NameValueMap computeHierarchicalDeltaIK(
const std::string& robotNodeSet,
221 const IKTasks& iktasks,
const CoMIKDescriptor& comIK,
222 float stepSize,
bool avoidJointLimits,
bool enableCenterOfMass,
const Ice::Current& = Ice::emptyCurrent)
override;
244 bool createReachabilitySpace(
const std::string& chainName,
const std::string& coordinateSystem,
float stepTranslation,
float stepRotation,
245 const WorkspaceBounds& minBounds,
const WorkspaceBounds& maxBounds,
int numSamples,
const Ice::Current& = Ice::emptyCurrent)
override;
258 bool defineRobotNodeSet(
const std::string& name,
const NodeNameList& nodes,
259 const std::string& tcpName,
const std::string& rootNode,
const Ice::Current& = Ice::emptyCurrent)
override;
268 bool hasReachabilitySpace(
const std::string& chainName,
const Ice::Current& = Ice::emptyCurrent)
const override;
284 bool isFramedPoseReachable(
const std::string& chainName,
const FramedPoseBasePtr& tcpPose,
const Ice::Current& = Ice::emptyCurrent)
const override;
299 bool isPoseReachable(
const std::string& chainName,
const PoseBasePtr& tcpPose,
const Ice::Current& = Ice::emptyCurrent)
const override;
311 bool loadReachabilitySpace(
const std::string&
filename,
const Ice::Current& = Ice::emptyCurrent)
override;
322 bool saveReachabilitySpace(
const std::string& robotNodeSet,
const std::string&
filename,
const Ice::Current& = Ice::emptyCurrent)
const override;
330 void onInitComponent()
override;
331 void onConnectComponent()
override;
332 void onDisconnectComponent()
override;
336 void computeIK(
const std::string& robotNodeSetName,
const Eigen::Matrix4f& tcpPose,
339 void computeIK(VirtualRobot::RobotNodeSetPtr nodeSet,
const Eigen::Matrix4f& tcpPose,
342 void computeIK(
const std::string& robotNodeSetName,
const Eigen::Matrix4f& tcpPose,
345 void computeIK(VirtualRobot::RobotNodeSetPtr nodeSet,
const Eigen::Matrix4f& tcpPose,
349 Eigen::Matrix4f toReachabilityMapFrame(
const FramedPoseBasePtr& tcpPose,
const std::string& chainName)
const;
351 bool isReachable(
const std::string& setName,
const Eigen::Matrix4f& tcpPose)
const;
355 VirtualRobot::JacobiProvider::InverseJacobiMethod convertInverseJacobiMethod(armarx::InverseJacobiMethod aenum)
const;
357 void synchRobot()
const;
362 mutable std::recursive_mutex _modifyRobotModelMutex;
365 mutable std::recursive_mutex _editRobotNodeSetsMutex;
367 mutable std::recursive_mutex _accessReachabilityCacheMutex;
370 std::string _robotFile;
376 using ReachabilityCacheType = std::map<std::string, VirtualRobot::WorkspaceRepresentationPtr>;
377 ReachabilityCacheType _reachabilities;