Problem loading Mesh with createMeshFromResource
Hi everyone,
I get the warning "Mesh definition is empty" when I run this code, Is there any problem? I have tried with a lot of .dae and .stl files, but the result is the same.
moveit_msgs::CollisionObject co;
shapes::Mesh* m = shapes::createMeshFromResource("file://...");
shape_msgs::Mesh co_mesh;
shapes::ShapeMsg co_mesh_msg = co_mesh;
shapes::constructMsgFromShape(m,co_mesh_msg);
co.meshes.resize(1);
co.meshes[0] = co_mesh;
co.mesh_poses.resize(1);
co.mesh_poses[0].position.x = 1.0;
co.mesh_poses[0].position.y = 1.0;
co.mesh_poses[0].position.z = 0.0;
co.mesh_poses[0].orientation.w= 1.0;
co.mesh_poses[0].orientation.x= 0.0;
co.mesh_poses[0].orientation.y= 0.0;
co.mesh_poses[0].orientation.z= 0.0;
pub_co.publish(co);
Thanks for your help
Best
Hi! I tried to compile your code. But I get the error:
error: ‘pub_co’ was not declared in this scope pub_co.publish(co);
Could you help me out here? Do I need to implement a some header I forgot? Thanks