Hi Steven-
I don't think there is. I wrote myself a helper file with a bunch of functions to populate and return a variety of message objects like that so I could do it in my main code in a single line.
e.g.
std_msgs::ColorRGBA createColorMsg(double red, double blue, double green, double alpha)
{
std_msgs::ColorRGBA color;
color.r = red;
color.g = green;
color.b = blue;
color.a = alpha;
return color;
}
Hi,
is there a way to declare a ROS msg in C++ and filling in all message
fields at once?
E.g. I want a message geometry_msgs/Pose:
const geometry_msgs::Pose world = {position.x = , ... } ?
regards,
Steven
_______________________________________________
ros-users mailing list
ros-users@code.ros.org
https://code.ros.org/mailman/listinfo/ros-users