27#include <VirtualRobot/Grasping/Grasp.h>
33VisualServoWrapper::SubClassRegistry
57 Literal objectUpdated(*objectInstanceChannel->getDataFieldIdentifier(
"existenceCertainty"),
64 Literal objectLost(*objectInstanceChannel->getDataFieldIdentifier(
"existenceCertainty"),
91 Eigen::Matrix4f objectGlobalPose = Eigen::Matrix4f::Identity();
93 std::string objectFrame = objectPosition->frame;
94 objectGlobalPose.block(0, 3, 3, 1) = objectPosition->toEigen();
95 objectGlobalPose.block(0, 0, 3, 3) =
98 if (!objectFrame.empty())
104 VirtualRobot::RobotNodePtr targetNode = localRobot->getRobotNode(targetFrame);
108 ARMARX_ERROR <<
"Target frame not part of robot" << std::endl;
111 ARMARX_DEBUG <<
"robot global pose: " << localRobot->getGlobalPose() << std::endl;
112 ARMARX_DEBUG <<
"target frame global pose: " << targetNode->getGlobalPose() << std::endl;
115 Eigen::Matrix4f objectFramedPose = targetNode->getGlobalPose().inverse() * objectGlobalPose;
117 ARMARX_DEBUG <<
"object global pose: " << objectGlobalPose << std::endl;
118 ARMARX_DEBUG <<
"object framed pose: " << objectFramedPose << std::endl;
120 Eigen::Matrix4f graspFramedPose =
121 objectFramedPose * context->
graspDefinition->getTransformation().inverse();
123 ARMARX_DEBUG <<
"grasp framed pose: " << graspFramedPose << std::endl;
135 Eigen::Vector3f viewTarget;
136 viewTarget << targetFramedPose->position->x, targetFramedPose->position->y,
137 targetFramedPose->position->z;
142 viewTargetPositionPtr);
165 return "VisualServoWrapper";
VirtualRobot::GraspPtr graspDefinition
RobotStateComponentInterfacePrx robotStateComponent
HeadIKUnitInterfacePrx headIKUnitPrx
std::string headIKKinematicChainName
VisualServoWrapper(XMLStateConstructorParams stateData)
void onEnter() override
Virtual function, in which the behaviour of state is defined, when it is entered. Can be overridden,...
static std::string GetName()
static SubClassRegistry Registry
void onExit() override
Virtual function, in which the behaviour of state is defined, when it is exited. Can be overridden,...
ConditionIdentifier condObjectLost
ConditionIdentifier condObjectPoseUpdated
static XMLStateFactoryBasePtr CreateInstance(XMLStateConstructorParams stateData)
FramedDirection is a 3 dimensional direction vector with a reference frame.
The FramedOrientation class.
The FramedPosition class.
Literals are part of the user front end of the ArmarX condition mechanism.
static VarList createParameterList()
Static helper method to create an empty parameterlist.
VirtualRobot::RobotPtr createLocalClone()
Clones the structure of this remote robot to a local instance.
ContextType * getContext() const
void removeCondition(ConditionIdentifier conditionId)
Utility function to remove an installed condition on the distributed conditionhandler.
EventPtr createEvent()
Utility function to create a new Event.
ConditionIdentifier installCondition(const Term &condition, const EventPtr evt, const std::string &desc="")
Utility function to install a condition on the distributed conditionhandler.
void setOutput(std::string const &key, const Variant &value)
setOuput() sets an output parameter of this state.
std::enable_if_t< std::is_base_of_v< VariantDataClass, T >, IceInternal::Handle< T > > getInput(const std::string &key) const
getInput can be used to access a specific input parameter.
void setLocal(std::string const &key, const Variant &value)
setLocal() sets a local parameter.
XMLStateTemplate(const XMLStateConstructorParams ¶ms)
#define ARMARX_IMPORTANT
The logging level for always important information, but expected behaviour (in contrast to ARMARX_WAR...
#define ARMARX_ERROR
The logging level for unexpected behaviour, that must be fixed.
#define ARMARX_DEBUG
The logging level for output that is only interesting while debugging.
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
#define ARMARX_VERBOSE
The logging level for verbose information.
std::shared_ptr< class Robot > RobotPtr
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceInternal::Handle< FramedDirection > FramedDirectionPtr
IceInternal::Handle< ChannelRef > ChannelRefPtr
IceInternal::Handle< FramedPosition > FramedPositionPtr
const LogSender::manipulator flush
IceInternal::Handle< XMLStateFactoryBase > XMLStateFactoryBasePtr
Eigen::Vector3f toEigen(const pcl::PointXYZ &pt)
IceInternal::Handle< FramedPose > FramedPosePtr