Go to the documentation of this file.
27 #include <RobotAPI/interface/components/TrajectoryPlayerInterface.h>
29 #include "../NJointControllers/NJointTrajectoryController.h"
30 #include "../RobotUnit.h"
43 defineRequiredProperty<std::string>(
"KinematicUnitName",
44 "Name of the KinematicUnit. Only needed for "
45 "returning to zeroFramePose while resetting.");
46 defineOptionalProperty<float>(
"Kp",
48 "Proportional gain value of PID Controller",
50 defineOptionalProperty<float>(
"Ki",
52 "Integral gain value of PID Controller",
54 defineOptionalProperty<float>(
"Kd",
56 "Differential gain value of PID Controller",
58 defineOptionalProperty<float>(
61 "The PID will never set a velocity above this threshold (degree/s)");
62 defineOptionalProperty<std::string>(
"CustomRootNode",
64 "If this value is set, the root pose of the motion "
65 "is set for this node instead of the root joint.");
67 defineOptionalProperty<bool>(
"EnableRobotPoseUnit",
69 "Specify whether RobotPoseUnit should be used to move the "
70 "robot's position. Only useful in simulation.");
71 defineOptionalProperty<std::string>(
74 "Name of the RobotPoseUnit to which the robot position should be sent");
82 virtual public TrajectoryPlayerInterface,
91 const Ice::Current& = Ice::emptyCurrent)
override;
94 const Ice::Current& = Ice::emptyCurrent)
override;
96 const Ice::Current& = Ice::emptyCurrent)
override;
98 void setLoopPlayback(
bool loop,
const Ice::Current& = Ice::emptyCurrent)
override;
110 void setIsPreview(
bool,
const Ice::Current& = Ice::emptyCurrent)
override;
112 setJointsInUse(
const std::string&,
bool,
const Ice::Current& = Ice::emptyCurrent)
override;
127 const Ice::Current&)
override
160 const Ice::Current&)
override
183 return "TrajectoryPlayer";
197 NJointTrajectoryControllerPtr
198 createTrajectoryController(std::vector<std::string>& jointNames,
bool deleteIfAlreadyExist);
199 void assureTrajectoryController();
200 bool controllerExists();
204 NJointTrajectoryControllerPtr jointTrajController;
205 std::string controllerName = this->
getName() +
"_" +
"JointTrajectory";
211 bool robotPoseUnitEnabled;
212 std::string robotPoseUnitName;
216 std::vector<std::string> usedJoints;
218 std::string kinematicUnitName;
219 KinematicUnitInterfacePrx kinematicUnit;
220 std::string customRootNode;
226 bool considerConstraintsForTrajectoryOptimization =
false;
228 bool isPreview =
false;
232 std::mutex dataMutex;
233 std::recursive_mutex controllerMutex;
234 bool recreateController =
true;
bool setJointsInUse(const std::string &, bool, const Ice::Current &=Ice::emptyCurrent) override
virtual void componentPropertiesUpdated(const std::set< std::string > &changedProperties) override
Implement this function if you would like to react to changes in the properties.
void setOffset(const ::Eigen::Matrix4f &, const ::Ice::Current &=::Ice::emptyCurrent) override
Structure used by the RobotUnit to swap lists of Joint and NJoint controllers.
TYPEDEF_PTRS_HANDLE(NJointCartesianNaturalPositionController)
Ice::Double getTrajEndTime(const Ice::Current &=Ice::emptyCurrent) override
std::string getDefaultName() const override
Retrieve default name of component.
void reportJointTorques(const NameValueMap &, Ice::Long, bool, const Ice::Current &) override
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
void reportJointAngles(const NameValueMap &, Ice::Long, bool, const Ice::Current &) override
void update(const SensorAndControl &sc, const JointAndNJointControllers &c) override
void reportJointCurrents(const NameValueMap &, Ice::Long, bool, const Ice::Current &) override
const VariantTypeId Double
void setup(RobotUnit *rUnit)
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
bool stopTrajectoryPlayer(const Ice::Current &=Ice::emptyCurrent) override
void onConnectComponent() override
Pure virtual hook for the subclass.
void enableRobotPoseUnit(bool, const Ice::Current &=Ice::emptyCurrent) override
void reportJointAccelerations(const NameValueMap &, Ice::Long, bool, const Ice::Current &) override
Ice::Double getEndTime(const Ice::Current &=Ice::emptyCurrent) override
void reportJointVelocities(const NameValueMap &, Ice::Long, bool, const Ice::Current &) override
void onInitComponent() override
Pure virtual hook for the subclass.
void setLoopPlayback(bool loop, const Ice::Current &=Ice::emptyCurrent) override
Baseclass for all ArmarX ManagedIceObjects requiring properties.
bool startTrajectoryPlayer(const Ice::Current &=Ice::emptyCurrent) override
bool pauseTrajectoryPlayer(const Ice::Current &=Ice::emptyCurrent) override
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
void considerConstraints(bool, const Ice::Current &=Ice::emptyCurrent) override
void reportControlModeChanged(const NameControlModeMap &, Ice::Long, bool, const Ice::Current &) override
void loadBasePoseTraj(const TrajectoryBasePtr &basePoseTraj, const Ice::Current &=Ice::emptyCurrent) override
MatrixXX< 4, 4, float > Matrix4f
Default component property definition container.
void setEndTime(Ice::Double, const Ice::Current &=Ice::emptyCurrent) override
TrajectoryControllerSubUnitPropertyDefinitions(std::string prefix)
The RobotUnit class manages a robot and its controllers.
void onDisconnectComponent() override
Hook for subclass.
void setIsVelocityControl(bool, const Ice::Current &=Ice::emptyCurrent) override
Ice::Double getCurrentTime(const Ice::Current &=Ice::emptyCurrent) override
void setIsPreview(bool, const Ice::Current &=Ice::emptyCurrent) override
std::string getName() const
Retrieve name of object.
void reportJointStatuses(const NameStatusMap &, Ice::Long, bool, const Ice::Current &) override
void reportJointMotorTemperatures(const NameValueMap &, Ice::Long, bool, const Ice::Current &) override
bool resetTrajectoryPlayer(bool moveToFrameZeroPose, const Ice::Current &=Ice::emptyCurrent) override
void loadJointTraj(const TrajectoryBasePtr &jointTraj, const Ice::Current &=Ice::emptyCurrent) override
This file offers overloads of toIce() and fromIce() functions for STL container types.