ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
A solution using existing things could be to read the .ply into a pcl::PolygonMesh
(see this or this) and then convert it like it's done here.
Another solution, since the message already exists, would be to copy the triangles into the shape_msgs::Mesh
. Iirc a better idea, which I've used before, is assimp, not sure if it can load .ply meshes, but if it can, the package geometric_shapes comes to the rescue with its geometric_shapes::createMeshFromResource
.
2 | No.2 Revision |
A solution using existing things could be to read the .ply into a pcl::PolygonMesh
(see this or this) and then convert it like it's done here.
Another solution, since the message already exists, would be to copy the triangles into the shape_msgs::Mesh
. Iirc a better idea, which I've used before, is assimp, not sure if it can load .ply meshes, but if it can, the package geometric_shapes comes to the rescue with its geometric_shapes::createMeshFromResource
.
Edit: ply seems supported as per this, it might be worth a try.
3 | No.3 Revision |
A solution using existing things could be to read the .ply into a pcl::PolygonMesh
(see this or this) and then convert it like it's done here.
Another solution, since the message already exists, would be to copy the triangles into the shape_msgs::Mesh
. Iirc a better idea, which I've used before, is assimp, not sure if it can load .ply meshes, but if it can, the package geometric_shapes comes to the rescue with its geometric_shapes::createMeshFromResource
. Edit2: I was missing a piece in the explanation: shapes::constructMsgFromShape converts the Mesh* to a variant of shape_msgs::Mesh. The code would be almost the same as in q245995.
Edit: Edit1: ply seems supported as per this, it might be worth a try.
4 | No.4 Revision |
A solution using existing things could be to read the .ply into a pcl::PolygonMesh
(see this or this) and then convert it like it's done here.
Another solution, since the message already exists, would be to copy the triangles into the shape_msgs::Mesh
. Iirc a better idea, which I've used before, is assimp, not sure if it can load .ply meshes, but if it can, the package geometric_shapes comes to the rescue with its geometric_shapes::createMeshFromResource
. Edit2: I was missing a piece in the explanation: shapes::constructMsgFromShape converts the Mesh* to a variant of shape_msgs::Mesh. shape_msgs::Mesh
. The code would be almost the same as in q245995.
Edit1: ply seems supported as per this, it might be worth a try.
5 | No.5 Revision |
A solution using existing things could be to read the .ply into a pcl::PolygonMesh
(see this or this) and then convert it like it's done here.
Another solution, since the message already exists, would be to copy the triangles into the shape_msgs::Mesh
. Iirc a better idea, which I've used before, is assimp, not sure if it can load .ply meshes, but if it can, the package geometric_shapes comes to the rescue with its geometric_shapes::createMeshFromResource
. Edit2: I was missing a piece in the explanation: shapes::constructMsgFromShape shapes::constructMsgFromShape
converts the Mesh* Mesh*
to a variant of shape_msgs::Mesh
. The code would be almost the same as in q245995.
Edit1: ply seems supported as per this, it might be worth a try.