Where are useful message constructors, converters
I'm relatively new to coding in/for ROS, and I'm looking at both the Python and the C++ side, but let's focus on C++ here.
There are all those useful classes (which are mappings of the ROS message types), like Pose, Twist, etc. But where are the related utility functions?
I mean, by what I've found so far, if I want to construct a Pose object, I have to:
geometry_msgs::Pose p;
p.position.x = MYXVAL;
p.position.x = MYYVAL;
p.position.x = MYZVAL;
p.orientation.x = ORXVAL;
p.orientation.y = ORYVAL;
p.orientation.z = ORZVAL;
p.orientation.w = ORWVAL;
Why can't I just do:
geometry_msgs::Pose p(geometry_msgs::Point(MYXVAL, MYYVAL, MYZVAL), geometry_msgs::Quaternion(ORXVAL, ORYVAL, ORZVAL, ORWVAL));
(which would of course be even shorter with the proper include
s and using namespace
declaration).
And where are my usual utility functions, like Vector3
<->Quaternion
or maybe Twist
(Position+Facing)<->Pose
(Position+Orientation)?
I could write the convenience constructors (which one would expect to be provided) myself, of course, but that's not the point of using a library like ROS/roscpp.