18 #ifndef COB_TWIST_CONTROLLER_CONSTRAINTS_CONSTRAINT_BASE_H 19 #define COB_TWIST_CONTROLLER_CONSTRAINTS_CONSTRAINT_BASE_H 25 #include <boost/shared_ptr.hpp> 26 #include <kdl/jntarray.hpp> 27 #include <kdl/jntarrayvel.hpp> 39 <
typename PRIO = uint32_t>
81 virtual std::string
getTaskId()
const = 0;
95 const Eigen::MatrixXd& homogeneous_solution)
const = 0;
110 <
typename T_PARAMS,
typename PRIO = uint32_t>
123 constraint_params_(params),
124 callback_data_mediator_(cbdm),
126 derivative_value_(0.0),
127 prediction_value_(
std::numeric_limits<double>::
max()),
129 last_time_(
ros::Time::
now()),
130 last_pred_time_(
ros::Time::
now())
132 this->member_inst_cnt_ = instance_ctr_++;
147 virtual std::string
getTaskId()
const = 0;
156 return Eigen::MatrixXd::Zero(1, 1);
161 return Eigen::VectorXd::Zero(1, 1);
170 this->joint_states_ = joint_states;
171 this->jacobian_data_ = jacobian_data;
172 this->jnts_prediction_ = joints_prediction;
173 this->callback_data_mediator_.fill(this->constraint_params_);
186 return this->derivative_value_;
191 return this->partial_values_;
196 return this->prediction_value_;
201 const Eigen::MatrixXd& homogeneous_solution)
const = 0;
229 template <
typename T_PARAMS,
typename PRIO>
234 #endif // COB_TWIST_CONTROLLER_CONSTRAINTS_CONSTRAINT_BASE_H
virtual Eigen::MatrixXd getTaskJacobian() const =0
virtual Eigen::VectorXd getTaskDerivatives() const
bool operator<(const PriorityBase &other) const
void setPriority(PRIO prio)
virtual Eigen::MatrixXd getTaskJacobian() const
CallbackDataMediator & callback_data_mediator_
JointStates joint_states_
bool operator==(const PriorityBase &other) const
virtual double getCriticalValue() const =0
static uint32_t instance_ctr_
Matrix6Xd_t jacobian_data_
virtual double getCriticalValue() const
virtual double getPredictionValue() const
uint32_t member_inst_cnt_
virtual double getActivationGain() const =0
virtual Eigen::VectorXd getPartialValues() const =0
virtual Task_t createTask()
virtual double getValue() const
virtual Task_t createTask()=0
ConstraintBase(PRIO prio, T_PARAMS params, CallbackDataMediator &cbdm)
virtual double getValue() const =0
bool operator>(const PriorityBase &other) const
virtual double getDerivativeValue() const =0
T_PARAMS constraint_params_
KDL::JntArrayVel jnts_prediction_
virtual std::string getTaskId() const =0
virtual ConstraintState getState() const
virtual double getSelfMotionMagnitude(const Eigen::MatrixXd &particular_solution, const Eigen::MatrixXd &homogeneous_solution) const =0
ros::Time last_pred_time_
virtual double getPredictionValue() const =0
virtual void update(const JointStates &joint_states, const KDL::JntArrayVel &joints_prediction, const Matrix6Xd_t &jacobian_data)=0
Eigen::Matrix< double, 6, Eigen::Dynamic > Matrix6Xd_t
virtual ConstraintState getState() const =0
virtual void calculate()=0
virtual double getDerivativeValue() const
virtual Eigen::VectorXd getTaskDerivatives() const =0
virtual void update(const JointStates &joint_states, const KDL::JntArrayVel &joints_prediction, const Matrix6Xd_t &jacobian_data)
double max(double a, double b)
boost::shared_ptr< PriorityBase< uint32_t > > ConstraintBase_t
double getPriorityAsNum() const
Ensure priority class has overwritten double() operator.
Eigen::VectorXd partial_values_
virtual ~ConstraintBase()
virtual Eigen::VectorXd getPartialValues() const