refactor: (env_manager, rbs_runtime) and add YAML config loading
- Updated `camera.py` to use consistent float literals for default spawn positions. - Removed unused import statements and organized imports in `robot.py` and `scene.py`. - Removed debugging import from `scene.py` to clean up codebase. - Added a new YAML configuration file (`default-scene-config.yaml`) for scene settings. - Implemented a scene configuration loader function in `rbs_runtime/__init__.py` to read and parse YAML config files. - Modified `runtime.py` to utilize the newly added scene config loader and removed in-code default scene setup. - Updated `setup.py` to include `config` directory in package data. - Changed `rbs_robot.launch.py` to use position control strategy by default. - Refactored `skills.launch.py` with cleaner parameter definitions and reactivated commented-out nodes.
This commit is contained in:
parent
cc9b525637
commit
dba3b8682a
10 changed files with 226 additions and 72 deletions
|
@ -1,16 +1,11 @@
|
|||
from collections import namedtuple
|
||||
from os import name
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import (
|
||||
DeclareLaunchArgument,
|
||||
OpaqueFunction
|
||||
)
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch.actions import DeclareLaunchArgument, OpaqueFunction
|
||||
from launch.conditions import IfCondition
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import Node
|
||||
from rbs_launch_utils.launch_common import load_yaml
|
||||
|
||||
|
||||
def launch_setup(context, *args, **kwargs):
|
||||
robot_description_decl = LaunchConfiguration("robot_description")
|
||||
robot_description_semantic_decl = LaunchConfiguration("robot_description_semantic")
|
||||
|
@ -19,12 +14,12 @@ def launch_setup(context, *args, **kwargs):
|
|||
with_gripper_condition = LaunchConfiguration("with_gripper_condition")
|
||||
points_params_filepath_decl = LaunchConfiguration("points_params_filepath")
|
||||
robot_description = {"robot_description": robot_description_decl}
|
||||
robot_description_semantic = {"robot_description_semantic": robot_description_semantic_decl}
|
||||
robot_description_semantic = {
|
||||
"robot_description_semantic": robot_description_semantic_decl
|
||||
}
|
||||
namespace = LaunchConfiguration("namespace")
|
||||
|
||||
points_params = load_yaml(
|
||||
"rbs_skill_servers", "config/gripperPositions.yaml"
|
||||
)
|
||||
points_params = load_yaml("rbs_skill_servers", "config/gripperPositions.yaml")
|
||||
|
||||
kinematics_yaml = load_yaml("rbs_arm", "config/kinematics.yaml")
|
||||
|
||||
|
@ -39,20 +34,20 @@ def launch_setup(context, *args, **kwargs):
|
|||
robot_description_semantic,
|
||||
robot_description_kinematics,
|
||||
{"use_sim_time": use_sim_time},
|
||||
]
|
||||
],
|
||||
)
|
||||
|
||||
gripper_control_node = Node(
|
||||
package="rbs_skill_servers",
|
||||
executable="gripper_control_action_server",
|
||||
namespace=namespace,
|
||||
parameters= [
|
||||
parameters=[
|
||||
robot_description,
|
||||
robot_description_semantic,
|
||||
robot_description_kinematics,
|
||||
{"use_sim_time": use_sim_time},
|
||||
],
|
||||
condition=IfCondition(with_gripper_condition)
|
||||
condition=IfCondition(with_gripper_condition),
|
||||
)
|
||||
|
||||
move_cartesian_path_action_server = Node(
|
||||
|
@ -64,19 +59,16 @@ def launch_setup(context, *args, **kwargs):
|
|||
robot_description_semantic,
|
||||
robot_description_kinematics,
|
||||
{"use_sim_time": use_sim_time},
|
||||
]
|
||||
],
|
||||
)
|
||||
|
||||
cartesian_move_to_pose_action_server = Node(
|
||||
package="rbs_skill_servers",
|
||||
executable="move_to_pose.py",
|
||||
namespace=namespace,
|
||||
parameters=[{"use_sim_time": use_sim_time}, {"robot_name": namespace}],
|
||||
)
|
||||
|
||||
# cartesian_move_to_pose_action_server = Node(
|
||||
# package="rbs_skill_servers",
|
||||
# executable="move_to_pose.py",
|
||||
# namespace=namespace,
|
||||
# parameters=[
|
||||
# {"use_sim_time": use_sim_time},
|
||||
# {"robot_name": namespace}
|
||||
# ]
|
||||
# )
|
||||
|
||||
move_joint_state_action_server = Node(
|
||||
package="rbs_skill_servers",
|
||||
executable="move_to_joint_states_action_server",
|
||||
|
@ -86,30 +78,29 @@ def launch_setup(context, *args, **kwargs):
|
|||
robot_description_semantic,
|
||||
robot_description_kinematics,
|
||||
{"use_sim_time": use_sim_time},
|
||||
]
|
||||
],
|
||||
)
|
||||
|
||||
assembly_config = Node(
|
||||
package="rbs_utils",
|
||||
executable="assembly_config_service.py",
|
||||
namespace=namespace,
|
||||
output="screen"
|
||||
output="screen",
|
||||
)
|
||||
|
||||
|
||||
nodes_to_start =[
|
||||
nodes_to_start = [
|
||||
assembly_config,
|
||||
move_topose_action_server,
|
||||
gripper_control_node,
|
||||
move_cartesian_path_action_server,
|
||||
move_joint_state_action_server,
|
||||
# cartesian_move_to_pose_action_server,
|
||||
cartesian_move_to_pose_action_server,
|
||||
# grasp_pose_loader
|
||||
]
|
||||
return nodes_to_start
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
declared_arguments = []
|
||||
|
||||
declared_arguments.append(
|
||||
|
@ -125,18 +116,15 @@ def generate_launch_description():
|
|||
declared_arguments.append(
|
||||
DeclareLaunchArgument("robot_description_kinematics", default_value="")
|
||||
)
|
||||
declared_arguments.append(
|
||||
DeclareLaunchArgument("use_sim_time", default_value="")
|
||||
)
|
||||
declared_arguments.append(DeclareLaunchArgument("use_sim_time", default_value=""))
|
||||
declared_arguments.append(
|
||||
DeclareLaunchArgument("with_gripper_condition", default_value="")
|
||||
)
|
||||
declared_arguments.append(
|
||||
DeclareLaunchArgument("points_params_filepath", default_value="")
|
||||
)
|
||||
declared_arguments.append(
|
||||
DeclareLaunchArgument("namespace", default_value="")
|
||||
declared_arguments.append(DeclareLaunchArgument("namespace", default_value=""))
|
||||
|
||||
return LaunchDescription(
|
||||
declared_arguments + [OpaqueFunction(function=launch_setup)]
|
||||
)
|
||||
|
||||
|
||||
return LaunchDescription(declared_arguments + [OpaqueFunction(function=launch_setup)])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue