Corentin Chauvin-Hameau – 2019-2020
Coverage Path Planning for an underwater robot surveying a marine farm
traj_publisher.hpp
Go to the documentation of this file.
1 /**
2  * @file
3  *
4  * \brief Declaration of a node to generate hard-coded trajectories
5  * \author Corentin Chauvin-Hameau
6  * \date 2020
7  */
8 
9 #ifndef TRAJ_PUBLISHER_HPP
10 #define TRAJ_PUBLISHER_HPP
11 
12 #include <nav_msgs/Path.h>
13 #include <geometry_msgs/Pose.h>
14 #include <ros/ros.h>
15 #include <fstream>
16 #include <string>
17 #include <vector>
18 
19 
20 namespace mfcpp {
21 
22 /**
23  * \brief Class to publish hard-coded trajectories
24  */
26  public:
29 
30  /**
31  * \brief Runs the node
32  */
33  void run_node();
34 
35  private:
36  // Private members
37  ros::NodeHandle nh_; ///< Node handler
38  ros::Publisher path_pub_; ///< Publisher for a path
39  nav_msgs::Path path_; ///< Path to publish
40  bool path_loaded_; ///< Whether the path was loaded with success
41 
42  /// \name ROS parameters
43  ///@{
44  float path_freq_; ///< Publishing frequency of the path
45  ///@}
46 
47 
48  /**
49  * \brief Initialises the node and its parameters
50  */
51  void init_node();
52 
53  /**
54  * \brief Loads a path from a text file
55  *
56  * The text file contains waypoints that are then interpolated by a spline.
57  *
58  * \param[in] file_name Relative path of the file containing the waypoints
59  * \param[in] resolution Spatial resolution of the path
60  * \param[out] path Loaded path
61  */
62  void load_path(std::string file_name, float resolution, nav_msgs::Path &path);
63 
64 };
65 
66 
67 } // namespace mfcpp
68 
69 #endif
Definition: common.hpp:23
ros::NodeHandle nh_
Node handler.
Class to publish hard-coded trajectories.
void load_path(std::string file_name, float resolution, nav_msgs::Path &path)
Loads a path from a text file.
void run_node()
Runs the node.
nav_msgs::Path path_
Path to publish.
void init_node()
Initialises the node and its parameters.
ros::Publisher path_pub_
Publisher for a path.
bool path_loaded_
Whether the path was loaded with success.