Refactor robot arm and runtime initialization logic

- Updated error message in `rbs_arm.py` to use the complete joint names for improved clarity.
- Refactored `scene.py` to replace asynchronous parameter retrieval with synchronous methods for reliability and simplified implementation.
- Enhanced `runtime.launch.py`:
  - Added new launch arguments `use_rbs_utils` and `assembly_config_name`.
  - Included additional parameters in runtime node initialization.
  - Adjusted runtime node arguments for debugging and clarity.
- Updated `runtime.py`:
  - Introduced `MultiThreadedExecutor` for improved threading and node handling.
  - Refactored the `main` function for cleaner node lifecycle management.
This commit is contained in:
Ilya Uraev 2024-12-06 12:10:35 +03:00
parent 1addd4f595
commit b1e20696fe
4 changed files with 61 additions and 58 deletions

View file

@ -32,17 +32,16 @@ def launch_setup(context, *args, **kwargs):
moveit_config_file = LaunchConfiguration("moveit_config_file")
use_sim_time = LaunchConfiguration("use_sim_time")
scene_config_file = LaunchConfiguration("scene_config_file").perform(context)
ee_link_name = LaunchConfiguration("ee_link_name").perform(context)
base_link_name = LaunchConfiguration("base_link_name").perform(context)
control_space = LaunchConfiguration("control_space").perform(context)
control_strategy = LaunchConfiguration("control_strategy").perform(context)
interactive = LaunchConfiguration("interactive").perform(context)
real_robot = LaunchConfiguration("real_robot").perform(context)
use_rbs_utils = LaunchConfiguration("use_rbs_utils")
assembly_config_name = LaunchConfiguration("assembly_config_name")
if not scene_config_file == "":
config_file = {"config_file": scene_config_file}
else:
@ -152,6 +151,8 @@ def launch_setup(context, *args, **kwargs):
"control_space": control_space,
"control_strategy": control_strategy,
"interactive_control": interactive,
"use_rbs_utils": use_rbs_utils,
"assembly_config_name": assembly_config_name
}.items(),
)
@ -170,9 +171,7 @@ def launch_setup(context, *args, **kwargs):
rbs_runtime = Node(
package="rbs_runtime",
executable="runtime",
output='log',
emulate_tty=True,
# arguments=[('log_level:=debug')],
arguments=[('--ros-args --remap log_level:=debug')],
parameters=[robot_description, config_file, {"use_sim_time": True}],
)
@ -333,6 +332,23 @@ def generate_launch_description():
)
declared_arguments.append(
DeclareLaunchArgument(
"use_rbs_utils",
default_value="true",
description="Wheter to use rbs_utils",
),
)
declared_arguments.append(
DeclareLaunchArgument(
"assembly_config_name",
default_value="",
description="Assembly config name from rbs_assets_library",
),
)
return LaunchDescription(
declared_arguments + [OpaqueFunction(function=launch_setup)]
)