Go to the documentation of this file.
30 #include <RobotAPI/interface/components/FrameTrackingInterface.h>
31 #include <RobotAPI/interface/core/RobotState.h>
32 #include <RobotAPI/interface/units/KinematicUnitInterface.h>
33 #include <RobotAPI/interface/observers/KinematicUnitObserverInterface.h>
37 #include <ArmarXGui/interface/RemoteGuiInterface.h>
55 defineOptionalProperty<std::string>(
"RobotStateComponentName",
"RobotStateComponent",
"Name of the robot state component that should be used");
56 defineOptionalProperty<std::string>(
"KinematicUnitName",
"KinematicUnit",
"Name of the kinematic unit that should be used");
57 defineOptionalProperty<std::string>(
"KinematicUnitObserverName",
"KinematicUnitObserver",
"Name of the kinematic unit observer that should be used");
58 defineRequiredProperty<std::string>(
"HeadYawJoint",
"Name of the yaw joint of the head.");
59 defineRequiredProperty<std::string>(
"HeadPitchJoint",
"Name of the pitch joint of the head.");
60 defineRequiredProperty<std::string>(
"CameraNode",
"Name of the camera node.");
61 defineOptionalProperty<bool>(
"EnableTrackingOnStartup",
true,
"Start Tracking on startup. This needs a frame to be defined.");
62 defineOptionalProperty<std::string>(
"FrameOnStartup",
"",
"Name of the frame that should be tracked.");
63 defineOptionalProperty<std::string>(
"RemoteGuiName",
"RemoteGuiProvider",
"Name of the remote gui. Remote gui is disabled if empty.");
64 defineOptionalProperty<float>(
"MaxYawVelocity", 0.8f,
"The maximum velocity the yaw joint while tracking objects.");
65 defineOptionalProperty<float>(
"YawAcceleration", 4.f,
"The acceleration of the yaw joint while tracking objects.");
66 defineOptionalProperty<float>(
"MaxPitchVelocity", 0.8f,
"The maximum velocity the pitch joint while tracking objects.");
67 defineOptionalProperty<float>(
"PitchAcceleration", 4.f,
"The acceleration of the pitch joint while tracking objects.");
84 public FrameTrackingInterface
89 HeadState() =
default;
90 HeadState(
bool stop,
float currentYawPos,
float currentYawVel,
float desiredYawPos,
float currentPitchPos,
float currentPitchVel,
float desiredPitchPos)
93 currentYawPos {currentYawPos },
94 currentYawVel {currentYawVel },
95 desiredYawPos {desiredYawPos },
96 currentPitchPos {currentPitchPos},
97 currentPitchVel {currentPitchVel},
98 desiredPitchPos {desiredPitchPos}
105 float currentPitchPos;
106 float currentPitchVel;
107 float desiredPitchPos;
115 return "FrameTracking";
146 void enableTracking(
bool enable,
const Ice::Current& = Ice::emptyCurrent)
override;
147 void setFrame(
const std::string&
frameName,
const Ice::Current& = Ice::emptyCurrent)
override;
148 std::string
getFrame(
const Ice::Current& = Ice::emptyCurrent)
const override;
150 void lookAtFrame(
const std::string&
frameName,
const Ice::Current& = Ice::emptyCurrent)
override;
155 void scanInConfigurationSpace(
float yawFrom,
float yawTo, const ::Ice::FloatSeq& pitchValues,
float velocity,
const Ice::Current& = Ice::emptyCurrent)
override;
156 void scanInWorkspace(const ::armarx::Vector3fSeq& points,
float maxVelocity,
float acceleration,
const Ice::Current& = Ice::emptyCurrent)
override;
157 void moveJointsTo(
float yaw,
float pitch,
const Ice::Current& = Ice::emptyCurrent)
override;
165 bool _looksAtPoint(
const Eigen::Vector3f& point,
float max_diff);
std::atomic< bool > enabled
SimplePeriodicTask ::pointer_type _guiTask
bool _looksAtPoint(const Eigen::Vector3f &point, float max_diff)
void scanInWorkspace(const ::armarx::Vector3fSeq &points, float maxVelocity, float acceleration, const Ice::Current &=Ice::emptyCurrent) override
PeriodicTask< FrameTracking >::pointer_type processorTask
void lookAtPointInRobotFrame(const Vector3f &point, const Ice::Current &=Ice::emptyCurrent) override
void onInitComponent() override
void enableTracking(bool enable, const Ice::Current &=Ice::emptyCurrent) override
void onConnectComponent() override
RemoteGuiInterfacePrx _remoteGui
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
void _doPositionControl(const HeadState &headstate)
KinematicUnitObserverInterfacePrx kinematicUnitObserverInterfacePrx
Brief description of class FrameTracking.
void scanInConfigurationSpace(float yawFrom, float yawTo, const ::Ice::FloatSeq &pitchValues, float velocity, const Ice::Current &=Ice::emptyCurrent) override
FrameTrackingPropertyDefinitions(std::string prefix)
std::string getFrame(const Ice::Current &=Ice::emptyCurrent) const override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void lookAtFrame(const std::string &frameName, const Ice::Current &=Ice::emptyCurrent) override
void _lookAtFrame(const std::string &frame)
RobotStateComponentInterfacePrx robotStateComponent
void _lookAtPoint(const Eigen::Vector3f &point)
VirtualRobot::RobotNodePtr headPitchJoint
VirtualRobot::RobotNodePtr cameraNode
void _doVelocityControl(const HeadState &headstate, float maxYawVelocity, float yawAcceleration, float maxPitchVelocity, float pitchAcceleration)
void syncronizeLocalClone()
Baseclass for all ArmarX ManagedIceObjects requiring properties.
void onExitComponent() override
std::string getDefaultName() const override
Default component property definition container.
HeadState _calculateJointAnglesContinously(const std::string &frame)
KinematicUnitInterfacePrx kinematicUnitInterfacePrx
void setFrame(const std::string &frameName, const Ice::Current &=Ice::emptyCurrent) override
VirtualRobot::RobotNodePtr headYawJoint
HeadState _calculateJointAngles(const Eigen::Vector3f &point)
void lookAtPointInGlobalFrame(const Vector3f &point, const Ice::Current &=Ice::emptyCurrent) override
VirtualRobot::RobotPtr localRobot
void _enableTracking(bool enable)
void moveJointsTo(float yaw, float pitch, const Ice::Current &=Ice::emptyCurrent) override
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::shared_ptr< class Robot > RobotPtr
bool isLookingAtPointInGlobalFrame(const Vector3f &point, float max_diff, const Ice::Current &=Ice::emptyCurrent) override
RemoteGui::TabProxy _guiTab
void onDisconnectComponent() override