-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
39 additions
and
0 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 @@ | ||
from .description_factory import description_factory |
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,34 @@ | ||
import os | ||
from typing import Dict | ||
|
||
import xacro | ||
from ament_index_python import get_package_share_directory | ||
|
||
|
||
def description_factory( | ||
model: str = "iiwa7", robot_name: str = "lbr", sim: bool = True | ||
) -> Dict[str, str]: | ||
r"""Robot description factory for the LBR. | ||
Args: | ||
model (str): The LBR model in use. Defaults to "iiwa7". Choices are "iiwa7", "iiwa14", "med7", "med14". | ||
robot_name (str): The name of the robot. | ||
sim (bool): Whether to use the simulation or not. | ||
Returns: | ||
robot_description (Dict[str, str]): The robot description as a dictionary. | ||
""" | ||
robot_description = { | ||
"robot_description": xacro.process( | ||
os.path.join( | ||
get_package_share_directory("lbr_description"), | ||
f"urdf/{model}/{model}.urdf.xacro", | ||
), | ||
mappings={ | ||
"robot_name": robot_name, | ||
"sim": "true" if sim else "false", | ||
}, | ||
) | ||
} | ||
|
||
return robot_description |
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