9 #ifndef CART_CONTROL_NODELET_HPP 10 #define CART_CONTROL_NODELET_HPP 12 #include <nav_msgs/Path.h> 13 #include <geometry_msgs/Pose.h> 14 #include <nodelet/nodelet.h> 67 void main_cb(
const ros::TimerEvent &timer_event);
80 void path_cb(
const nav_msgs::PathConstPtr
msg);
91 std::vector<geometry_msgs::Pose> &waypoints)
const;
float main_freq_
Frequency of the main loop.
void compute_waypoints(const nav_msgs::Path &path, float speed, float dt, std::vector< geometry_msgs::Pose > &waypoints) const
Computes the poses that the controller will assign to the robot.
static sig_atomic_t volatile b_sigint_
Whether SIGINT signal has been received.
std::vector< geometry_msgs::Pose > waypoints_
Consecutive poses that the robot will be assigned to.
nav_msgs::Path path_
Desired path.
bool path_received_
Whether a new path has been received.
ros::Publisher pose_pub_
Publisher for the output pose.
virtual void onInit()
Function called at beginning of nodelet execution.
static ros::Timer main_timer_
Timer callback for the main function.
void main_cb(const ros::TimerEvent &timer_event)
Main callback which is called by a timer.
int idx_waypoints_
Current position in the waypoints list.
void path_cb(const nav_msgs::PathConstPtr msg)
Callback for the desired path.
static void sigint_handler(int s)
SINGINT (Ctrl+C) callback to stop the nodelet properly.
ros::Subscriber path_sub_
Subscriber for the desired path.
ros::NodeHandle private_nh_
Private node handler (for parameters)
bool path_processed_
Whether the path has been processed.
Nodelet for cheated cartesian control of a robot.
ros::NodeHandle nh_
Node handler (for topics and services)
bool path_executed_
Whether the previous path has been executed.