You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 3, 2020. It is now read-only.
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted (core dumped)
It's possible that negative lengths are not valid URDF, but it is not specified in the URDF documentation and the other systems that use URDF happily interpret the length as starting from the origin and going in the negative direction.
The text was updated successfully, but these errors were encountered:
I took a quick look at this. It turns out that the problem is down in geometric_shapes, where we have this code:
double h = cylinder.length;
...
unsigned int h_num = ceil(h / circle_edge);
...
for (unsigned int i = 0; i < h_num - 1 ; ++i)
for(unsigned int j = 0; j < tot; ++j)
vertices.push_back(Eigen::Vector3d(r * cos(phi + phid * j), r * sin(phi + phid * j), h / 2 - (i + 1) * hd));
So we are taking a negative double, dividing it by some (positive) amount, and then assigning the result to an unsigned. This turns out to be a huge number (instead of the small negative number), which we then end up iterating over and doing a vector push_back, using up a crazy amount of memory. A simple fix here is call fabs() on h before calculating h_num, which will avoid this particular problem, but may or may not actually "work". I'll get in touch with the geometric_shapes maintainers and see if they have any advice.
When urdf_to_collada is run with the following link, it crashes because of the negative length:
The error message is
It's possible that negative lengths are not valid URDF, but it is not specified in the URDF documentation and the other systems that use URDF happily interpret the length as starting from the origin and going in the negative direction.
The text was updated successfully, but these errors were encountered: