1 #ifndef YOCS_DIFF_DRIVE_POSE_CONTROLLER_HPP_ 2 #define YOCS_DIFF_DRIVE_POSE_CONTROLLER_HPP_ 38 DiffDrivePoseController(std::string name,
double v_max,
double w_max,
double dist_thres = 0.01,
double orient_thres =
40 double dist_eps = 0.01 * 0.2,
double orient_eps = 0.02 * 0.2,
double orientation_gain = 0.3,
41 double k_1 = 1.0,
double k_2 = 3.0,
double beta = 0.4,
double lambda = 2.0,
double v_min =
43 double v_min_movement = 0.01,
double w_min_movement = 0.01);
59 void setCurrentLimits(
double v_min,
double w_min,
double v_max,
double w_max);
67 virtual void setInput(
double distance_to_goal,
double delta,
double theta);
double v_min_movement_
minimum linear base velocity at which we still move [m/s]
virtual void getControlOutput(double &v, double &w)
Get controller result / output after spinning.
void setVerbosity(const bool &verbose)
double delta_
current heading of the base [rad]
double r_
distance to pose goal [m]
virtual void controlPose()
virtual ~DiffDrivePoseController()
double dist_eps_
Error in distance above which pose is considered different.
bool verbose_
Enable or disable ros messages.
double k_2_
constant factor applied to the heading error feedback
virtual double enforceMinMax(double &value, double min, double max)
Enforce value to be between min and max.
virtual void controlOrientation(double angle_difference)
double orient_eps_
Error in orientation above which pose is considered different.
double w_
angular base velocity [rad/s]
A controller for driving a differential drive base to a pose goal or along a path specified by multip...
virtual bool init()
unused, overwrite if inherited (and needed)
double w_min_
(current) minimum angular base velocity [rad/s]
double cur_
path to goal curvature
double orientation_gain_
p gain for angle controller
bool pose_reached_
True, if pose has been reached (v == 0, w == 0)
virtual void onGoalReached()
Gets executed when goal is reached, use in child class.
double theta_
direction of the pose goal [rad]
double v_max_
maximum linear base velocity [m/s]
virtual void setInput(double distance_to_goal, double delta, double theta)
Set input of controller. Should be called before each spinOnce.
double w_min_movement_
minimum angular base velocity at which we still move [rad/s]
double v_min_
(current) minimum linear base velocity [m/s]
virtual void calculateControls()
Calculates the controls with the set variables (speed, goal etc.)
void setCurrentLimits(double v_min, double w_min, double v_max, double w_max)
TFSIMD_FORCE_INLINE const tfScalar & w() const
DiffDrivePoseController(std::string name, double v_max, double w_max, double dist_thres=0.01, double orient_thres=0.02, double dist_eps=0.01 *0.2, double orient_eps=0.02 *0.2, double orientation_gain=0.3, double k_1=1.0, double k_2=3.0, double beta=0.4, double lambda=2.0, double v_min=0.01, double v_min_movement=0.01, double w_min_movement=0.01)
double orient_thres_
lower bound for the orientation (w = 0)
double v_
linear base velocity [m/s]
double w_max_
maximum angular base velocity [rad/s]
double dist_thres_
lower bound for the distance (v = 0)
double k_1_
constant factor determining the ratio of the rate of change in theta to the rate of change in r ...
virtual double enforceMinVelocity(double value, double min)
Enforce the minimum velocity.
virtual bool step()
Execute one controller step.