ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Origin of the mesh resource.

asked 2017-08-15 06:55:55 -0600

janisa9 gravatar image

updated 2017-08-16 03:33:24 -0600

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. image description image description

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.

image description

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

edit retag flag offensive close merge delete

Comments

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.

gvdhoorn gravatar image gvdhoorn  ( 2017-08-15 08:42:42 -0600 )edit

Hi, how did you display the coordinate system on your stl?

saltedfish_mountain gravatar image saltedfish_mountain  ( 2019-05-19 02:50:10 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2017-08-15 09:00:24 -0600

Airuno2L gravatar image

The reference point Solidworks uses for exporting can be confusing sometimes. You can explicitly create a coordinate system as reference geometry and tell Solidworks to export the part with respect to that coordinate system to take out the guess work. There is an options button at the bottom of the Save As window which brings you to another window that lets you set the "Output Coordinate System". Pictures and more details can be found here.

edit flag offensive delete link more

Comments

Thats exactly what I did, even checked it twice if i saved it with coordinate system which I defined, but nothing, origin is still somewhere in object corner.

janisa9 gravatar image janisa9  ( 2017-08-16 01:52:01 -0600 )edit

I just tried it with Solidwork 2016 on three different parts and it worked on all of them perfectly. I'm not sure what's causing your problem.

Airuno2L gravatar image Airuno2L  ( 2017-08-16 07:00:36 -0600 )edit

Maybe post the part somewhere and let me try it?

Airuno2L gravatar image Airuno2L  ( 2017-08-16 07:02:07 -0600 )edit

Did you try this for STL file format?

janisa9 gravatar image janisa9  ( 2017-08-16 07:05:14 -0600 )edit

Download object here . Hope you can open it, format which I need is STL.

janisa9 gravatar image janisa9  ( 2017-08-16 07:09:17 -0600 )edit
1

answered 2017-08-16 02:42:02 -0600

AndyZe gravatar image

You can change the origin with Blender. See http://gazebosim.org/tutorials?tut=gu...

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2017-08-15 06:55:55 -0600

Seen: 2,131 times

Last updated: Aug 16 '17