[Rock-dev] changes for base::type::PointCloud
Jakob Schwendner
jakob.schwendner at dfki.de
Mon Oct 10 14:44:27 CEST 2011
Hi Alex,
On 10/10/2011 02:36 PM, Alexander Duda wrote:
> I looked into the base type point cloud and I missing the ability to
> save informations for each point. Because of that and a different naming
> conventions than we use, I would like to do the following changes:
>
> * rename pointcloud.h to point_cloud.h
> * rename base::samples::Pointcloud to base::samples::PointCloud
envire also uses Pointcloud instead of PointCloud. Should stay as it is
for consistency.
> * move base::Point to base::samples::point_cloud::Point
> (otherwise Point should go into its own header)
ok.
> * add a new vector field for channel informations
>
> OLD VERSION:
> namespace base {
> typedef base::Vector3d Point;
>
> namespace samples {
> struct Pointcloud
> {
> Time time;
>
> std::vector<base::Point> points;
> };
> }
> }
>
> NEW VERSION:
> namespace base{ namespace samples {
> namespace point_cloud {
> struct Channel
> {
> std::string name;
> std::vector<float> values;
> };
> typedef base::Vector3d Point;
> }
>
> struct PointCloud
> {
> base::Time time;
> std::vector<point_cloud::Point> points;
> std::vector<point_cloud::Channel> channels;
> };
> }}
>
> I talked to the guys which are using the type and it is fine for them
> therefore I am going to push the changes at the end of the day if no one
> is yelling ;-).
About the channel information, the problem is, that you most likely want
very different types (or at least this was the case in envire). One way
would be to use a uint8_t instead of the float and provide some
functions to convert the data to your type, like e.g. getChannel<Type>(
name ).
It's doubling the metadata mechanism in envire, but then I don't have a
good solution right now, to combine envire and orogen types better,
without rewriting a lot.
Jakob
More information about the Rock-dev
mailing list