Skip to content

Commit dba4daa

Browse files
authored
Additional fixes for documentation in demos. (#538)
* Additional fixes for documentation in demos. With these fixes, I think we should get a green Rdoc build. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
1 parent 0cfdbe9 commit dba4daa

File tree

9 files changed

+111
-26
lines changed

9 files changed

+111
-26
lines changed

composition/Doxyfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# All settings not listed here will use the Doxygen default values.
2+
3+
PROJECT_NAME = "composition"
4+
PROJECT_NUMBER = master
5+
PROJECT_BRIEF = "Examples for composing multiple nodes in a single process."
6+
7+
INPUT = ./include
8+
RECURSIVE = YES
9+
OUTPUT_DIRECTORY = docs_output
10+
11+
EXTRACT_ALL = YES
12+
SORT_MEMBER_DOCS = NO
13+
14+
GENERATE_LATEX = NO
15+
GENERATE_XML = YES
16+
EXCLUDE_SYMBOLS = detail details
17+
18+
ENABLE_PREPROCESSING = YES
19+
MACRO_EXPANSION = YES
20+
EXPAND_ONLY_PREDEF = YES
21+
PREDEFINED += COMPOSITION_PUBLIC

image_tools/Doxyfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# All settings not listed here will use the Doxygen default values.
2+
3+
PROJECT_NAME = "image_tools"
4+
PROJECT_NUMBER = master
5+
PROJECT_BRIEF = "Tools to capture and play back images to and from DDS subscriptions and publications."
6+
7+
INPUT = ./include
8+
RECURSIVE = YES
9+
OUTPUT_DIRECTORY = docs_output
10+
11+
EXTRACT_ALL = YES
12+
SORT_MEMBER_DOCS = NO
13+
14+
GENERATE_LATEX = NO
15+
GENERATE_XML = YES
16+
EXCLUDE_SYMBOLS = detail details
17+
18+
ENABLE_PREPROCESSING = YES
19+
MACRO_EXPANSION = YES
20+
EXPAND_ONLY_PREDEF = YES
21+
PREDEFINED += IMAGE_TOOLS_PUBLIC

intra_process_demo/include/image_pipeline/camera_node.hpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,19 @@
2727

2828
#include "common.hpp"
2929

30-
// Node which captures images from a camera using OpenCV and publishes them.
31-
// Images are annotated with this process's id as well as the message's ptr.
32-
class CameraNode : public rclcpp::Node
30+
/// Node which captures images from a camera using OpenCV and publishes them.
31+
/// Images are annotated with this process's id as well as the message's ptr.
32+
class CameraNode final : public rclcpp::Node
3333
{
3434
public:
35-
CameraNode(
35+
/// \brief Construct a new CameraNode object for capturing video
36+
/// \param output The output topic name to use
37+
/// \param node_name The node name to use
38+
/// \param watermark Whether to add a watermark to the image before publishing
39+
/// \param device Which camera device to use
40+
/// \param width What video width to capture at
41+
/// \param height What video height to capture at
42+
explicit CameraNode(
3643
const std::string & output, const std::string & node_name = "camera_node",
3744
bool watermark = true, int device = 0, int width = 320, int height = 240)
3845
: Node(node_name, rclcpp::NodeOptions().use_intra_process_comms(true)),
@@ -57,7 +64,7 @@ class CameraNode : public rclcpp::Node
5764
thread_ = std::thread(std::bind(&CameraNode::loop, this));
5865
}
5966

60-
virtual ~CameraNode()
67+
~CameraNode()
6168
{
6269
// Make sure to join the thread on shutdown.
6370
canceled_.store(true);
@@ -66,6 +73,7 @@ class CameraNode : public rclcpp::Node
6673
}
6774
}
6875

76+
/// \brief Capture and publish data until the program is closed
6977
void loop()
7078
{
7179
// While running...

intra_process_demo/include/image_pipeline/image_view_node.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,14 @@
2424

2525
#include "common.hpp"
2626

27-
// Node which receives sensor_msgs/Image messages and renders them using OpenCV.
28-
class ImageViewNode : public rclcpp::Node
27+
/// Node which receives sensor_msgs/Image messages and renders them using OpenCV.
28+
class ImageViewNode final : public rclcpp::Node
2929
{
3030
public:
31+
/// \brief Construct a new ImageViewNode for visualizing image data
32+
/// \param input The topic name to subscribe to
33+
/// \param node_name The node name to use
34+
/// \param watermark Whether to add a watermark to the image before displaying
3135
explicit ImageViewNode(
3236
const std::string & input, const std::string & node_name = "image_view_node",
3337
bool watermark = true)

intra_process_demo/include/image_pipeline/watermark_node.hpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,16 @@
2626

2727
#include "common.hpp"
2828

29-
// Node that receives an image, adds some text as a watermark, and publishes it again.
30-
class WatermarkNode : public rclcpp::Node
29+
/// Node that receives an image, adds some text as a watermark, and publishes it again.
30+
class WatermarkNode final : public rclcpp::Node
3131
{
3232
public:
33-
WatermarkNode(
33+
/// \brief Construct a WatermarkNode that accepts an image, adds a watermark, and republishes it
34+
/// \param input The name of the topic to subscribe to
35+
/// \param output The topic to publish watermarked images to
36+
/// \param text The text to add to the image
37+
/// \param node_name The node name to use
38+
explicit WatermarkNode(
3439
const std::string & input, const std::string & output, const std::string & text,
3540
const std::string & node_name = "watermark_node")
3641
: Node(node_name, rclcpp::NodeOptions().use_intra_process_comms(true))

logging_demo/Doxyfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# All settings not listed here will use the Doxygen default values.
2+
3+
PROJECT_NAME = "logging_demo"
4+
PROJECT_NUMBER = master
5+
PROJECT_BRIEF = "Examples for using and configuring loggers."
6+
7+
INPUT = ./include
8+
RECURSIVE = YES
9+
OUTPUT_DIRECTORY = docs_output
10+
11+
EXTRACT_ALL = YES
12+
SORT_MEMBER_DOCS = NO
13+
14+
GENERATE_LATEX = NO
15+
GENERATE_XML = YES
16+
EXCLUDE_SYMBOLS = detail details
17+
18+
ENABLE_PREPROCESSING = YES
19+
MACRO_EXPANSION = YES
20+
EXPAND_ONLY_PREDEF = YES
21+
PREDEFINED += LOGGING_DEMO_PUBLIC

pendulum_control/include/pendulum_control/pendulum_controller.hpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,20 @@
1515
#ifndef PENDULUM_CONTROL__PENDULUM_CONTROLLER_HPP_
1616
#define PENDULUM_CONTROL__PENDULUM_CONTROLLER_HPP_
1717

18+
// Needed for M_PI on Windows
19+
#ifdef _MSC_VER
20+
#ifndef _USE_MATH_DEFINES
21+
#define _USE_MATH_DEFINES
22+
#endif
23+
#endif
24+
1825
#include <chrono>
1926
#include <cmath>
2027
#include <memory>
2128

2229
#include "pendulum_msgs/msg/joint_command.hpp"
2330
#include "pendulum_msgs/msg/joint_state.hpp"
2431

25-
#ifndef PI
26-
#define PI 3.14159265359
27-
#endif
28-
2932
namespace pendulum_control
3033
{
3134

@@ -39,7 +42,7 @@ struct PIDProperties
3942
/// Derivative constant.
4043
double d = 0;
4144
/// Desired state of the plant.
42-
double command = PI / 2;
45+
double command = M_PI / 2;
4346
};
4447

4548
/// Provides a simple PID controller for the inverted pendulum.
@@ -85,8 +88,8 @@ class PendulumController
8588
// Calculate the message based on PID gains
8689
command_message_.position = msg->position + p_gain + i_gain_ + d_gain;
8790
// Enforce positional limits
88-
if (command_message_.position > PI) {
89-
command_message_.position = PI;
91+
if (command_message_.position > M_PI) {
92+
command_message_.position = M_PI;
9093
} else if (command_message_.position < 0) {
9194
command_message_.position = 0;
9295
}

quality_of_service_demo/rclcpp/include/quality_of_service_demo/common_nodes.hpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,21 @@
2424

2525
constexpr char DEFAULT_TOPIC_NAME[] = "qos_chatter";
2626

27-
class Talker : public rclcpp::Node
27+
/// Node class to publish data at a specified rate, optionally pausing to test liveliness
28+
class Talker final : public rclcpp::Node
2829
{
2930
public:
31+
/// Standard Constructor
3032
/**
31-
* \param[in] topic_name Topic to publish to.
3233
* \param[in] qos_profile QoS profile for Publisher.
33-
* \param[in] publisher_options Additional options for Publisher.
34+
* \param[in] topic_name Topic to publish to.
3435
* \param[in] publish_count (Optional) Number of messages to publish before stopping.
3536
* 0 (default) means publish forever.
37+
* \param[in] publish_period (Optional) How often to publish
3638
* \param[in] assert_topic_period (Optional) How often to manually assert Publisher liveliness.
3739
* 0 (default) means never.
3840
**/
39-
Talker(
41+
explicit Talker(
4042
const rclcpp::QoS & qos_profile,
4143
const std::string & topic_name = DEFAULT_TOPIC_NAME,
4244
size_t publish_count = 0,
@@ -97,18 +99,18 @@ class Talker : public rclcpp::Node
9799
rclcpp::TimerBase::SharedPtr assert_topic_timer_ = nullptr;
98100
};
99101

100-
class Listener : public rclcpp::Node
102+
/// Node class to listen to listen to incoming data from the Talker
103+
class Listener final : public rclcpp::Node
101104
{
102105
public:
103106
/// Standard Constructor.
104107
/**
105-
* \param[in] topic_name Topic to subscribe to.
106108
* \param[in] qos_profile QoS profile for Subscription.
107-
* \param[in] sub_options Additional options for Subscription.
109+
* \param[in] topic_name Topic to subscribe to.
108110
* \param[in] defer_subscribe (Optional) don't create Subscription until user calls
109111
* start_listening().
110112
*/
111-
Listener(
113+
explicit Listener(
112114
const rclcpp::QoS & qos_profile,
113115
const std::string & topic_name = DEFAULT_TOPIC_NAME,
114116
bool defer_subscribe = false);

topic_statistics_demo/include/topic_statistics_demo/topic_statistics_listener.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class TopicStatisticsListener : public rclcpp::Node
4141
/// Return string representation of a MetricsMessage.
4242
/**
4343
* \param[in] results Statistics heard form the subscribed topic.
44-
* \param[out] String representation of the input statistics.
44+
* \return String representation of the input statistics.
4545
*/
4646
std::string MetricsMessageToString(const statistics_msgs::msg::MetricsMessage & results);
4747

0 commit comments

Comments
 (0)