0
$\begingroup$

Rosanswers logo

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 http://www.bildites.lv/images/kbz4grhd/76031/thumbnail image description http://www.bildites.lv/images/gs4m43e2/76031/thumbnail

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 http://www.bildites.lv/images/ewr2kzxn/76032/thumbnail

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


Originally posted by janisa9 on ROS Answers with karma: 11 on 2017-08-15

Post score: 0


Original comments

Comment by gvdhoorn on 2017-08-15:
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.

Comment by saltedfish_mountain on 2019-05-19:
Hi, how did you display the coordinate system on your stl?

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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.


Originally posted by Airuno2L with karma: 3460 on 2017-08-15

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by janisa9 on 2017-08-16:
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.

Comment by Airuno2L on 2017-08-16:
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.

Comment by Airuno2L on 2017-08-16:
Maybe post the part somewhere and let me try it?

Comment by janisa9 on 2017-08-16:
Did you try this for STL file format?

Comment by janisa9 on 2017-08-16:
Download object here . Hope you can open it, format which I need is STL.

$\endgroup$
0
$\begingroup$

Rosanswers logo

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


Originally posted by AndyZe with karma: 2331 on 2017-08-16

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.