Go to the documentation of this file.
35 ramp(cfg->maxPositionAcceleration, cfg->maxOrientationAcceleration)
40 <<
"The actuator " << cfg->platformName <<
" has no control mode "
41 << ControlModes::HolonomicPlatformVelocity;
47 <<
"Sensor value for " << cfg->platformName <<
" has invalid type";
75 "Platform target velocity was not set for a too long time: delay: ")
76 << commandAge.toSecondsDouble()
77 <<
" s, max allowed delay: " <<
maxCommandDelay.toSecondsDouble() <<
" s";
81 Eigen::Vector3f result;
85 const Eigen::Vector3f targetVelocity = Eigen::Vector3f::Zero();
86 result =
ramp.
update(targetVelocity, timeSinceLastIteration.toSecondsDouble());
93 result =
ramp.
update(x, timeSinceLastIteration.toSecondsDouble());
104 float maxPositionAcceleration,
105 float maxOrientationAcceleration)
113 "NJointHolonomicPlatformVelocityControllerWithRamp");
116 float maxOrientationAcceleration) :
117 maxPositionAcceleration(maxPositionAcceleration),
118 maxOrientationAcceleration(maxOrientationAcceleration)
135 Eigen::Vector3f delta =
target - state;
138 Eigen::Vector2f posDelta = delta.block<2, 1>(0, 0);
139 float posFactor = posDelta.norm() / maxPositionAcceleration /
dt;
140 factor =
std::max(factor, posFactor);
142 float oriFactor =
std::abs(delta(2)) / maxOrientationAcceleration /
dt;
143 factor =
std::max(factor, oriFactor);
145 state += delta / factor;
152 this->maxPositionAcceleration = maxPositionAcceleration;
158 this->maxOrientationAcceleration = maxOrientationAcceleration;
const NJointHolonomicPlatformVelocityControllerControlData & rtGetControlStruct() const
Eigen::Vector3f update(const Eigen::Vector3f &target, float dt)
ControlTargetBase * useControlTarget(const std::string &deviceName, const std::string &controlMode)
Declares to calculate the ControlTarget for the given ControlDevice in the given ControlMode when rtR...
NJointControllerRegistration< NJointHolonomicPlatformVelocityControllerWithRamp > registrationNJointHolonomicPlatformVelocityControllerWithRamp("NJointHolonomicPlatformVelocityControllerWithRamp")
Vertex target(const detail::edge_base< Directed, Vertex > &e, const PCG &)
NJointControllerConfigPtr ConfigPtrT
std::vector< T > abs(const std::vector< T > &v)
void init(const Eigen::Vector3f &state)
armarx::core::time::DateTime Time
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...
The RobotUnit class manages a robot and its controllers.
void setMaxOrientationAcceleration(float maxOrientationAcceleration)
void setMaxPositionAcceleration(float maxPositionAcceleration)
This file offers overloads of toIce() and fromIce() functions for STL container types.
Cartesian2DimVelocityRamp(float maxPositionAcceleration, float maxOrientationAcceleration)
const SensorValueBase * useSensorValue(const std::string &sensorDeviceName) const
Get a const ptr to the given SensorDevice's SensorValue.
std::shared_ptr< class Robot > RobotPtr