Go to the documentation of this file.
25 #include <VirtualRobot/Robot.h>
26 #include <VirtualRobot/IK/DifferentialIK.h>
33 #include <armarx/control/common/FTSensor.h>
35 #include <armarx/control/njoint_mp_controller/task_space/ControllerInterface.h>
37 #include <mplib/core/SampledTrajectory.h>
38 #include <mplib/representation/vmp/PrincipalComponentVMP.h>
39 #include <mplib/factories/VMPFactory.h>
40 #include <mplib/factories/AbstractMPFactory.h>
41 #include <mplib/factories/MPFactoryCreator.h>
62 public KeypointMPControllerInterface
66 using VMPPtr = std::shared_ptr<mplib::representation::vmp::PrincipalComponentVMP>;
70 std::string
getClassName(
const Ice::Current&)
const override;
80 void setKeypoints(
const Eigen::VectorXf&,
const Ice::Current &)
override;
81 void resetKeypoints(
const int n_points,
const float keypoint_stiffness,
const bool is_rigid,
const Eigen::VectorXf& ctrl_mask,
const Eigen::VectorXf& init_keypoints_position,
const Ice::Current &)
override;
90 void setControlParameters(
const std::string&,
const Eigen::VectorXf&,
const Ice::Current&)
override;
101 std::string
getNames(
const Ice::Current &)
override;
102 void start(
const Ice::DoubleSeq &,
const Ice::Current &)
override;
106 void stop(
const Ice::Current &)
override;
107 void pause(
const Ice::Current &)
override;
108 void resume(
const Ice::Current &)
override;
109 void reset(
const Ice::Current &)
override;
110 bool isFinished(
const Ice::Current &)
override;
111 void learnFromCSV(
const Ice::StringSeq &,
const Ice::Current &)
override;
112 void setGoal(
const Ice::DoubleSeq &,
const Ice::Current &)
override;
113 void setStartAndGoal(
const Ice::DoubleSeq &,
const Ice::DoubleSeq &,
const Ice::Current &)
override;
116 std::string
serialize(
const Ice::Current &)
override;
117 Ice::DoubleSeq
deserialize(
const std::string& mpAsString,
const Ice::Current &)
override;
120 void toggleMP(
const bool enableMP,
const Ice::Current &)
override;
132 std::vector<const SensorValue1DoFActuatorTorque*> torqueSensors;
133 std::vector<const SensorValue1DoFActuatorVelocity*> velocitySensors;
134 std::vector<const SensorValue1DoFActuatorPosition*> positionSensors;
135 std::vector<ControlTarget1DoFActuatorTorque*> targets;
140 StringFloatDictionary desired_torques;
148 mplib::core::DVec2d currentState;
154 std::string kinematicChainName;
155 std::vector<std::string> jointNames;
156 law::TaskspaceKeypointsAdmittanceController
controller;
157 common::FTSensor ftsensor;
159 std::atomic_bool rtFirstRun =
true;
160 std::atomic_bool rtReady =
false;
164 Eigen::VectorXf initialStateEigen;
165 mplib::core::DVec2d initialState;
166 mplib::core::DVec2d currentState;
172 double timeDuration = 0.0;
173 std::atomic_bool mpRunning =
false;
174 std::atomic_bool mpFinished =
false;
176 std::atomic_bool mpEnabled {
false};
Ice::DoubleSeq deserialize(const std::string &mpAsString, const Ice::Current &) override
KeypointMPController(const RobotUnitPtr &robotUnit, const NJointControllerConfigPtr &config, const VirtualRobot::RobotPtr &)
void publishPose(StringVariantBaseMap &datafields, const std::string &name, const Eigen::Matrix4f &pose)
const VariantTypeId Float
std::string getKinematicChainName(const Ice::Current &) override
Brief description of class KeypointMPController.
std::map< std::string, VariantBasePtr > StringVariantBaseMap
void publishVec6f(StringVariantBaseMap &datafields, const std::string &name, const Eigen::Vector6f &vec)
void setTCPPose(const Eigen::Matrix4f &, const Ice::Current &) override
void reconfigureController(const std::string &, const Ice::Current &) override
std::shared_ptr< mplib::representation::vmp::PrincipalComponentVMP > VMPPtr
void setStartAndGoal(const Ice::DoubleSeq &, const Ice::DoubleSeq &, const Ice::Current &) override
NJointControllerConfigPtr ConfigPtrT
void start(const Ice::DoubleSeq &, const Ice::Current &) override
Ice::Double getCanVal(const Ice::Current &) override
void setKeypoints(const Eigen::VectorXf &, const Ice::Current &) override
std::string serialize(const Ice::Current &) override
This file is part of ArmarX.
void setForceTorqueBaseline(const Eigen::Vector3f &, const Eigen::Vector3f &, const Ice::Current &) override
void calibrateFTSensor(const Ice::Current &) override
const VariantTypeId Double
void pause(const Ice::Current &) override
void resetKeypoints(const int n_points, const float keypoint_stiffness, const bool is_rigid, const Eigen::VectorXf &ctrl_mask, const Eigen::VectorXf &init_keypoints_position, const Ice::Current &) override
void startAsTrajWithTime(Ice::Double, const Ice::Current &) override
void onPublish(const SensorAndControl &, const DebugDrawerInterfacePrx &, const DebugObserverInterfacePrx &) override
std::string getNames(const Ice::Current &) override
void startWithTime(const Ice::DoubleSeq &, Ice::Double, const Ice::Current &) override
void learnFromCSV(const Ice::StringSeq &, const Ice::Current &) override
void setTCPCoMInFTFrame(const Eigen::Vector3f &, const Ice::Current &) override
bool getMPEnabled(const Ice::Current &) override
void toggleGravityCompensation(const bool toggle, const Ice::Current &) override
ft sensor
This file is part of ArmarX.
void resume(const Ice::Current &) override
armarx::core::time::DateTime Time
void setGoal(const Ice::DoubleSeq &, const Ice::Current &) override
This file is part of ArmarX.
bool isFinished(const Ice::Current &) override
void toggleMP(const bool enableMP, const Ice::Current &) override
void rtPreActivateController() override
This function is called before the controller is activated.
MatrixXX< 4, 4, float > Matrix4f
void publishVecXf(StringVariantBaseMap &datafields, const std::string &name, const Eigen::Vector6f &vec)
void removeAllViaPoint(const Ice::Current &) override
void setViaPoint(Ice::Double, const Ice::DoubleSeq &, const Ice::Current &) override
std::string getClassName(const Ice::Current &) const override
void setControlParameters(const std::string &, const Eigen::VectorXf &, const Ice::Current &) override
set control parameter
void rtRun(const IceUtil::Time &sensorValuesTimestamp, const IceUtil::Time &timeSinceLastIteration) override
TODO make protected and use attorneys.
void setTCPMass(Ice::Float, const Ice::Current &) override
void reset(const Ice::Current &) override
void onInitNJointController() override
std::shared_ptr< class Robot > RobotPtr
void stop(const Ice::Current &) override
void startAsTraj(const Ice::Current &) override