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

Based on @kartikmohta's answer, an example of initializing a constant std_msgs::String is as follows

const std_msgs::String MY_STRING = []{
    std_msgs::String ret;
    ret.data = "hello"; 
    return ret;}();