35 #include <VirtualRobot/VirtualRobot.h>
36 #include <VirtualRobot/Robot.h>
37 #include <VirtualRobot/Nodes/RobotNode.h>
38 #include <VirtualRobot/RobotNodeSet.h>
39 #include <VirtualRobot/IK/GazeIK.h>
44 #include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
46 #include <VisionX/interface/components/ImageSourceSelectionInterface.h>
48 #include <RobotComponents/interface/GazeStabilizationInterface.h>
71 defineOptionalProperty<bool>(
"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>(
"AdvancedVOR", 0,
"Advanced Vestibulo-ocular reflex weight");
82 defineOptionalProperty<std::string>(
"KinematicUnitName",
"Armar3KinematicUnit",
"Name of the KinematicUnit of the Robot");
83 defineOptionalProperty<std::string>(
"IMUObserverName",
"InertialMeasurementUnitObserver",
"Name of the InertialMeasurementUnitObserver of the Robot");
84 defineOptionalProperty<std::string>(
"RobotStateName",
"RobotStateComponent",
"Name of the RobotState of the Robot");
85 defineOptionalProperty<std::string>(
"HeadIKName",
"IKVirtualGazeNoEyes",
"Name of the HeadIK");
86 defineOptionalProperty<std::string>(
"RobotNodeSetName",
"Robot",
"Name of the RobotNodeSet");
88 defineOptionalProperty<std::string>(
"ImageSourceSelectionName",
"ImageSourceSelection",
"Name of the ImageSourceSelection component");
89 defineOptionalProperty<Ice::StringSeq>(
"ImageProviders", {
"Armar3ImageProvider",
"Armar3FovealImageProvider"},
"Name of the image provider to choose from. If image quality is high, the second provider will be used.");
91 defineOptionalProperty<std::string>(
"DebugObserverName",
"DebugObserver",
"Name of the topic the DebugObserver listens on");
93 defineOptionalProperty<std::string>(
"CalibrationFile",
"ArmarXSimulation/camera_simulator_640x480.txt",
"Camera calibration file, will be made available in the SLICE interface");
95 defineOptionalProperty<bool>(
"NeckPerturbation",
false,
"Add sinusoidal motion in the neck joint to test the reflexes");
96 defineOptionalProperty<bool>(
"reafferenceCombination",
false,
"Combined reflexes with IK based on the reafference principle (sensory cancelation)");
103 class FeedforwardReflex;
120 virtual public armarx::GazeStabilizationInterface
128 return "ReflexCombination";
131 void updateWeights(
float vor,
float okr,
float jointIK,
const Ice::Current&
c = Ice::emptyCurrent)
override;
165 void setImageQuality(
float quality);
168 std::map<std::string, NameValueMap> reflexValues;
169 std::map<std::string, ReflexPtr> reflexes;
170 std::vector<std::string> headJointNames;
177 bool armar4, velocityBased, neckPerturbation;
178 bool vorEnabled, jointIKEnabled, okrEnabled;
179 std::string eye_pitch_left, eye_pitch_right, eye_yaw_left, eye_yaw_right, neck_roll;
180 float vorWeight, okrWeight, jointIKWeight;
190 VirtualRobot::RobotNodeSetPtr robotNodeSet;
192 std::string headIKName;
198 KinematicUnitInterfacePrx kinUnitPrx;
201 ImageSourceSelectionInterfacePrx imageSourceSelection;
205 std::map<std::string, IceInternal::Handle<armarx::filters::DerivationFilter>> VelocityFilters;
206 std::map<std::string, IceInternal::Handle<armarx::filters::MedianFilter>> IMU_GyroFilters;
207 std::map<std::string, IceInternal::Handle<armarx::filters::ButterworthFilter>> PreVelocityFilters;
208 std::map<std::string, IceInternal::Handle<armarx::filters::ButterworthFilter>> FlowFilters;
230 void combineReflexes();
243 void reportSensorValues(
const std::string& device,
const std::string& name,
const IMUData&
values,
const TimestampBasePtr& timestamp,
const Ice::Current&
c = Ice::emptyCurrent)
override;