-
-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slow speed when generating a URDF #292
Comments
Wow! What a huge shelf! Unfortunately, I have to blame python's For Python 3.x, the situation is slightly better. We typically generate our URDFs once when building. |
It's a shame they did not accept it. If I read correctly, for Python 2.7 the patch gain is Thank you for the detailed explanation and feel free to close this issue. |
Just for comparison without applying patches:
Note: The PCs are different between Melodic and Noetic so it may be hard to compare. |
Comparing timing on same machine (i7-2600) gives roughly the same table:
@rhaschke Trying to generate a urdf from xacro for Python 3.x (ROS Noetic) using the conveniance cmake functions. Do you have an exemple on how to do that ? Not sure if I have to uncomment parts of cmake... |
Sure:
See doc. |
Benchmarked my Pisa tower example using a loop and an unrolled loop on Noetic (see below). It seems that looping can be quite taxing. Maybe this can be improved with #291.
<!-- Unrolled loop x10 -->
<xacro:shelf name="bookshelf1"
frame_id="world"
xyz="0.8 0 0"
h_board_thickness="0.02"/>
<xacro:shelf name="bookshelf2"
frame_id="world"
xyz="0.8 0 1"
h_board_thickness="0.02"/>
...
<xacro:shelf name="bookshelf10"
frame_id="world"
xyz="0.8 0 9"
h_board_thickness="0.02"/> |
It takes 40 seconds for my pc (Intel i7-7700HQ 2.8GHz) to generate a URDF containing links and joints that represent a collection of collision objects (10 shelves on top of each other). Information such as subframes is also added. There is a lot of xacro loops used. The URDF generated has a size of 500kB.
Is it normal for this process to be slow ? My xacro skills may be to blame, could xacro
for loops
introduces some sort of slowdown that could be improved with #291 ?You can run the example (xacro_scene.zip)
rosrun xacro xacro scene.urdf.xacro > scene.urdf
The text was updated successfully, but these errors were encountered: