Skip to content

Commit

Permalink
feat: adds compatibility to robot_description from topic instead of p…
Browse files Browse the repository at this point in the history
…arameter (moveit#1806)
  • Loading branch information
MarcoMagriDev authored Jan 24, 2023
1 parent dc8a663 commit e2e0003
Showing 1 changed file with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
from ament_index_python.packages import get_package_share_directory

from launch_param_builder import ParameterBuilder, load_yaml, load_xacro

from launch_param_builder.utils import ParameterBuilderFileNotFoundError

moveit_configs_utils_path = Path(get_package_share_directory("moveit_configs_utils"))

Expand Down Expand Up @@ -206,15 +206,24 @@ def robot_description(self, file_path: Optional[str] = None, mappings: dict = No
:param mappings: mappings to be passed when loading the xacro file.
:return: Instance of MoveItConfigsBuilder with robot_description loaded.
"""
if file_path is None:
robot_description_file_path = self.__urdf_package / self.__urdf_file_path
else:
robot_description_file_path = self._package_path / file_path
self.__moveit_configs.robot_description = {
self.__robot_description: load_xacro(
robot_description_file_path, mappings=mappings
try:
if file_path is None:
robot_description_file_path = (
self.__urdf_package / self.__urdf_file_path
)
else:
robot_description_file_path = self._package_path / file_path
self.__moveit_configs.robot_description = {
self.__robot_description: load_xacro(
robot_description_file_path, mappings=mappings
)
}
except ParameterBuilderFileNotFoundError as e:
logging.warning(f"\x1b[33;21m{e}\x1b[0m")
logging.warning(
f"\x1b[33;21mThe robot description will be loaded from /robot_description topic \x1b[0m"
)
}

return self

def robot_description_semantic(
Expand Down

0 comments on commit e2e0003

Please sign in to comment.