Skip to content

Commit 79a2fa5

Browse files
abake48JafarAbdi
andauthored
Parse xacro args from .setup_assistant config in MoveIt Configs Builder (#2172)
Co-authored-by: Jafar <jafar.uruc@gmail.com>
1 parent 226f81c commit 79a2fa5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

moveit_configs_utils/moveit_configs_utils/moveit_configs_builder.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ def __init__(
162162

163163
self.__urdf_package = None
164164
self.__urdf_file_path = None
165+
self.__urdf_xacro_args = None
165166
self.__srdf_file_path = None
166167

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

183+
if (xacro_args := urdf_config.get("xacro_args")) is not None:
184+
self.__urdf_xacro_args = dict(
185+
arg.split(":=") for arg in xacro_args.split(" ") if arg
186+
)
187+
182188
srdf_config = config.get("srdf", config.get("SRDF"))
183189
if srdf_config:
184190
self.__srdf_file_path = Path(srdf_config["relative_path"])
@@ -224,7 +230,8 @@ def robot_description(
224230
try:
225231
self.__moveit_configs.robot_description = {
226232
self.__robot_description: load_xacro(
227-
robot_description_file_path, mappings=mappings
233+
robot_description_file_path,
234+
mappings=mappings or self.__urdf_xacro_args,
228235
)
229236
}
230237
except ParameterBuilderFileNotFoundError as e:

0 commit comments

Comments
 (0)