-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add utility module for ur10 and update differential_ik_whole_body to …
…use ur10
- Loading branch information
1 parent
0721205
commit 188b3dc
Showing
2 changed files
with
53 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
""" Utilities to load example Universal Robots UR10 robot models. """ | ||
|
||
import os | ||
import pinocchio | ||
|
||
from .utils import get_example_models_folder | ||
|
||
|
||
def load_ur10_on_base_models(): | ||
""" | ||
Gets the example UR10 on base models. | ||
Returns | ||
------- | ||
tuple[`pinocchio.Model`] | ||
A 3-tuple containing the model, collision geometry model, and visual geometry model. | ||
""" | ||
models_folder = get_example_models_folder() | ||
package_dir = os.path.join(models_folder, "ur_description") | ||
urdf_filename = os.path.join(package_dir, "urdf", "ur10_on_base.urdf") | ||
|
||
return pinocchio.buildModelsFromUrdf(urdf_filename, package_dirs=models_folder) | ||
|
||
|
||
def add_ur10_on_base_self_collisions(model, collision_model, srdf_filename=None): | ||
""" | ||
Adds link self-collisions to the UR10 collision model. | ||
This uses an SRDF file to remove any excluded collision pairs. | ||
Parameters | ||
---------- | ||
model : `pinocchio.Model` | ||
The Panda model. | ||
collision_model : `pinocchio.Model` | ||
The Panda collision geometry model. | ||
srdf_filename : str, optional | ||
Path to the SRDF file describing the excluded collision pairs. | ||
If not specified, uses a default file included with the Panda model. | ||
""" | ||
if srdf_filename is None: | ||
models_folder = get_example_models_folder() | ||
package_dir = os.path.join(models_folder, "ur_description") | ||
srdf_filename = os.path.join(package_dir, "srdf", "ur10_on_base.srdf") | ||
|
||
collision_model.addAllCollisionPairs() | ||
pinocchio.removeCollisionPairs(model, collision_model, srdf_filename) |