26#include <Eigen/Geometry>
28#include <VirtualRobot/Robot.h>
36 "NJointHolonomicPlatformRelativePositionController");
41 const NJointHolonomicPlatformRelativePositionControllerConfigPtr& cfg,
43 pid(cfg->p, cfg->i, cfg->d, cfg->maxVelocity, cfg->maxAcceleration)
50 <<
"The actuator '" << cfg->platformName <<
"' has no control mode "
51 << ControlModes::HolonomicPlatformVelocity;
53 pid.threadSafe =
false;
55 oriCtrl.maxV = cfg->maxRotationVelocity;
56 oriCtrl.acceleration = cfg->maxRotationAcceleration;
57 oriCtrl.deceleration = cfg->maxRotationAcceleration;
68 const IceUtil::Time& timeSinceLastIteration)
83 pid.update(timeSinceLastIteration.toSecondsDouble(),
84 relativeCurrentPosition,
90 Eigen::Vector2f localTargetVelocity =
92 Eigen::Vector2f(
pid.getControlValue()[0],
pid.getControlValue()[1]);
95 target->velocityX = localTargetVelocity[0];
96 target->velocityY = localTargetVelocity[1];
98 oriCtrl.dt = timeSinceLastIteration.toSecondsDouble();
100 oriCtrl.currentPosition = relativeOrientation;
104 Eigen::Vector2f posError =
pid.target.head(2) -
pid.processValue.head(2);
133 float translationAccuracy,
134 float rotationAccuracy)
const SensorValueBase * useSensorValue(const std::string &sensorDeviceName) const
Get a const ptr to the given SensorDevice's SensorValue.
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...
const NJointHolonomicPlatformRelativePositionControllerTarget & rtGetControlStruct() const
MutexType controlDataMutex
std::lock_guard< std::recursive_mutex > LockGuardType
void writeControlStruct()
NJointHolonomicPlatformRelativePositionControllerTarget & getWriterControlStruct()
The RobotUnit class manages a robot and its controllers.
The SensorValueBase class.
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...
std::shared_ptr< class Robot > RobotPtr
This file offers overloads of toIce() and fromIce() functions for STL container types.
NJointControllerRegistration< NJointHolonomicPlatformRelativePositionController > registrationNJointHolonomicPlatformRelativePositionController("NJointHolonomicPlatformRelativePositionController")