Corentin Chauvin-Hameau – 2019-2020
Coverage Path Planning for an underwater robot surveying a marine farm
clock_publisher.hpp
Go to the documentation of this file.
1 /**
2  * @file
3  *
4  * \brief To publish on the /clock topic at some frequency
5  * \author Corentin Chauvin-Hameau
6  * \date 2020
7  */
8 
9 #ifndef CLOCK_PUBLISHER_HPP
10 #define CLOCK_PUBLISHER_HPP
11 
12 #include <ros/ros.h>
13 
14 
15 
16 namespace mfcpp {
17 
18 /**
19  * \brief Class to publish on the /clock topic
20  *
21  * Publishes simulation time at some user specified rate. Won't publish if
22  * /use_sim_time ROS parameter is not set to true.
23  */
25  public:
28 
29  /**
30  * \brief Runs the node
31  */
32  void run_node();
33 
34  private:
35  // Private members
36  ros::NodeHandle nh_; ///< Node handler
37  ros::Publisher clock_pub_; ///< Clock publisher
38 
39  /// \name ROS parameters
40  ///@{
41  bool use_sim_time_; ///< Whether to publish something in the /clock topic
42  float publish_rate_; ///< Frequency (Hz) of publish on the /clock topic (ROS frequency)
43  float time_factor_; ///< Time factor of the simulation (1.0 for same as wall time)
44  ///@}
45 
46 
47  /**
48  * \brief Initialises the node and its parameters
49  */
50  void init_node();
51 };
52 
53 
54 } // namespace mfcpp
55 
56 #endif
float publish_rate_
Frequency (Hz) of publish on the /clock topic (ROS frequency)
Definition: common.hpp:23
ros::NodeHandle nh_
Node handler.
void run_node()
Runs the node.
bool use_sim_time_
Whether to publish something in the /clock topic.
ros::Publisher clock_pub_
Clock publisher.
Class to publish on the /clock topic.
void init_node()
Initialises the node and its parameters.