A basic position controller. More...
#include <controller.h>
Public Member Functions | |
BasicController () | |
Service method. | |
void | controlLoop () |
void | init () |
bool | startControl (std_srvs::Empty::Request &, std_srvs::Empty::Response &) |
Service method: (set hover mode and) take off and start the controller. | |
bool | stopControl (std_srvs::Empty::Request &, std_srvs::Empty::Response &) |
Service method: stop the controller and land (and set hover mode) | |
~BasicController () | |
Destructor. | |
Private Member Functions | |
void | poseCb (const ucl_drone::Pose3D::ConstPtr posePtr) |
Callback when pose is received. | |
void | poseRefCb (const ucl_drone::PoseRef::ConstPtr poseRefPtr) |
Callback when new pose ref is received. | |
void | reguAltitude (double *zvel_cmd, double alt_mes, double alt_desired, double regu_new_time_z) |
void | reguXY (double *xvel_cmd, double *yvel_cmd, double x_mes, double y_mes, double x_desired, double y_desired, double yaw, double regu_new_time_xy) |
void | reguYaw (double *yawvel_cmd, double yaw_mes, double yaw_desired, double regu_new_time) |
void | sendVelToDrone (double pitch, double roll, double yaw_vel, double zvel_cmd, bool force=false) |
Private Attributes | |
double | alt_desired_old |
float | alt_ref |
Reference. | |
double | anti_windup_yaw |
std::string | control_channel |
double | dist_old |
double | integral_alt_error |
double | integral_f_error |
double | integral_l_error |
double | integral_xy_error |
double | integral_yaw_error |
bool | isControlling |
is true if the controller is running | |
double | Kd_alt |
double | Kd_plan |
double | Kd_yaw |
double | Ki_alt |
double | Ki_plan |
double | Ki_yaw |
double | Kp_alt |
double | Kp_plan |
double | Kp_yaw |
std::string | land_channel |
ros::Publisher | land_pub |
double | last_vel_x_command |
double | last_vel_y_command |
double | last_vel_yaw_command |
double | last_vel_z_command |
ucl_drone::Pose3D | lastPoseReceived |
Measure. | |
ucl_drone::PoseRef | lastPoseRefReceived |
Pose desired. | |
ros::NodeHandle | nh |
double | old_delta_alt |
double | old_delta_yaw |
double | old_yaw_desired |
double | p_term_f_old |
double | p_term_l_old |
std::string | pose_channel |
ros::Subscriber | pose_sub |
std::string | poseref_channel |
ros::Subscriber | poseref_sub |
double | regu_old_time_xy |
double | regu_old_time_yaw |
double | regu_old_time_z |
std::string | reset_channel |
ros::Publisher | reset_pub |
ros::ServiceServer | startControl_ |
Service to set a new Pose. | |
ros::ServiceServer | stopControl_ |
Service to stop regulation and land. | |
std::string | takeoff_channel |
ros::Publisher | takeoff_pub |
std::string | toggleState_channel |
ros::Publisher | toggleState_pub |
ros::Publisher | vel_pub |
double | x_desired_old |
double | x_ref |
double | y_desired_old |
double | y_ref |
double | yaw_desired_old |
double | yaw_ref |
A basic position controller.
Definition at line 39 of file controller.h.
Destructor.
Definition at line 116 of file controller.cpp.
void BasicController::controlLoop | ( | ) |
Definition at line 373 of file controller.cpp.
void BasicController::init | ( | ) |
void BasicController::poseCb | ( | const ucl_drone::Pose3D::ConstPtr | posePtr | ) | [private] |
Callback when pose is received.
Definition at line 359 of file controller.cpp.
void BasicController::poseRefCb | ( | const ucl_drone::PoseRef::ConstPtr | poseRefPtr | ) | [private] |
Callback when new pose ref is received.
Definition at line 366 of file controller.cpp.
void BasicController::reguAltitude | ( | double * | zvel_cmd, |
double | alt_mes, | ||
double | alt_desired, | ||
double | regu_new_time_z | ||
) | [private] |
Definition at line 216 of file controller.cpp.
void BasicController::reguXY | ( | double * | xvel_cmd, |
double * | yvel_cmd, | ||
double | x_mes, | ||
double | y_mes, | ||
double | x_desired, | ||
double | y_desired, | ||
double | yaw, | ||
double | regu_new_time_xy | ||
) | [private] |
Definition at line 153 of file controller.cpp.
void BasicController::reguYaw | ( | double * | yawvel_cmd, |
double | yaw_mes, | ||
double | yaw_desired, | ||
double | regu_new_time | ||
) | [private] |
Definition at line 271 of file controller.cpp.
void BasicController::sendVelToDrone | ( | double | pitch, |
double | roll, | ||
double | yaw_vel, | ||
double | zvel_cmd, | ||
bool | force = false |
||
) | [private] |
Definition at line 337 of file controller.cpp.
bool BasicController::startControl | ( | std_srvs::Empty::Request & | req, |
std_srvs::Empty::Response & | res | ||
) |
Service method: (set hover mode and) take off and start the controller.
Definition at line 122 of file controller.cpp.
bool BasicController::stopControl | ( | std_srvs::Empty::Request & | req, |
std_srvs::Empty::Response & | res | ||
) |
Service method: stop the controller and land (and set hover mode)
Definition at line 139 of file controller.cpp.
double BasicController::alt_desired_old [private] |
Definition at line 95 of file controller.h.
float BasicController::alt_ref [private] |
Reference.
Definition at line 64 of file controller.h.
double BasicController::anti_windup_yaw [private] |
Definition at line 85 of file controller.h.
std::string BasicController::control_channel [private] |
Definition at line 54 of file controller.h.
double BasicController::dist_old [private] |
Definition at line 92 of file controller.h.
double BasicController::integral_alt_error [private] |
Definition at line 80 of file controller.h.
double BasicController::integral_f_error [private] |
Definition at line 83 of file controller.h.
double BasicController::integral_l_error [private] |
Definition at line 84 of file controller.h.
double BasicController::integral_xy_error [private] |
Definition at line 82 of file controller.h.
double BasicController::integral_yaw_error [private] |
Definition at line 81 of file controller.h.
bool BasicController::isControlling [private] |
is true if the controller is running
Definition at line 61 of file controller.h.
double BasicController::Kd_alt [private] |
Definition at line 71 of file controller.h.
double BasicController::Kd_plan [private] |
Definition at line 76 of file controller.h.
double BasicController::Kd_yaw [private] |
Definition at line 79 of file controller.h.
double BasicController::Ki_alt [private] |
Definition at line 70 of file controller.h.
double BasicController::Ki_plan [private] |
Definition at line 74 of file controller.h.
double BasicController::Ki_yaw [private] |
Definition at line 78 of file controller.h.
double BasicController::Kp_alt [private] |
Definition at line 69 of file controller.h.
double BasicController::Kp_plan [private] |
Definition at line 73 of file controller.h.
double BasicController::Kp_yaw [private] |
Definition at line 72 of file controller.h.
std::string BasicController::land_channel [private] |
Definition at line 56 of file controller.h.
ros::Publisher BasicController::land_pub [private] |
Definition at line 46 of file controller.h.
double BasicController::last_vel_x_command [private] |
Definition at line 101 of file controller.h.
double BasicController::last_vel_y_command [private] |
Definition at line 102 of file controller.h.
double BasicController::last_vel_yaw_command [private] |
Definition at line 100 of file controller.h.
double BasicController::last_vel_z_command [private] |
Definition at line 99 of file controller.h.
ucl_drone::Pose3D BasicController::lastPoseReceived [private] |
Measure.
Definition at line 106 of file controller.h.
ucl_drone::PoseRef BasicController::lastPoseRefReceived [private] |
Pose desired.
Definition at line 109 of file controller.h.
ros::NodeHandle BasicController::nh [private] |
Definition at line 42 of file controller.h.
double BasicController::old_delta_alt [private] |
Definition at line 90 of file controller.h.
double BasicController::old_delta_yaw [private] |
Definition at line 91 of file controller.h.
double BasicController::old_yaw_desired [private] |
Definition at line 103 of file controller.h.
double BasicController::p_term_f_old [private] |
Definition at line 93 of file controller.h.
double BasicController::p_term_l_old [private] |
Definition at line 94 of file controller.h.
std::string BasicController::pose_channel [private] |
Definition at line 52 of file controller.h.
ros::Subscriber BasicController::pose_sub [private] |
Definition at line 44 of file controller.h.
std::string BasicController::poseref_channel [private] |
Definition at line 53 of file controller.h.
ros::Subscriber BasicController::poseref_sub [private] |
Definition at line 45 of file controller.h.
double BasicController::regu_old_time_xy [private] |
Definition at line 89 of file controller.h.
double BasicController::regu_old_time_yaw [private] |
Definition at line 88 of file controller.h.
double BasicController::regu_old_time_z [private] |
Definition at line 87 of file controller.h.
std::string BasicController::reset_channel [private] |
Definition at line 58 of file controller.h.
ros::Publisher BasicController::reset_pub [private] |
Definition at line 50 of file controller.h.
Service to set a new Pose.
Service to takeoff and start regulation
Definition at line 115 of file controller.h.
Service to stop regulation and land.
Definition at line 118 of file controller.h.
std::string BasicController::takeoff_channel [private] |
Definition at line 55 of file controller.h.
ros::Publisher BasicController::takeoff_pub [private] |
Definition at line 47 of file controller.h.
std::string BasicController::toggleState_channel [private] |
Definition at line 57 of file controller.h.
Definition at line 49 of file controller.h.
ros::Publisher BasicController::vel_pub [private] |
Definition at line 48 of file controller.h.
double BasicController::x_desired_old [private] |
Definition at line 97 of file controller.h.
double BasicController::x_ref [private] |
Definition at line 65 of file controller.h.
double BasicController::y_desired_old [private] |
Definition at line 98 of file controller.h.
double BasicController::y_ref [private] |
Definition at line 66 of file controller.h.
double BasicController::yaw_desired_old [private] |
Definition at line 96 of file controller.h.
double BasicController::yaw_ref [private] |
Definition at line 67 of file controller.h.