92 ROS_DEBUG(
"Fwd Vel Params (F,P,I,D,iMax,iMin):%f,%f,%f,%f,%f,%f",fvel_kf_,fvel_kp_, fvel_ki_,fvel_kd_,fvel_imax_,fvel_imin_);
93 ROS_DEBUG(
"Yaw Rate Params (F,P,I,D,iMax,iMin):%f,%f,%f,%f,%f,%f",yr_kf_,yr_kp_, yr_ki_,yr_kd_,yr_imax_,yr_imin_);
94 ROS_DEBUG(
"Yaw Params (F,P,I,D,iMax,iMin):%f,%f,%f,%f,%f,%f",y_kf_,y_kp_, y_ki_,y_kd_,y_imax_,y_imin_);
134 geometry_msgs::Vector3 dbg_info;
137 dbg_info.z = fvel_comp_output;
140 return fvel_comp_output;
149 geometry_msgs::Vector3 dbg_info;
152 dbg_info.z = yr_comp_output;
155 return yr_comp_output;
166 if (fabs(y_error) > PI){
168 y_error =-( y_meas_ + (2*PI -
y_cmd_));
175 geometry_msgs::Vector3 dbg_info;
178 dbg_info.z = y_comp_output;
181 return y_comp_output;
186 if (force < pos_limit) {
190 if (force > -neg_limit) {
261 double thrust = msg.thrust;
288 yr_meas_ = msg.twist.twist.angular.z;
316 std::string output=
"";
320 output =
"Boat controlling yaw position";
323 output =
"Boat Controlling yaw rate";
326 output =
"Boat in raw wrench/RC control";
329 output =
"Boat controlling forward and yaw velocity";
332 output =
"Boat controlling yaw velocity and mapping velocity linearly";
335 output =
"No commands being processed";
342 output+=
": IMU data not received or being received too slowly";
345 output+=
": GPS Velocity data not received or being received too slowly";
365 std::vector<double> find_latest;
377 double max = *std::max_element(find_latest.begin(), find_latest.end());
418 std_srvs::SetBool::Response& resp) {
421 resp.message =
"Activated Control.";
425 int main(
int argc,
char **argv)
#define TWIST_LIN_CONTROL
void pub_thrust_cmd(geometry_msgs::Wrench output)
void twist_callback(const geometry_msgs::Twist msg)
ForceCompensator * force_compensator_
void publish(const boost::shared_ptr< M > &message) const
void console_update(const ros::TimerEvent &event)
control_toolbox::Pid fvel_pid_
ros::Publisher yr_dbg_pub_
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
void wrench_callback(const geometry_msgs::Wrench msg)
static double getYaw(const Quaternion &bt_q)
void update_fwd_vel_control()
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
Controller(ros::NodeHandle &n)
void update_yaw_control()
ServiceServer advertiseService(const std::string &service, bool(T::*srv_func)(MReq &, MRes &), T *obj)
bool activate_control_service(std_srvs::SetBool::Request &req, std_srvs::SetBool::Response &resp)
ROSCPP_DECL void spin(Spinner &spinner)
geometry_msgs::Wrench force_output_
control_toolbox::Pid y_pid_
ros::Publisher y_dbg_pub_
ros::Publisher fvel_dbg_pub_
void course_callback(const heron_msgs::Course msg)
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
double wrench_cmd_timeout_
double fvel_compensator()
Timer createTimer(Rate r, Handler h, Obj o, bool oneshot=false, bool autostart=true) const
double twist_cmd_timeout_
double deadzone_force(double force, double pos_limit, double neg_limit)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
void odom_callback(const nav_msgs::Odometry msg)
control_toolbox::Pid yr_pid_
void update_yaw_rate_control()
int main(int argc, char **argv)
ros::ServiceServer active_control_srv
double course_cmd_timeout_
void helm_callback(const heron_msgs::Helm msg)
void control_update(const ros::TimerEvent &event)