Go to the documentation of this file.
32 #include <VirtualRobot/math/Helpers.h>
33 #include <VirtualRobot/MathTools.h>
40 const VirtualRobot::RobotNodeSetPtr& rns,
41 const Eigen::VectorXf& currentJointVelocity,
42 float maxPositionAcceleration,
43 float maxOrientationAcceleration,
44 float maxNullspaceAcceleration,
45 const VirtualRobot::RobotNodePtr& tcp,
46 const VirtualRobot::RobotNodePtr& referenceFrame
48 ctrlCartesianVelWithRamps
52 VirtualRobot::IKSolver::CartesianSelection::All,
53 maxPositionAcceleration,
54 maxOrientationAcceleration,
55 maxNullspaceAcceleration,
56 tcp ? tcp : rns->getTCP()
58 ctrlCartesianPos2Vel(tcp ? tcp : rns->getTCP(), referenceFrame),
59 currentWaypointIndex(0)
62 _out = Eigen::VectorXf::Zero(rns->getSize());
63 _jnv = Eigen::VectorXf::Zero(rns->getSize());
92 VirtualRobot::IKSolver::All
195 float dist = FLT_MAX;
197 for (
size_t i = 0; i <
waypoints.size(); i++)
201 float d = posErr + oriErr * rad2mmFactor;
219 std::stringstream ss;
241 cfg.maxPositionAcceleration,
242 cfg.maxOrientationAcceleration,
243 cfg.maxNullspaceAcceleration
248 #pragma GCC diagnostic push
249 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
251 #pragma GCC diagnostic pop
float getOrientationError() const
float thresholdOrientationReached
std::vector< Eigen::Matrix4f > waypoints
void setNullSpaceControl(bool enabled)
bool isCurrentTargetNear() const
void setCurrentJointVelocity(const Eigen::Ref< const Eigen::VectorXf > ¤tJointVelocity)
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
const Eigen::Vector3f getCurrentTargetPosition() const
CartesianPositionController ctrlCartesianPos2Vel
Vertex target(const detail::edge_base< Directed, Vertex > &e, const PCG &)
bool nullSpaceControlEnabled
size_t skipToClosestWaypoint(float rad2mmFactor)
bool isLastWaypoint() const
float getPositionError() const
void clearFeedForwardVelocity()
void swapWaypoints(std::vector< Eigen::Matrix4f > &waypoints)
void setMaxAccelerations(float maxPositionAcceleration, float maxOrientationAcceleration, float maxNullspaceAcceleration)
void setFeedForwardVelocity(const Eigen::Vector6f &feedForwardVelocity)
float getPositionError(const Eigen::Matrix4f &targetPose) const
void swap(SubscriptionHandle &first, SubscriptionHandle &second)
float thresholdPositionNear
CartesianWaypointController(const VirtualRobot::RobotNodeSetPtr &rns, const Eigen::VectorXf ¤tJointVelocity, float maxPositionAcceleration, float maxOrientationAcceleration, float maxNullspaceAcceleration, const VirtualRobot::RobotNodePtr &tcp=nullptr, const VirtualRobot::RobotNodePtr &referenceFrame=nullptr)
CartesianVelocityController controller
const Eigen::Matrix4f & getCurrentTarget() const
Eigen::VectorXf calculate(const Eigen::VectorXf &cartesianVel, float jointLimitAvoidanceScale, float dt)
bool isFinalTargetNear() const
bool isCurrentTargetReached() const
Eigen::Vector6f cartesianVelocity
const Eigen::VectorXf & calculate(float dt)
void setCurrentJointVelocity(const Eigen::Ref< const Eigen::VectorXf > ¤tJointVelocity)
size_t currentWaypointIndex
Eigen::VectorXf calculateJointLimitAvoidance()
float thresholdPositionReached
void setWaypoints(const std::vector< Eigen::Matrix4f > &waypoints)
void addWaypoint(const Eigen::Matrix4f &waypoint)
MatrixXX< 4, 4, float > Matrix4f
void setTarget(const Eigen::Matrix4f &target)
float KpJointLimitAvoidance
float jointLimitAvoidanceScale
bool autoClearFeedForward
bool isFinalTargetReached() const
void setConfig(const CartesianWaypointControllerConfig &cfg)
Eigen::Vector6f feedForwardVelocity
Eigen::VectorXf calculateNullspaceVelocity(const Eigen::VectorXf &cartesianVel, float KpScale, VirtualRobot::IKSolver::CartesianSelection mode)
float thresholdOrientationNear
float getOrientationError(const Eigen::Matrix4f &targetPose) const
This file offers overloads of toIce() and fromIce() functions for STL container types.
CartesianVelocityControllerWithRamp ctrlCartesianVelWithRamps
std::string getStatusText()
Eigen::VectorXf calculate(const Eigen::Matrix4f &targetPose, VirtualRobot::IKSolver::CartesianSelection mode) const