Skip to content
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

Parse xacro args from .setup_assistant config in MoveIt Configs Builder #2172

Merged
merged 6 commits into from
May 15, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def __init__(

self.__urdf_package = None
self.__urdf_file_path = None
self.__urdf_xacro_args = None
self.__srdf_file_path = None

modified_urdf_path = Path("config") / (self.__robot_name + ".urdf.xacro")
Expand All @@ -179,6 +180,11 @@ def __init__(
)
self.__urdf_file_path = Path(urdf_config["relative_path"])

if "xacro_args" in urdf_config:
self.__urdf_xacro_args = dict(
arg.split(":=") for arg in urdf_config["xacro_args"].split(" ")
)

srdf_config = config.get("srdf", config.get("SRDF"))
if srdf_config:
self.__srdf_file_path = Path(srdf_config["relative_path"])
Expand Down Expand Up @@ -217,6 +223,7 @@ def robot_description(
robot_description_file_path = self.__urdf_package / self.__urdf_file_path
else:
robot_description_file_path = self._package_path / file_path
mappings = self.__urdf_xacro_args
if (mappings is None) or all(
(isinstance(key, str) and isinstance(value, str))
for key, value in mappings.items()
Expand Down Expand Up @@ -253,7 +260,6 @@ def robot_description_semantic(
:param mappings: mappings to be passed when loading the xacro file.
:return: Instance of MoveItConfigsBuilder with robot_description_semantic loaded.
"""

if (mappings is None) or all(
(isinstance(key, str) and isinstance(value, str))
for key, value in mappings.items()
Expand Down