ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

C++ constants ROS2 Style

asked 2021-11-09 14:22:34 -0500

griswaldbrooks gravatar image

The ROS2 C++ Style Guide seems to be less opinionated on things than ROS1, at least when it comes to constants. It seems the lack of guidance implies that the Google style of kConstantName is the style.

I don't seem to be the only one who interprets it that way https://github.com/ros-tooling/system...

Does anyone else have a comment on the issue?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-11-09 23:15:16 -0500

aprotyas gravatar image

I agree that the Google style is the way to go - given the lack of guidance. But, for what it's worth, check out this snippet with some constants defined in rclcpp.

static constexpr const char * get_parameters = "get_parameters";
static constexpr const char * get_parameter_types = "get_parameter_types";
static constexpr const char * set_parameters = "set_parameters";
static constexpr const char * set_parameters_atomically = "set_parameters_atomically";
static constexpr const char * describe_parameters = "describe_parameters";
static constexpr const char * list_parameters = "list_parameters";
edit flag offensive delete link more

Comments

I guess I mean to say that there isn't a strong preference - about this topic - in terms of style.

aprotyas gravatar image aprotyas  ( 2021-11-09 23:16:09 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2021-11-09 14:22:34 -0500

Seen: 84 times

Last updated: Nov 09 '21