Go to the documentation of this file.
26 #include <VirtualRobot/IK/GazeIK.h>
27 #include <VirtualRobot/Nodes/RobotNode.h>
28 #include <VirtualRobot/Robot.h>
29 #include <VirtualRobot/RobotNodeSet.h>
30 #include <VirtualRobot/VirtualRobot.h>
38 #include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
42 #include <VisionX/interface/components/ImageSourceSelectionInterface.h>
44 #include <RobotComponents/interface/GazeStabilizationInterface.h>
70 defineOptionalProperty<bool>(
71 "VelocityBasedControl",
true,
"Use velocity based reflexes");
73 defineOptionalProperty<float>(
"kp", 1.0,
"p part of regulator");
74 defineOptionalProperty<float>(
"ki", 0.0,
"i part of regulator");
75 defineOptionalProperty<float>(
"kd", 0.0,
"d part of regulator");
77 defineOptionalProperty<float>(
"VOR", 0,
"Vestibulo-ocular reflex weight");
78 defineOptionalProperty<float>(
"OKR", 1,
"Opto-kinetic reflex weight");
79 defineOptionalProperty<float>(
"JointIK", 0,
"Joint IK weight");
80 defineOptionalProperty<float>(
81 "AdvancedVOR", 0,
"Advanced Vestibulo-ocular reflex weight");
83 defineOptionalProperty<std::string>(
"KinematicUnitName",
84 "Armar3KinematicUnit",
85 "Name of the KinematicUnit of the Robot");
86 defineOptionalProperty<std::string>(
88 "InertialMeasurementUnitObserver",
89 "Name of the InertialMeasurementUnitObserver of the Robot");
90 defineOptionalProperty<std::string>(
91 "RobotStateName",
"RobotStateComponent",
"Name of the RobotState of the Robot");
92 defineOptionalProperty<std::string>(
93 "HeadIKName",
"IKVirtualGazeNoEyes",
"Name of the HeadIK");
94 defineOptionalProperty<std::string>(
95 "RobotNodeSetName",
"Robot",
"Name of the RobotNodeSet");
97 defineOptionalProperty<std::string>(
"ImageSourceSelectionName",
98 "ImageSourceSelection",
99 "Name of the ImageSourceSelection component");
100 defineOptionalProperty<Ice::StringSeq>(
102 {
"Armar3ImageProvider",
"Armar3FovealImageProvider"},
103 "Name of the image provider to choose from. If image quality is high, the second "
104 "provider will be used.");
106 defineOptionalProperty<std::string>(
"DebugObserverName",
108 "Name of the topic the DebugObserver listens on");
110 defineOptionalProperty<std::string>(
112 "ArmarXSimulation/camera_simulator_640x480.txt",
113 "Camera calibration file, will be made available in the SLICE interface");
115 defineOptionalProperty<bool>(
118 "Add sinusoidal motion in the neck joint to test the reflexes");
119 defineOptionalProperty<bool>(
"reafferenceCombination",
121 "Combined reflexes with IK based on the reafference "
122 "principle (sensory cancelation)");
129 class FeedforwardReflex;
146 virtual public armarx::GazeStabilizationInterface
155 return "ReflexCombination";
161 const Ice::Current&
c = Ice::emptyCurrent)
override;
164 const Ice::Current&
c = Ice::emptyCurrent)
override;
195 void setImageQuality(
float quality);
198 std::map<std::string, NameValueMap> reflexValues;
199 std::map<std::string, ReflexPtr> reflexes;
200 std::vector<std::string> headJointNames;
207 bool armar4, velocityBased, neckPerturbation;
208 bool vorEnabled, jointIKEnabled, okrEnabled;
209 std::string eye_pitch_left, eye_pitch_right, eye_yaw_left, eye_yaw_right, neck_roll;
210 float vorWeight, okrWeight, jointIKWeight;
220 VirtualRobot::RobotNodeSetPtr robotNodeSet;
222 std::string headIKName;
228 KinematicUnitInterfacePrx kinUnitPrx;
231 ImageSourceSelectionInterfacePrx imageSourceSelection;
235 std::map<std::string, IceInternal::Handle<armarx::filters::DerivationFilter>>
237 std::map<std::string, IceInternal::Handle<armarx::filters::MedianFilter>> IMU_GyroFilters;
238 std::map<std::string, IceInternal::Handle<armarx::filters::ButterworthFilter>>
240 std::map<std::string, IceInternal::Handle<armarx::filters::ButterworthFilter>> FlowFilters;
249 const Ice::Current&
c = Ice::emptyCurrent)
override;
253 const Ice::Current&)
override;
260 const Ice::Current&
c = Ice::emptyCurrent)
override;
264 const Ice::Current&
c = Ice::emptyCurrent)
override;
268 const Ice::Current&
c = Ice::emptyCurrent)
override;
272 const Ice::Current&
c = Ice::emptyCurrent)
override;
276 const Ice::Current&
c = Ice::emptyCurrent)
override;
280 const Ice::Current&
c = Ice::emptyCurrent)
override;
284 const Ice::Current&
c = Ice::emptyCurrent)
override;
288 const Ice::Current&
c = Ice::emptyCurrent)
override;
292 void combineReflexes();
301 const Ice::Current&)
override;
306 const FramedPositionBasePtr& targetPosition,
307 const Ice::Current&
c = Ice::emptyCurrent)
override;
312 const std::string& name,
315 const Ice::Current&
c = Ice::emptyCurrent)
override;
330 const Ice::Current&)
override;
void reportJointTorques(const NameValueMap &, Ice::Long timestamp, bool, const Ice::Current &c=Ice::emptyCurrent) override
void reportHeadTargetChanged(const NameValueMap &targetJointAngles, const FramedPositionBasePtr &targetPosition, const Ice::Current &c=Ice::emptyCurrent) override
void onInitComponent() override
void reportHeadTargetChanged(const Ice::Current &)
const VariantTypeId Float
void updateWeights(float vor, float okr, float jointIK, const Ice::Current &c=Ice::emptyCurrent) override
void reportJointMotorTemperatures(const NameValueMap &, Ice::Long timestamp, bool, const Ice::Current &c=Ice::emptyCurrent) override
void onExitComponent() override
std::string getDefaultName() const override
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
void reportJointAngles(const NameValueMap &values, Ice::Long timestamp, bool valueChanged, const Ice::Current &c=Ice::emptyCurrent) override
void reportSensorValues(const std::string &device, const std::string &name, const IMUData &values, const TimestampBasePtr ×tamp, const Ice::Current &c=Ice::emptyCurrent) override
void reportPlatformVelocity(Ice::Float currentPlatformVelocityX, Ice::Float currentPlatformVelocityY, Ice::Float currentPlatformVelocityRotation, const Ice::Current &c=Ice::emptyCurrent) override
void reportControlModeChanged(const NameControlModeMap &, Ice::Long timestamp, bool, const Ice::Current &c=Ice::emptyCurrent) override
void reportJointAccelerations(const NameValueMap &, Ice::Long timestamp, bool, const Ice::Current &c=Ice::emptyCurrent) override
void reportNewTrackingError(Ice::Float pixelX, Ice::Float pixelY, Ice::Float angleX, Ice::Float angleY, const Ice::Current &) override
void reportJointCurrents(const NameValueMap &, Ice::Long timestamp, bool, const Ice::Current &c=Ice::emptyCurrent) override
void reportPlatformOdometryPose(Ice::Float, Ice::Float, Ice::Float, const Ice::Current &) override
Quaternion< float, 0 > Quaternionf
Baseclass for all ArmarX ManagedIceObjects requiring properties.
void onConnectComponent() override
void reportJointStatuses(const NameStatusMap &, Ice::Long timestamp, bool, const Ice::Current &c=Ice::emptyCurrent) override
Default component property definition container.
void setReafferenceMethod(bool isReafference, const Ice::Current &c=Ice::emptyCurrent) override
void reportJointVelocities(const NameValueMap &values, Ice::Long timestamp, bool valueChanged, const Ice::Current &c=Ice::emptyCurrent) override
ReflexCombinationPropertyDefinitions(std::string prefix)
void reportNewOpticalFlow(Ice::Float, Ice::Float, Ice::Float, Ice::Long, const Ice::Current &) override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Brief description of class ReflexCombination.
This file offers overloads of toIce() and fromIce() functions for STL container types.
void onDisconnectComponent() override
std::shared_ptr< class Robot > RobotPtr