added doc on how to use framework with your robot or how to add new robot

This commit is contained in:
Ilya Uraev 2024-11-15 23:25:02 +03:00
parent ea4ae0ed69
commit 85eec1b7d7
8 changed files with 292 additions and 34 deletions

View file

@ -38,12 +38,17 @@ def launch_setup(context, *args, **kwargs):
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)
if not scene_config_file == "":
config_file = {"config_file": scene_config_file}
else:
config_file = {}
description_package_abs_path = get_package_share_directory(description_package.perform(context))
description_package_abs_path = get_package_share_directory(
description_package.perform(context)
)
simulation_controllers = os.path.join(
description_package_abs_path, "config", "controllers.yaml"
@ -91,9 +96,11 @@ def launch_setup(context, *args, **kwargs):
robot_description_content = robot_description_doc.toprettyxml(indent=" ")
robot_description = {"robot_description": robot_description_content}
# Parse robot and configure controller's file for ControllerManager
robot = URDF_parser.load_string(robot_description_content, ee_link_name="gripper_grasp_point")
robot = URDF_parser.load_string(
robot_description_content, ee_link_name="gripper_grasp_point"
)
ControllerManager.save_to_yaml(
robot, description_package_abs_path, "controllers.yaml"
)
@ -122,7 +129,9 @@ def launch_setup(context, *args, **kwargs):
"use_controllers": "true",
"robot_description": robot_description_content,
"base_link_name": base_link_name,
"ee_link_name": ee_link_name
"ee_link_name": ee_link_name,
"control_space": control_space,
"control_strategy": control_strategy,
}.items(),
)
@ -155,14 +164,6 @@ def generate_launch_description():
default_value="rbs_arm",
)
)
# General arguments
# declared_arguments.append(
# DeclareLaunchArgument(
# "controllers_file",
# default_value="controllers.yaml",
# description="YAML file with the controllers configuration.",
# )
# )
declared_arguments.append(
DeclareLaunchArgument(
"description_package",
@ -267,6 +268,22 @@ def generate_launch_description():
description="Base link name if robot arm",
)
)
declared_arguments.append(
DeclareLaunchArgument(
"control_space",
default_value="task",
choices=["task", "joint"],
description="Specify the control space for the robot (e.g., task space).",
)
)
declared_arguments.append(
DeclareLaunchArgument(
"control_strategy",
default_value="position",
choices=["position", "velocity", "effort"],
description="Specify the control strategy (e.g., position control).",
)
)
return LaunchDescription(
declared_arguments + [OpaqueFunction(function=launch_setup)]