Converting SolidWorks stuff to URDF. STL and Meshlab problems
We have hard time converting our very cool robot SolidWorks files into URDF. They are way too complicated to make it somehow manually from scratch. As much I know there is no way to draw 3D model with some visual tools into URDF format. So we have options: SolidWorks converter on XML writing with vim.
To point. Simmechanics link creates XML file and lot of STL files. STL files are binary and ROS cannot open them. I compiled Meshlab and converted all STL files into non-binary ones. Content of files look OK to me. But ROS complains a lot about them:
[ERROR] [1303925218.756302760]: Could not load model '../../../../../../../../home/tonu/tyros/phippi/ros/phippi/xml/Media/models/Roboti_algus - roomuk-1 seib_4-3.STL' for link 'seib_4-31': OGRE EXCEPTION(2:InvalidParametersException): Header chunk didn't match either endian: Corrupted stream? in Serializer::determineEndianness at /home/tonu/ros/visualization_common/ogre/build/ogre_src_v1-7-1/OgreMain/src/OgreSerializer.cpp (line 89)
[ERROR] [1303925218.757941298]: Could not load model '../../../../../../../../home/tonu/tyros/phippi/ros/phippi/xml/Media/models/Roboti_algus - roomuk-1 seib_4-4.STL' for link 'seib_4-41': OGRE EXCEPTION(2:InvalidParametersException): Header chunk didn't match either endian: Corrupted stream? in Serializer::determineEndianness at /home/tonu/ros/visualization_common/ogre/build/ogre_src_v1-7-1/OgreMain/src/OgreSerializer.cpp (line 89)
[ERROR] [1303925218.758430673]: Could not load model '../../../../../../../../home/tonu/tyros/phippi/ros/phippi/xml/Media/models/Roboti_algus - roomuk-1 seib_4-4.STL' for link 'seib_4-41': OGRE EXCEPTION(2:InvalidParametersException): Header chunk didn't match either endian: Corrupted stream? in Serializer::determineEndianness at /home/tonu/ros/visualization_common/ogre/build/ogre_src_v1-7-1/OgreMain/src/OgreSerializer.cpp (line 89)
[ERROR] [1303925218.760367921]: Could not load model '../../../../../../../../home/tonu/tyros/phippi/ros/phippi/xml/Media/models/Roboti_algus - roomuk-1 seib_4-5.STL' for link 'seib_4-51': OGRE EXCEPTION(2:InvalidParametersException): Header chunk didn't match either endian: Corrupted stream? in Serializer::determineEndianness at /home/tonu/ros/visualization_common/ogre/build/ogre_src_v1-7-1/OgreMain/src/OgreSerializer.cpp (line 89)"
Example of STL file content:
tonu@hp:~/tyros/phippi/ros/phippi$ head "xml/Media/models/Roboti_algus - roomuk-1 seib_4-5.STL"
solid vcg
facet normal 0.000000e+00 7.133919e-02 -9.974521e-01
outer loop
vertex 0.000000e+00 -2.618593e-04 1.821271e-03
vertex -9.000000e-04 -4.506700e-19 1.840000e-03
vertex 0.000000e+00 -4.506700e-19 1.840000e-03
endloop
endfacet
facet normal -0.000000e+00 -7.133919e-02 -9.974521e-01
outer loop
tonu@hp:~/tyros/phippi/ros/phippi$
tonu@hp:~/tyros/phippi/ros/phippi$ tail "xml/Media/models/Roboti_algus - roomuk-1 seib_4-5.STL"
endloop
endfacet
facet normal -1.000000e+00 0.000000e+00 0.000000e+00
outer loop
vertex -9.000000e-04 1.390579e-03 -1.204944e-03
vertex -9.000000e-04 2.687582e-03 -2.242076e-03
vertex -9.000000e-04 2.442805e-03 -2.506533e-03
endloop
endfacet
endsolid vcg
tonu@hp:~/tyros/phippi/ros/phippi$
I am note sure what else should I show.
EDIT:
I followed first answer and tried to remove word "solid" from STL files:
for i in *.STL; do sed -ie 's/^solid/dilos/' "$i" ; done
I also verified that files are acutally and properly changed. Still errors. Meshlab opens those modified files nicely ...