Skip to content

Commit

Permalink
Merge pull request #400 from iory/docs
Browse files Browse the repository at this point in the history
[docs] Add robot model tips for no-mesh-mode
  • Loading branch information
iory authored Oct 29, 2024
2 parents fce80a3 + e23319e commit 7052614
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/source/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ API Reference
sdfs
planner
viewers
robot_model_tips
30 changes: 30 additions & 0 deletions docs/source/reference/robot_model_tips.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Robot Model Tips
================

Loading the Robot Model Without Mesh Data
---------------------------------------

Sometimes, loading a robot model with full mesh data can be slow and resource-intensive. If mesh data is not necessary for your use case, you can improve the loading speed by disabling mesh data loading as shown below:

.. code-block:: python
from datetime import datetime
from skrobot.models import PR2
from skrobot.utils.urdf import no_mesh_load_mode
start = datetime.now()
robot_no_mesh = PR2()
end = datetime.now()
print(end - start)
# 0:00:00.269310
# Load the PR2 model without mesh data for faster initialization
start = datetime.now()
with no_mesh_load_mode():
robot_no_mesh = PR2()
end = datetime.now()
print(end - start)
# 0:00:00.083222
This approach is useful when you only need the basic structure of the robot without the visual details of the mesh, which can be beneficial in scenarios where performance is prioritized over graphical fidelity.

0 comments on commit 7052614

Please sign in to comment.