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 all 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 := urdf_config.get("xacro_args")) is not None:
self.__urdf_xacro_args = dict(
arg.split(":=") for arg in xacro_args.split(" ") if arg
)

srdf_config = config.get("srdf", config.get("SRDF"))
if srdf_config:
self.__srdf_file_path = Path(srdf_config["relative_path"])
Expand Down Expand Up @@ -224,7 +230,8 @@ def robot_description(
try:
self.__moveit_configs.robot_description = {
self.__robot_description: load_xacro(
robot_description_file_path, mappings=mappings
robot_description_file_path,
mappings=mappings or self.__urdf_xacro_args,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this or when you assigned mappings on L226 (does 226 need to be removed like Jafar suggested)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think that line needs to be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assignment should be removed now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I cut it out of there but I must have accidentally undo'd that change. Thank you @JafarAbdi for cleaning that up for me

)
}
except ParameterBuilderFileNotFoundError as e:
Expand Down