ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
A Point and a Range message are not isomorphic. This is why they are in different messages. Your converters lose a lot of information going from the Range to a Point. Thus it's not a conversion but a projection. You should not create conversion methods like this that are not isomorphic. If there are two of these defined it's possible for the template logic to traverse through a pair of these and return completely invalid data.
I'd recommend that you write your function as projectRangeToPoint
as you're dropping information and casting it down to just a point in 3D. If you were to write the inverse function you would need to add arguments to fill in the rest of the Range
fields.