Corentin Chauvin-Hameau – 2019-2020
Coverage Path Planning for an underwater robot surveying a marine farm
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
mfcpp::CartControlNodelet Class Reference

Nodelet for cheated cartesian control of a robot. More...

#include <cart_control_nodelet.hpp>

Inheritance diagram for mfcpp::CartControlNodelet:
Inheritance graph
[legend]
Collaboration diagram for mfcpp::CartControlNodelet:
Collaboration graph
[legend]

Public Member Functions

 CartControlNodelet ()
 
 ~CartControlNodelet ()
 
virtual void onInit ()
 Function called at beginning of nodelet execution. More...
 

Private Member Functions

void main_cb (const ros::TimerEvent &timer_event)
 Main callback which is called by a timer. More...
 
void path_cb (const nav_msgs::PathConstPtr msg)
 Callback for the desired path. More...
 
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. More...
 

Static Private Member Functions

static void sigint_handler (int s)
 SINGINT (Ctrl+C) callback to stop the nodelet properly. More...
 

Private Attributes

ros::NodeHandle nh_
 Node handler (for topics and services) More...
 
ros::NodeHandle private_nh_
 Private node handler (for parameters) More...
 
ros::Subscriber path_sub_
 Subscriber for the desired path. More...
 
ros::Publisher pose_pub_
 Publisher for the output pose. More...
 
nav_msgs::Path path_
 Desired path. More...
 
bool path_received_
 Whether a new path has been received. More...
 
bool path_processed_
 Whether the path has been processed. More...
 
bool path_executed_
 Whether the previous path has been executed. More...
 
std::vector< geometry_msgs::Pose > waypoints_
 Consecutive poses that the robot will be assigned to. More...
 
int idx_waypoints_
 Current position in the waypoints list. More...
 
ROS parameters
float main_freq_
 Frequency of the main loop. More...
 
float robot_speed_
 

Static Private Attributes

static sig_atomic_t volatile b_sigint_ = 0
 Whether SIGINT signal has been received. More...
 
static ros::Timer main_timer_ = ros::Timer()
 Timer callback for the main function. More...
 

Detailed Description

Nodelet for cheated cartesian control of a robot.

The nodelet just teleports the robot along a given path, not taking into account any physical constraint.

Definition at line 28 of file cart_control_nodelet.hpp.

Constructor & Destructor Documentation

mfcpp::CartControlNodelet::CartControlNodelet ( )

Definition at line 33 of file cart_control_nodelet.cpp.

mfcpp::CartControlNodelet::~CartControlNodelet ( )

Definition at line 34 of file cart_control_nodelet.cpp.

Member Function Documentation

void mfcpp::CartControlNodelet::compute_waypoints ( const nav_msgs::Path &  path,
float  speed,
float  dt,
std::vector< geometry_msgs::Pose > &  waypoints 
) const
private

Computes the poses that the controller will assign to the robot.

Parameters
[in]pathPath to follow
[in]speedDesired speed of the robot
[in]dtTime interval between two poses
[out]waypointsList of computed waypoints

Definition at line 105 of file cart_control_nodelet.cpp.

void mfcpp::CartControlNodelet::main_cb ( const ros::TimerEvent &  timer_event)
private

Main callback which is called by a timer.

Parameters
timer_eventTimer event information

Definition at line 72 of file cart_control_nodelet.cpp.

void mfcpp::CartControlNodelet::onInit ( )
virtual

Function called at beginning of nodelet execution.

Definition at line 37 of file cart_control_nodelet.cpp.

void mfcpp::CartControlNodelet::path_cb ( const nav_msgs::PathConstPtr  msg)
private

Callback for the desired path.

Note
The frame in which the path is expressed should match with the fixed frame of the robot simulator.

Definition at line 98 of file cart_control_nodelet.cpp.

void mfcpp::CartControlNodelet::sigint_handler ( int  s)
staticprivate

SINGINT (Ctrl+C) callback to stop the nodelet properly.

Definition at line 90 of file cart_control_nodelet.cpp.

Member Data Documentation

sig_atomic_t volatile mfcpp::CartControlNodelet::b_sigint_ = 0
staticprivate

Whether SIGINT signal has been received.

Definition at line 41 of file cart_control_nodelet.hpp.

int mfcpp::CartControlNodelet::idx_waypoints_
private

Current position in the waypoints list.

Definition at line 54 of file cart_control_nodelet.hpp.

float mfcpp::CartControlNodelet::main_freq_
private

Frequency of the main loop.

Definition at line 58 of file cart_control_nodelet.hpp.

ros::Timer mfcpp::CartControlNodelet::main_timer_ = ros::Timer()
staticprivate

Timer callback for the main function.

Definition at line 42 of file cart_control_nodelet.hpp.

ros::NodeHandle mfcpp::CartControlNodelet::nh_
private

Node handler (for topics and services)

Definition at line 45 of file cart_control_nodelet.hpp.

nav_msgs::Path mfcpp::CartControlNodelet::path_
private

Desired path.

Definition at line 49 of file cart_control_nodelet.hpp.

bool mfcpp::CartControlNodelet::path_executed_
private

Whether the previous path has been executed.

Definition at line 52 of file cart_control_nodelet.hpp.

bool mfcpp::CartControlNodelet::path_processed_
private

Whether the path has been processed.

Definition at line 51 of file cart_control_nodelet.hpp.

bool mfcpp::CartControlNodelet::path_received_
private

Whether a new path has been received.

Definition at line 50 of file cart_control_nodelet.hpp.

ros::Subscriber mfcpp::CartControlNodelet::path_sub_
private

Subscriber for the desired path.

Definition at line 47 of file cart_control_nodelet.hpp.

ros::Publisher mfcpp::CartControlNodelet::pose_pub_
private

Publisher for the output pose.

Definition at line 48 of file cart_control_nodelet.hpp.

ros::NodeHandle mfcpp::CartControlNodelet::private_nh_
private

Private node handler (for parameters)

Definition at line 46 of file cart_control_nodelet.hpp.

float mfcpp::CartControlNodelet::robot_speed_
private

Desired robot speed

Definition at line 59 of file cart_control_nodelet.hpp.

std::vector<geometry_msgs::Pose> mfcpp::CartControlNodelet::waypoints_
private

Consecutive poses that the robot will be assigned to.

Definition at line 53 of file cart_control_nodelet.hpp.


The documentation for this class was generated from the following files: