Origin of the mesh resource.
So i have made my model in solidworks exported it as binary STL file with origin in center of the object. When I am trying to visualize in rviz the origin is somewhere in corner of my mesh file, not where i defined it in solidworks. When I create primitive shape, like BOX, everything is ok and the origin is in the center. My question is following -- Is there something wrong with my STL file, or what do I need to do, to define the origin for mesh file?
MARKER_MESSAGE.header.frame_id = TCP_LINK_NAME;
MARKER_MESSAGE.type = visualization_msgs::Marker::MESH_RESOURCE;
MARKER_MESSAGE.mesh_resource = "file:///path/can_stl_last_bin.STL";
MARKER_MESSAGE.pose = TCP_TO_BOX_POSE;
MARKER_MESSAGE.id = 0;
MARKER_MESSAGE.color.r = 0;
MARKER_MESSAGE.color.g = 0;
MARKER_MESSAGE.color.b = 1;
MARKER_MESSAGE.color.a = 0.5f;
MARKER_MESSAGE.lifetime = ros::Duration(100); // persists forever
MARKER_MESSAGE.frame_locked = true;
MARKER_MESSAGE.scale.x = 1;
MARKER_MESSAGE.scale.y = 1;
MARKER_MESSAGE.scale.z = 1;
UPDATE!!
I can see my coordinate system in Blender, but is is not origin.
So in Blender as AndyZe said, I changed the origin to my object coordinate system and everything works for now, and i can visualize object in rviz with origin in center of object.
But anyway my initial question remains unclear because I didn't work it out how to export from solidworks my coordinate system as origin, even using this tutorial here
This is most of the time a problem with SolidWorks. I've experienced similar difficulty getting it to correctly export an STL with the origin somewhere other than the "corner of the mesh".
Try opening your STL in something like Blender or another tool that loads STLs and verify the origin there.
Hi, how did you display the coordinate system on your stl?