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

Revision history [back]

click to hide/show revision 1
initial version

Though it may not be the "cleanest" solution, you can initialize the const message in the initialization list of the class using the lambda initialization trick (See https://stackoverflow.com/q/11037650 and https://herbsutter.com/2013/04/05/complex-initialization-for-a-const-variable/). This trick seems to be underutilized in the C++ community even though it's been available since C++11.