chore: 框架科学优化前的完整基线
在开始'设备契约层 + 目录重构 + 通止规装配'改造之前,先钉住当前可运行状态, 使后续任何删除/重构都可回退。 本基线包含: - 现有 ROS 2 工作区全部源码(arm_application / arm_control / arm_bringup 等) - 官方 flexiv_ros2 栈(含 flexiv_hardware / flexiv_controllers 等符号链接) - 设备契约层 src/arm_interfaces(新增,46 项单测通过) - devices/ 设备选型与品牌清单(新增) - scripts/gen_site_example.py 与由它生成的 config/site.example.yaml 按 .gitignore 排除:build/ / install/ / log/ / config/site.yaml / 模型权重二进制。
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
project(arm_moveit_config)
|
||||
|
||||
find_package(ament_cmake REQUIRED)
|
||||
|
||||
install(DIRECTORY config launch srdf
|
||||
DESTINATION share/${PROJECT_NAME}
|
||||
)
|
||||
|
||||
ament_package()
|
||||
@@ -0,0 +1,36 @@
|
||||
joint_limits:
|
||||
joint1:
|
||||
has_velocity_limits: true
|
||||
max_velocity: 2.0944
|
||||
has_acceleration_limits: true
|
||||
max_acceleration: 5.0
|
||||
joint2:
|
||||
has_velocity_limits: true
|
||||
max_velocity: 2.0944
|
||||
has_acceleration_limits: true
|
||||
max_acceleration: 5.0
|
||||
joint3:
|
||||
has_velocity_limits: true
|
||||
max_velocity: 2.4435
|
||||
has_acceleration_limits: true
|
||||
max_acceleration: 5.0
|
||||
joint4:
|
||||
has_velocity_limits: true
|
||||
max_velocity: 2.4435
|
||||
has_acceleration_limits: true
|
||||
max_acceleration: 5.0
|
||||
joint5:
|
||||
has_velocity_limits: true
|
||||
max_velocity: 4.8869
|
||||
has_acceleration_limits: true
|
||||
max_acceleration: 8.0
|
||||
joint6:
|
||||
has_velocity_limits: true
|
||||
max_velocity: 4.8869
|
||||
has_acceleration_limits: true
|
||||
max_acceleration: 8.0
|
||||
joint7:
|
||||
has_velocity_limits: true
|
||||
max_velocity: 4.8869
|
||||
has_acceleration_limits: true
|
||||
max_acceleration: 8.0
|
||||
@@ -0,0 +1,4 @@
|
||||
rizon_arm:
|
||||
kinematics_solver: kdl_kinematics_plugin/KDLKinematicsPlugin
|
||||
kinematics_solver_search_resolution: 0.005
|
||||
kinematics_solver_timeout: 0.05
|
||||
@@ -0,0 +1,22 @@
|
||||
trajectory_execution:
|
||||
allowed_execution_duration_scaling: 1.2
|
||||
allowed_goal_duration_margin: 0.5
|
||||
allowed_start_tolerance: 0.01
|
||||
|
||||
moveit_controller_manager: moveit_simple_controller_manager/MoveItSimpleControllerManager
|
||||
|
||||
moveit_simple_controller_manager:
|
||||
controller_names:
|
||||
- rizon_arm_controller
|
||||
rizon_arm_controller:
|
||||
type: FollowJointTrajectory
|
||||
action_ns: follow_joint_trajectory
|
||||
default: true
|
||||
joints:
|
||||
- Rizon4-063989_joint1
|
||||
- Rizon4-063989_joint2
|
||||
- Rizon4-063989_joint3
|
||||
- Rizon4-063989_joint4
|
||||
- Rizon4-063989_joint5
|
||||
- Rizon4-063989_joint6
|
||||
- Rizon4-063989_joint7
|
||||
@@ -0,0 +1,24 @@
|
||||
planning_plugin: ompl_interface/OMPLPlanner
|
||||
request_adapters: >-
|
||||
default_planner_request_adapters/AddTimeOptimalParameterization
|
||||
default_planner_request_adapters/ResolveConstraintFrames
|
||||
default_planner_request_adapters/FixWorkspaceBounds
|
||||
default_planner_request_adapters/FixStartStateBounds
|
||||
default_planner_request_adapters/FixStartStateCollision
|
||||
default_planner_request_adapters/FixStartStatePathConstraints
|
||||
start_state_max_bounds_error: 0.1
|
||||
|
||||
planner_configs:
|
||||
RRTConnect:
|
||||
type: geometric::RRTConnect
|
||||
range: 0.0
|
||||
RRTstar:
|
||||
type: geometric::RRTstar
|
||||
range: 0.0
|
||||
|
||||
rizon_arm:
|
||||
planner_configs:
|
||||
- RRTConnect
|
||||
- RRTstar
|
||||
projection_evaluator: joints(joint1,joint2)
|
||||
longest_valid_segment_fraction: 0.005
|
||||
@@ -0,0 +1,74 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument, OpaqueFunction
|
||||
from launch.substitutions import Command, LaunchConfiguration, PathJoinSubstitution
|
||||
from launch_ros.actions import Node
|
||||
from launch_ros.parameter_descriptions import ParameterValue
|
||||
from launch_ros.substitutions import FindPackageShare
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
import os
|
||||
import yaml
|
||||
|
||||
|
||||
def _load_yaml(path: str):
|
||||
with open(path, 'r', encoding='utf-8') as f:
|
||||
return yaml.safe_load(f)
|
||||
|
||||
|
||||
def _launch_setup(context, *args, **kwargs):
|
||||
use_fake = LaunchConfiguration('use_fake_hardware').perform(context)
|
||||
|
||||
desc_share = get_package_share_directory('arm_description')
|
||||
moveit_share = get_package_share_directory('arm_moveit_config')
|
||||
|
||||
urdf_path = os.path.join(desc_share, 'urdf', 'arm.urdf.xacro')
|
||||
srdf_path = os.path.join(moveit_share, 'srdf', 'arm.srdf')
|
||||
|
||||
robot_description = ParameterValue(
|
||||
Command(['xacro ', urdf_path, ' use_fake_hardware:=', use_fake]),
|
||||
value_type=str,
|
||||
)
|
||||
with open(srdf_path, 'r', encoding='utf-8') as f:
|
||||
robot_description_semantic = f.read()
|
||||
|
||||
kinematics = _load_yaml(os.path.join(moveit_share, 'config', 'kinematics.yaml'))
|
||||
ompl = _load_yaml(os.path.join(moveit_share, 'config', 'ompl_planning.yaml'))
|
||||
controllers = _load_yaml(os.path.join(moveit_share, 'config', 'moveit_controllers.yaml'))
|
||||
joint_limits = _load_yaml(os.path.join(moveit_share, 'config', 'joint_limits.yaml'))
|
||||
|
||||
move_group_params = {
|
||||
'robot_description': robot_description,
|
||||
'robot_description_semantic': robot_description_semantic,
|
||||
'robot_description_kinematics': kinematics,
|
||||
'robot_description_planning': joint_limits,
|
||||
'ompl': ompl,
|
||||
'planning_pipelines': ['ompl'],
|
||||
'default_planning_pipeline': 'ompl',
|
||||
**controllers,
|
||||
}
|
||||
|
||||
move_group = Node(
|
||||
package='moveit_ros_move_group',
|
||||
executable='move_group',
|
||||
output='screen',
|
||||
parameters=[move_group_params],
|
||||
)
|
||||
|
||||
rviz = Node(
|
||||
package='rviz2',
|
||||
executable='rviz2',
|
||||
name='rviz2',
|
||||
output='screen',
|
||||
parameters=[
|
||||
{'robot_description': robot_description},
|
||||
{'robot_description_semantic': robot_description_semantic},
|
||||
],
|
||||
)
|
||||
|
||||
return [move_group, rviz]
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
return LaunchDescription([
|
||||
DeclareLaunchArgument('use_fake_hardware', default_value='true'),
|
||||
OpaqueFunction(function=_launch_setup),
|
||||
])
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||
<package format="3">
|
||||
<name>arm_moveit_config</name>
|
||||
<version>0.1.0</version>
|
||||
<description>MoveIt2 configuration template for the 6-DOF arm.</description>
|
||||
<maintainer email="dev@example.com">arm_dev</maintainer>
|
||||
<license>Apache-2.0</license>
|
||||
|
||||
<buildtool_depend>ament_cmake</buildtool_depend>
|
||||
|
||||
<exec_depend>arm_description</exec_depend>
|
||||
<exec_depend>moveit_ros_move_group</exec_depend>
|
||||
<exec_depend>moveit_kinematics</exec_depend>
|
||||
<exec_depend>moveit_planners_ompl</exec_depend>
|
||||
<exec_depend>moveit_ros_visualization</exec_depend>
|
||||
<exec_depend>moveit_configs_utils</exec_depend>
|
||||
<exec_depend>xacro</exec_depend>
|
||||
<exec_depend>rviz2</exec_depend>
|
||||
|
||||
<export>
|
||||
<build_type>ament_cmake</build_type>
|
||||
</export>
|
||||
</package>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- MoveIt SRDF — site Rizon4-063989, no gripper. Names match flexiv_description. -->
|
||||
<robot name="rizon4">
|
||||
<group name="rizon_arm">
|
||||
<chain base_link="Rizon4-063989_base_link" tip_link="Rizon4-063989_tcp"/>
|
||||
</group>
|
||||
|
||||
<group_state name="home" group="rizon_arm">
|
||||
<joint name="Rizon4-063989_joint1" value="0"/>
|
||||
<joint name="Rizon4-063989_joint2" value="-0.698"/>
|
||||
<joint name="Rizon4-063989_joint3" value="0"/>
|
||||
<joint name="Rizon4-063989_joint4" value="1.57"/>
|
||||
<joint name="Rizon4-063989_joint5" value="0"/>
|
||||
<joint name="Rizon4-063989_joint6" value="0.698"/>
|
||||
<joint name="Rizon4-063989_joint7" value="0"/>
|
||||
</group_state>
|
||||
|
||||
<group_state name="ready" group="rizon_arm">
|
||||
<joint name="Rizon4-063989_joint1" value="0"/>
|
||||
<joint name="Rizon4-063989_joint2" value="-0.698"/>
|
||||
<joint name="Rizon4-063989_joint3" value="0"/>
|
||||
<joint name="Rizon4-063989_joint4" value="1.57"/>
|
||||
<joint name="Rizon4-063989_joint5" value="0"/>
|
||||
<joint name="Rizon4-063989_joint6" value="0.698"/>
|
||||
<joint name="Rizon4-063989_joint7" value="0"/>
|
||||
</group_state>
|
||||
|
||||
<end_effector name="hand" parent_link="Rizon4-063989_tcp" group="rizon_arm"/>
|
||||
|
||||
<disable_collisions link1="Rizon4-063989_base_link" link2="Rizon4-063989_link1" reason="Adjacent"/>
|
||||
<disable_collisions link1="Rizon4-063989_link1" link2="Rizon4-063989_link2" reason="Adjacent"/>
|
||||
<disable_collisions link1="Rizon4-063989_link2" link2="Rizon4-063989_link3" reason="Adjacent"/>
|
||||
<disable_collisions link1="Rizon4-063989_link3" link2="Rizon4-063989_link4" reason="Adjacent"/>
|
||||
<disable_collisions link1="Rizon4-063989_link4" link2="Rizon4-063989_link5" reason="Adjacent"/>
|
||||
<disable_collisions link1="Rizon4-063989_link5" link2="Rizon4-063989_link6" reason="Adjacent"/>
|
||||
<disable_collisions link1="Rizon4-063989_link6" link2="Rizon4-063989_link7" reason="Adjacent"/>
|
||||
</robot>
|
||||
Reference in New Issue
Block a user