From 9295571f2ea12bf36966fde59dca464579d06a01 Mon Sep 17 00:00:00 2001 From: takuya kodama Date: Mon, 21 Jul 2025 10:43:13 +0900 Subject: [PATCH 1/9] Add issue templates (#35) --- .github/ISSUE_TEMPLATE/1-bug-report.yml | 25 ++++++++++++++++++++ .github/ISSUE_TEMPLATE/2-feature-request.yml | 25 ++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 22 +++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/1-bug-report.yml create mode 100644 .github/ISSUE_TEMPLATE/2-feature-request.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/1-bug-report.yml b/.github/ISSUE_TEMPLATE/1-bug-report.yml new file mode 100644 index 0000000..cd35d2a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/1-bug-report.yml @@ -0,0 +1,25 @@ +# Copyright 2025 Enactic, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Bug Report +description: File a bug report. +type: Bug +body: + - type: textarea + id: description + attributes: + label: Describe the problem you got + description: It's better that you provide information as much as possible. + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/2-feature-request.yml b/.github/ISSUE_TEMPLATE/2-feature-request.yml new file mode 100644 index 0000000..5c17335 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/2-feature-request.yml @@ -0,0 +1,25 @@ +# Copyright 2025 Enactic, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Feature Request +description: Request a feature. +type: Feature +body: + - type: textarea + id: description + attributes: + label: Describe the feature you want + description: It's better that you also provide your use case. + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..203d819 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,22 @@ +# Copyright 2025 Enactic, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +blank_issues_enabled: false +contact_links: + - name: Discord + url: https://discord.gg/FsZaZ4z3We + about: Please ask and answer questions here. + - name: GitHub Discussions + url: https://github.com/enactic/openarm_ros2/discussions + about: If you prefer GitHub Discussions to Discord, you can use GitHub Discussions too. From 09254f06f95e821e7a13d67ba13458e6a1303d6f Mon Sep 17 00:00:00 2001 From: takuya kodama Date: Tue, 22 Jul 2025 09:03:52 +0900 Subject: [PATCH 2/9] Add contributing guide line (#37) --- CONTRIBUTING.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..c232ce4 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,19 @@ +# How to contribute + +## Did you find a bug? + +Please report it to [GitHub Issues](https://github.com/enactic/openarm_ros2/issues/new?template=1-bug-report.yml)! + +## Did you have a feature request? + +Please share it to [GitHub Issues](https://github.com/enactic/openarm_ros2/issues/new?template=2-feature-request.yml)! + +## Did you write a patch? + +Please open a pull request with it! + +Please make sure to review [our license](https://github.com/enactic/openarm_ros2/blob/main/LICENSE) before you open a pull request. + +## Others? + +Please share it on [Discord](https://discord.gg/FsZaZ4z3We) or [GitHub Discussions](https://github.com/enactic/openarm_ros2/discussions)! From 0e136a2b8be9c1882420d31de10947e0d5481c36 Mon Sep 17 00:00:00 2001 From: Daijiro Fukuda Date: Wed, 23 Jul 2025 12:05:22 +0900 Subject: [PATCH 3/9] Add related links to README (#39) --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 98683c6..ae3716a 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,12 @@ Continue with the build. --- +## Related links + +- 📚 Read the [documentation](https://docs.openarm.dev/software/ros2/install) +- 💬 Join the community on [Discord](https://discord.gg/FsZaZ4z3We) +- 📬 Contact us through + ## License All packages of `openarm_ros2` are licensed under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). From 67a60a23ba716a8ff0982105f73ff61aae1cfaae Mon Sep 17 00:00:00 2001 From: Yue Yin Date: Wed, 23 Jul 2025 14:41:24 +0900 Subject: [PATCH 4/9] Reconfigured controllers with new URDF for v1.0 (#34) This PR is made for new release and do not work with current v0.3 robot descriptions. Use for the ros2 control for quick arm control. Launch files spawn: - Robot state publisher - Controller manager with ros2_control - Joint state broadcaster - Robot controller (joint trajectory or forward position) - Gripper controller - RViz2 visualization --------- Co-authored-by: Thomason Zhou --- openarm/package.xml | 3 +- openarm_bimanual_moveit_config/package.xml | 2 +- openarm_bringup/CMakeLists.txt | 2 +- openarm_bringup/README.md | 35 +- .../config/test_goal_publishers_config.yaml | 58 --- .../openarm_v10_bimanual_controllers.yaml | 175 +++++++++ ...m_v10_bimanual_controllers_namespaced.yaml | 124 +++++++ .../openarm_v10_controllers.yaml} | 85 +++-- .../launch/openarm.bimanual.launch.py | 285 +++++++++++++++ openarm_bringup/launch/openarm.launch.py | 345 +++++++++--------- ...test_forward_position_controller.launch.py | 51 --- ...test_joint_trajectory_controller.launch.py | 51 --- openarm_bringup/package.xml | 4 +- openarm_bringup/rviz/bimanual.rviz | 295 +++++++++++++++ openarm_bringup/utils/init_can.sh | 30 -- openarm_hardware/package.xml | 2 +- 16 files changed, 1127 insertions(+), 420 deletions(-) delete mode 100644 openarm_bringup/config/test_goal_publishers_config.yaml create mode 100644 openarm_bringup/config/v10_controllers/openarm_v10_bimanual_controllers.yaml create mode 100644 openarm_bringup/config/v10_controllers/openarm_v10_bimanual_controllers_namespaced.yaml rename openarm_bringup/config/{openarm_controllers.yaml => v10_controllers/openarm_v10_controllers.yaml} (54%) create mode 100644 openarm_bringup/launch/openarm.bimanual.launch.py delete mode 100644 openarm_bringup/launch/test_forward_position_controller.launch.py delete mode 100644 openarm_bringup/launch/test_joint_trajectory_controller.launch.py create mode 100644 openarm_bringup/rviz/bimanual.rviz delete mode 100755 openarm_bringup/utils/init_can.sh diff --git a/openarm/package.xml b/openarm/package.xml index 2ae166b..03966be 100644 --- a/openarm/package.xml +++ b/openarm/package.xml @@ -17,7 +17,7 @@ --> openarm - 0.3.0 + 1.0.0 Metapackage for OpenArm Thomason Zhou Apache-2.0 @@ -28,7 +28,6 @@ openarm_bringup openarm_description openarm_hardware - ament_lint_auto ament_lint_common diff --git a/openarm_bimanual_moveit_config/package.xml b/openarm_bimanual_moveit_config/package.xml index f4b49c3..40ac99d 100644 --- a/openarm_bimanual_moveit_config/package.xml +++ b/openarm_bimanual_moveit_config/package.xml @@ -17,7 +17,7 @@ --> openarm_bimanual_moveit_config - 0.3.0 + 1.0.0 An automatically generated package with all the configuration and launch files for using the openarm_bimanual with the MoveIt Motion Planning Framework diff --git a/openarm_bringup/CMakeLists.txt b/openarm_bringup/CMakeLists.txt index 22ca5a1..72ac5c0 100644 --- a/openarm_bringup/CMakeLists.txt +++ b/openarm_bringup/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 2025 Reazon Holdings, Inc. +# Copyright 2025 Enactic, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/openarm_bringup/README.md b/openarm_bringup/README.md index 720ca89..391f8f7 100644 --- a/openarm_bringup/README.md +++ b/openarm_bringup/README.md @@ -1,9 +1,32 @@ -## utils +# OpenArm Bringup -init_can.sh \ \ +This package provides launch files to bring up the OpenArm robot system. -e.g. -```sh -./init_can.sh/dev/ACM0 can0 -./init_can.sh/dev/ACM1 can1 +## Quick Start + +Launch the OpenArm with v1.0 configuration and fake hardware: + +```bash +ros2 launch openarm_bringup openarm.launch.py arm_type:=v10 use_fake_hardware:=true ``` + +## Launch Files + +- `openarm.launch.py` - Single arm configuration +- `openarm.bimanual.launch.py` - Dual arm configuration + +## Key Parameters + +- `arm_type` - Arm type (default: v10) +- `use_fake_hardware` - Use fake hardware instead of real hardware (default: false) +- `can_interface` - CAN interface to use (default: can0) +- `robot_controller` - Controller type: `joint_trajectory_controller` or `forward_position_controller` + +## What Gets Launched + +- Robot state publisher +- Controller manager with ros2_control +- Joint state broadcaster +- Robot controller (joint trajectory or forward position) +- Gripper controller +- RViz2 visualization diff --git a/openarm_bringup/config/test_goal_publishers_config.yaml b/openarm_bringup/config/test_goal_publishers_config.yaml deleted file mode 100644 index f750f34..0000000 --- a/openarm_bringup/config/test_goal_publishers_config.yaml +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright (c) 2024 Stogl Robotics Consulting UG (haftungsbeschränkt) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# -# Source of this file are templates in -# [RosTeamWorkspace](https://github.com/StoglRobotics/ros_team_workspace) repository. -# - -publisher_forward_position_controller: - ros__parameters: - - controller_name: "forward_position_controller" - wait_sec_between_publish: 5 - - goal_names: ["pos1", "pos2", "pos3", "pos4"] - pos1: [0.185, 0.185, 0.185, 0.185, 0.185, 0.185, 0.185] - pos2: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] - pos3: [-0.185, -0.185, -0.185, -0.185, -0.185, -0.185, -0.185] - pos4: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] - - -publisher_joint_trajectory_controller: - ros__parameters: - - controller_name: "joint_trajectory_controller" - wait_sec_between_publish: 6 - repeat_the_same_goal: 1 # useful to simulate continuous inputs - - goal_time_from_start: 3.0 - goal_names: ["pos1", "pos2", "pos3", "pos4"] - pos1: - positions: [0.185, 0.185, 0.185, 0.185, 0.185, 0.185, 0.185] - pos2: - positions: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] - pos3: - positions: [-0.185, -0.185, -0.185, -0.185, -0.185, -0.185, -0.185] - pos4: - positions: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] - - joints: - - rev1 - - rev2 - - rev3 - - rev4 - - rev5 - - rev6 - - rev7 diff --git a/openarm_bringup/config/v10_controllers/openarm_v10_bimanual_controllers.yaml b/openarm_bringup/config/v10_controllers/openarm_v10_bimanual_controllers.yaml new file mode 100644 index 0000000..8a386ee --- /dev/null +++ b/openarm_bringup/config/v10_controllers/openarm_v10_bimanual_controllers.yaml @@ -0,0 +1,175 @@ +# Copyright 2025 Enactic, Inc. +# Copyright 2024 Stogl Robotics Consulting UG (haftungsbeschränkt) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +controller_manager: + ros__parameters: + update_rate: 100 # Hz + + joint_state_broadcaster: + type: joint_state_broadcaster/JointStateBroadcaster + + left_forward_position_controller: + type: forward_command_controller/ForwardCommandController + + left_forward_velocity_controller: + type: forward_command_controller/ForwardCommandController + + left_joint_trajectory_controller: + type: joint_trajectory_controller/JointTrajectoryController + + left_gripper_controller: + type: position_controllers/GripperActionController + + right_forward_position_controller: + type: forward_command_controller/ForwardCommandController + + right_forward_velocity_controller: + type: forward_command_controller/ForwardCommandController + + right_joint_trajectory_controller: + type: joint_trajectory_controller/JointTrajectoryController + + right_gripper_controller: + type: position_controllers/GripperActionController + + +left_forward_position_controller: + ros__parameters: + joints: + - openarm_left_joint1 + - openarm_left_joint2 + - openarm_left_joint3 + - openarm_left_joint4 + - openarm_left_joint5 + - openarm_left_joint6 + - openarm_left_joint7 + interface_name: position + command_interfaces: + - position + state_interfaces: + - position + +left_forward_velocity_controller: + ros__parameters: + joints: + - openarm_left_joint1 + - openarm_left_joint2 + - openarm_left_joint3 + - openarm_left_joint4 + - openarm_left_joint5 + - openarm_left_joint6 + - openarm_left_joint7 + interface_name: velocity + command_interfaces: + - velocity + state_interfaces: + - velocity + +left_joint_trajectory_controller: + ros__parameters: + joints: + - openarm_left_joint1 + - openarm_left_joint2 + - openarm_left_joint3 + - openarm_left_joint4 + - openarm_left_joint5 + - openarm_left_joint6 + - openarm_left_joint7 + interface_name: position + command_interfaces: + - position + state_interfaces: + - position + + state_publish_rate: 50.0 # Defaults to 50 + action_monitor_rate: 50.0 # Defaults to 20 + + allow_partial_joints_goal: false # Defaults to false + constraints: + stopped_velocity_tolerance: 0.01 # Defaults to 0.01 + goal_time: 0.0 # Defaults to 0.0 (start immediately) + +left_gripper_controller: + ros__parameters: + joint: openarm_left_finger_joint1 + command_interfaces: + - position + state_interfaces: + - position + + +right_forward_position_controller: + ros__parameters: + joints: + - openarm_right_joint1 + - openarm_right_joint2 + - openarm_right_joint3 + - openarm_right_joint4 + - openarm_right_joint5 + - openarm_right_joint6 + - openarm_right_joint7 + interface_name: position + command_interfaces: + - position + state_interfaces: + - position + +right_forward_velocity_controller: + ros__parameters: + joints: + - openarm_right_joint1 + - openarm_right_joint2 + - openarm_right_joint3 + - openarm_right_joint4 + - openarm_right_joint5 + - openarm_right_joint6 + - openarm_right_joint7 + interface_name: velocity + command_interfaces: + - velocity + state_interfaces: + - velocity + +right_joint_trajectory_controller: + ros__parameters: + joints: + - openarm_right_joint1 + - openarm_right_joint2 + - openarm_right_joint3 + - openarm_right_joint4 + - openarm_right_joint5 + - openarm_right_joint6 + - openarm_right_joint7 + interface_name: position + command_interfaces: + - position + state_interfaces: + - position + + state_publish_rate: 50.0 # Defaults to 50 + action_monitor_rate: 50.0 # Defaults to 20 + + allow_partial_joints_goal: false # Defaults to false + constraints: + stopped_velocity_tolerance: 0.01 # Defaults to 0.01 + goal_time: 0.0 # Defaults to 0.0 (start immediately) + +right_gripper_controller: + ros__parameters: + joint: openarm_right_finger_joint1 + command_interfaces: + - position + state_interfaces: + - position \ No newline at end of file diff --git a/openarm_bringup/config/v10_controllers/openarm_v10_bimanual_controllers_namespaced.yaml b/openarm_bringup/config/v10_controllers/openarm_v10_bimanual_controllers_namespaced.yaml new file mode 100644 index 0000000..6892eba --- /dev/null +++ b/openarm_bringup/config/v10_controllers/openarm_v10_bimanual_controllers_namespaced.yaml @@ -0,0 +1,124 @@ +/**: + ros__parameters: + update_rate: 100 # Hz + + joint_state_broadcaster: + type: joint_state_broadcaster/JointStateBroadcaster + + left_joint_trajectory_controller: + type: joint_trajectory_controller/JointTrajectoryController + + right_joint_trajectory_controller: + type: joint_trajectory_controller/JointTrajectoryController + + left_forward_position_controller: + type: forward_command_controller/ForwardCommandController + + right_forward_position_controller: + type: forward_command_controller/ForwardCommandController + + left_gripper_controller: + type: forward_command_controller/ForwardCommandController + + right_gripper_controller: + type: forward_command_controller/ForwardCommandController + +/**/left_joint_trajectory_controller: + ros__parameters: + joints: + - openarm_left_joint1 + - openarm_left_joint2 + - openarm_left_joint3 + - openarm_left_joint4 + - openarm_left_joint5 + - openarm_left_joint6 + - openarm_left_joint7 + interface_name: position + command_interfaces: + - position + state_interfaces: + - position + - velocity + state_publish_rate: 100.0 + action_monitor_rate: 20.0 + allow_partial_joints_goal: false + open_loop_control: false + allow_integration_in_goal_trajectories: true + constraints: + stopped_velocity_tolerance: 0.01 + goal_time: 0.6 + openarm_left_joint1: {trajectory: 0.1, goal: 0.1} + openarm_left_joint2: {trajectory: 0.1, goal: 0.1} + openarm_left_joint3: {trajectory: 0.1, goal: 0.1} + openarm_left_joint4: {trajectory: 0.1, goal: 0.1} + openarm_left_joint5: {trajectory: 0.1, goal: 0.1} + openarm_left_joint6: {trajectory: 0.1, goal: 0.1} + openarm_left_joint7: {trajectory: 0.1, goal: 0.1} + +/**/right_joint_trajectory_controller: + ros__parameters: + joints: + - openarm_right_joint1 + - openarm_right_joint2 + - openarm_right_joint3 + - openarm_right_joint4 + - openarm_right_joint5 + - openarm_right_joint6 + - openarm_right_joint7 + interface_name: position + command_interfaces: + - position + state_interfaces: + - position + - velocity + state_publish_rate: 100.0 + action_monitor_rate: 20.0 + allow_partial_joints_goal: false + open_loop_control: false + allow_integration_in_goal_trajectories: true + constraints: + stopped_velocity_tolerance: 0.01 + goal_time: 0.6 + openarm_right_joint1: {trajectory: 0.1, goal: 0.1} + openarm_right_joint2: {trajectory: 0.1, goal: 0.1} + openarm_right_joint3: {trajectory: 0.1, goal: 0.1} + openarm_right_joint4: {trajectory: 0.1, goal: 0.1} + openarm_right_joint5: {trajectory: 0.1, goal: 0.1} + openarm_right_joint6: {trajectory: 0.1, goal: 0.1} + openarm_right_joint7: {trajectory: 0.1, goal: 0.1} + +/**/left_forward_position_controller: + ros__parameters: + joints: + - openarm_left_joint1 + - openarm_left_joint2 + - openarm_left_joint3 + - openarm_left_joint4 + - openarm_left_joint5 + - openarm_left_joint6 + - openarm_left_joint7 + interface_name: position + +/**/right_forward_position_controller: + ros__parameters: + joints: + - openarm_right_joint1 + - openarm_right_joint2 + - openarm_right_joint3 + - openarm_right_joint4 + - openarm_right_joint5 + - openarm_right_joint6 + - openarm_right_joint7 + interface_name: position + +/**/left_gripper_controller: + ros__parameters: + joints: + - openarm_left_finger_joint1 + interface_name: position + +/**/right_gripper_controller: + ros__parameters: + joints: + - openarm_right_finger_joint1 + interface_name: position diff --git a/openarm_bringup/config/openarm_controllers.yaml b/openarm_bringup/config/v10_controllers/openarm_v10_controllers.yaml similarity index 54% rename from openarm_bringup/config/openarm_controllers.yaml rename to openarm_bringup/config/v10_controllers/openarm_v10_controllers.yaml index 5f172e0..f2f3a03 100644 --- a/openarm_bringup/config/openarm_controllers.yaml +++ b/openarm_bringup/config/v10_controllers/openarm_v10_controllers.yaml @@ -1,4 +1,5 @@ -# Copyright (c) 2024 Stogl Robotics Consulting UG (haftungsbeschränkt) +# Copyright 2025 Enactic, Inc. +# Copyright 2024 Stogl Robotics Consulting UG (haftungsbeschränkt) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,13 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# -# Source of this file are templates in -# [RosTeamWorkspace](https://github.com/StoglRobotics/ros_team_workspace) repository. -# -# Author: Dr. Denis -# - controller_manager: ros__parameters: update_rate: 100 # Hz @@ -26,49 +20,61 @@ controller_manager: joint_state_broadcaster: type: joint_state_broadcaster/JointStateBroadcaster - forward_position_controller: + forward_position_controller: type: forward_command_controller/ForwardCommandController - forward_velocity_controller: + forward_velocity_controller: type: forward_command_controller/ForwardCommandController - joint_trajectory_controller: + joint_trajectory_controller: type: joint_trajectory_controller/JointTrajectoryController -forward_position_controller: + gripper_controller: + type: position_controllers/GripperActionController + +forward_position_controller: ros__parameters: joints: - - rev1 - - rev2 - - rev3 - - rev4 - - rev5 - - rev6 - - rev7 + - openarm_joint1 + - openarm_joint2 + - openarm_joint3 + - openarm_joint4 + - openarm_joint5 + - openarm_joint6 + - openarm_joint7 interface_name: position + command_interfaces: + - position + state_interfaces: + - position -forward_velocity_controller: + +forward_velocity_controller: ros__parameters: joints: - - rev1 - - rev2 - - rev3 - - rev4 - - rev5 - - rev6 - - rev7 + - openarm_joint1 + - openarm_joint2 + - openarm_joint3 + - openarm_joint4 + - openarm_joint5 + - openarm_joint6 + - openarm_joint7 interface_name: velocity + command_interfaces: + - velocity + state_interfaces: + - velocity -joint_trajectory_controller: +joint_trajectory_controller: ros__parameters: joints: - - rev1 - - rev2 - - rev3 - - rev4 - - rev5 - - rev6 - - rev7 + - openarm_joint1 + - openarm_joint2 + - openarm_joint3 + - openarm_joint4 + - openarm_joint5 + - openarm_joint6 + - openarm_joint7 command_interfaces: - position @@ -82,3 +88,12 @@ joint_trajectory_controller: constraints: stopped_velocity_tolerance: 0.01 # Defaults to 0.01 goal_time: 0.0 # Defaults to 0.0 (start immediately) + + +gripper_controller: + ros__parameters: + joint: openarm_finger_joint1 + command_interfaces: + - position + state_interfaces: + - position \ No newline at end of file diff --git a/openarm_bringup/launch/openarm.bimanual.launch.py b/openarm_bringup/launch/openarm.bimanual.launch.py new file mode 100644 index 0000000..99250a5 --- /dev/null +++ b/openarm_bringup/launch/openarm.bimanual.launch.py @@ -0,0 +1,285 @@ +# Copyright 2025 Enactic, Inc. +# Copyright 2024 Stogl Robotics Consulting UG (haftungsbeschränkt) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import xacro + +from ament_index_python.packages import get_package_share_directory + +from launch import LaunchDescription, LaunchContext +from launch.actions import DeclareLaunchArgument, RegisterEventHandler, TimerAction, OpaqueFunction +from launch.event_handlers import OnProcessExit +from launch.substitutions import ( + LaunchConfiguration, + PathJoinSubstitution, +) +from launch_ros.actions import Node +from launch_ros.substitutions import FindPackageShare + + +def namespace_from_context(context, arm_prefix): + arm_prefix_str = context.perform_substitution(arm_prefix) + if arm_prefix_str: + return arm_prefix_str.strip('/') + return None + + +def generate_robot_description(context: LaunchContext, description_package, description_file, + arm_type, use_fake_hardware, right_can_interface, left_can_interface): + """Generate robot description using xacro processing.""" + + description_package_str = context.perform_substitution(description_package) + description_file_str = context.perform_substitution(description_file) + arm_type_str = context.perform_substitution(arm_type) + use_fake_hardware_str = context.perform_substitution(use_fake_hardware) + right_can_interface_str = context.perform_substitution(right_can_interface) + left_can_interface_str = context.perform_substitution(left_can_interface) + + xacro_path = os.path.join( + get_package_share_directory(description_package_str), + "urdf", "robot", description_file_str + ) + + # Process xacro with required arguments + robot_description = xacro.process_file( + xacro_path, + mappings={ + "arm_type": arm_type_str, + "bimanual": "true", + "use_fake_hardware": use_fake_hardware_str, + "ros2_control": "true", + "right_can_interface": right_can_interface_str, + "left_can_interface": left_can_interface_str, + } + ).toprettyxml(indent=" ") + + return robot_description + + +def robot_nodes_spawner(context: LaunchContext, description_package, description_file, + arm_type, use_fake_hardware, controllers_file, right_can_interface, left_can_interface, arm_prefix): + """Spawn both robot state publisher and control nodes with shared robot description.""" + namespace = namespace_from_context(context, arm_prefix) + + robot_description = generate_robot_description( + context, description_package, description_file, arm_type, use_fake_hardware, right_can_interface, left_can_interface, + ) + + controllers_file_str = context.perform_substitution(controllers_file) + robot_description_param = {"robot_description": robot_description} + + if namespace: + controllers_file_str = controllers_file_str.replace( + "openarm_v10_bimanual_controllers.yaml", "openarm_v10_bimanual_controllers_namespaced.yaml" + ) + robot_state_pub_node = Node( + package="robot_state_publisher", + executable="robot_state_publisher", + name="robot_state_publisher", + output="screen", + namespace=namespace, + parameters=[robot_description_param], + ) + + control_node = Node( + package="controller_manager", + executable="ros2_control_node", + output="both", + namespace=namespace, + parameters=[robot_description_param, controllers_file_str], + ) + + return [robot_state_pub_node, control_node] + + +def controller_spawner(context: LaunchContext, robot_controller, arm_prefix): + """Spawn controller based on robot_controller argument.""" + namespace = namespace_from_context(context, arm_prefix) + + controller_manager_ref = f"/{namespace}/controller_manager" if namespace else "/controller_manager" + + robot_controller_str = context.perform_substitution(robot_controller) + + if robot_controller_str == "forward_position_controller": + robot_controller_left = "left_forward_position_controller" + robot_controller_right = "right_forward_position_controller" + elif robot_controller_str == "joint_trajectory_controller": + robot_controller_left = "left_joint_trajectory_controller" + robot_controller_right = "right_joint_trajectory_controller" + else: + raise ValueError(f"Unknown robot_controller: {robot_controller_str}") + + robot_controller_spawner = Node( + package="controller_manager", + executable="spawner", + namespace=namespace, + arguments=[robot_controller_left, + robot_controller_right, "-c", controller_manager_ref], + ) + + return [robot_controller_spawner] + + +def generate_launch_description(): + """Generate launch description for OpenArm bimanual configuration.""" + + # Declare launch arguments + declared_arguments = [ + DeclareLaunchArgument( + "description_package", + default_value="openarm_description", + description="Description package with robot URDF/xacro files.", + ), + DeclareLaunchArgument( + "description_file", + default_value="v10.urdf.xacro", + description="URDF/XACRO description file with the robot.", + ), + DeclareLaunchArgument( + "arm_type", + default_value="v10", + description="Type of arm (e.g., v10).", + ), + DeclareLaunchArgument( + "use_fake_hardware", + default_value="false", + description="Use fake hardware instead of real hardware.", + ), + DeclareLaunchArgument( + "robot_controller", + default_value="joint_trajectory_controller", + choices=["forward_position_controller", + "joint_trajectory_controller"], + description="Robot controller to start.", + ), + DeclareLaunchArgument( + "runtime_config_package", + default_value="openarm_bringup", + description="Package with the controller's configuration in config folder.", + ), + DeclareLaunchArgument( + "arm_prefix", + default_value="", + description="Prefix for the arm for topic namespacing.", + ), + DeclareLaunchArgument( + "right_can_interface", + default_value="can0", + description="CAN interface to use for the right arm.", + ), + DeclareLaunchArgument( + "left_can_interface", + default_value="can1", + description="CAN interface to use for the left arm.", + ), + DeclareLaunchArgument( + "controllers_file", + default_value="openarm_v10_bimanual_controllers.yaml", + description="Controllers file(s) to use. Can be a single file or comma-separated list of files.", + ), + ] + + # Initialize launch configurations + description_package = LaunchConfiguration("description_package") + description_file = LaunchConfiguration("description_file") + arm_type = LaunchConfiguration("arm_type") + use_fake_hardware = LaunchConfiguration("use_fake_hardware") + robot_controller = LaunchConfiguration("robot_controller") + runtime_config_package = LaunchConfiguration("runtime_config_package") + controllers_file = LaunchConfiguration("controllers_file") + rightcan_interface = LaunchConfiguration("right_can_interface") + left_can_interface = LaunchConfiguration("left_can_interface") + arm_prefix = LaunchConfiguration("arm_prefix") + + controllers_file = PathJoinSubstitution( + [FindPackageShare(runtime_config_package), "config", + "v10_controllers", controllers_file] + ) + + robot_nodes_spawner_func = OpaqueFunction( + function=robot_nodes_spawner, + args=[description_package, description_file, arm_type, + use_fake_hardware, controllers_file, rightcan_interface, left_can_interface, arm_prefix] + ) + + rviz_config_file = PathJoinSubstitution( + [FindPackageShare(description_package), "rviz", + "bimanual.rviz"] + ) + + rviz_node = Node( + package="rviz2", + executable="rviz2", + name="rviz2", + output="log", + arguments=["-d", rviz_config_file], + ) + + # Joint state broadcaster spawner + joint_state_broadcaster_spawner = OpaqueFunction( + function=lambda context: [Node( + package="controller_manager", + executable="spawner", + namespace=namespace_from_context(context, arm_prefix), + arguments=["joint_state_broadcaster", + "--controller-manager", + f"/{namespace_from_context(context, arm_prefix)}/controller_manager" if namespace_from_context(context, arm_prefix) else "/controller_manager"], + )] + ) + + # Controller spawners + controller_spawner_func = OpaqueFunction( + function=controller_spawner, + args=[robot_controller, arm_prefix] + ) + + gripper_controller_spawner = OpaqueFunction( + function=lambda context: [Node( + package="controller_manager", + executable="spawner", + namespace=namespace_from_context(context, arm_prefix), + arguments=["left_gripper_controller", + "right_gripper_controller", "-c", + f"/{namespace_from_context(context, arm_prefix)}/controller_manager" if namespace_from_context(context, arm_prefix) else "/controller_manager"], + )] + ) + + # Timing and sequencing + LAUNCH_DELAY_SECONDS = 1.0 + delayed_joint_state_broadcaster = TimerAction( + period=LAUNCH_DELAY_SECONDS, + actions=[joint_state_broadcaster_spawner], + ) + + delayed_robot_controller = TimerAction( + period=LAUNCH_DELAY_SECONDS, + actions=[controller_spawner_func], + ) + delayed_gripper_controller = TimerAction( + period=LAUNCH_DELAY_SECONDS, + actions=[gripper_controller_spawner], + ) + + return LaunchDescription( + declared_arguments + [ + robot_nodes_spawner_func, + rviz_node, + ] + + [ + delayed_joint_state_broadcaster, + delayed_robot_controller, + delayed_gripper_controller, + ] + ) diff --git a/openarm_bringup/launch/openarm.launch.py b/openarm_bringup/launch/openarm.launch.py index 3a20d09..1c7a8b4 100644 --- a/openarm_bringup/launch/openarm.launch.py +++ b/openarm_bringup/launch/openarm.launch.py @@ -1,4 +1,4 @@ -# Copyright 2025 Reazon Holdings, Inc. +# Copyright 2025 Enactic, Inc. # Copyright 2024 Stogl Robotics Consulting UG (haftungsbeschränkt) # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -13,19 +13,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -# -# Source of this file are templates in -# [RosTeamWorkspace](https://github.com/StoglRobotics/ros_team_workspace) repository. -# -# Author: Dr. Denis -# +import os +import xacro -from launch import LaunchDescription -from launch.actions import DeclareLaunchArgument, RegisterEventHandler, TimerAction -from launch.event_handlers import OnProcessExit, OnProcessStart +from ament_index_python.packages import get_package_share_directory + +from launch import LaunchDescription, LaunchContext +from launch.actions import DeclareLaunchArgument, RegisterEventHandler, TimerAction, OpaqueFunction +from launch.event_handlers import OnProcessExit from launch.substitutions import ( - Command, - FindExecutable, LaunchConfiguration, PathJoinSubstitution, ) @@ -33,126 +29,155 @@ from launch_ros.substitutions import FindPackageShare -def generate_launch_description(): - # Declare arguments - declared_arguments = [] - declared_arguments.append( - DeclareLaunchArgument( - "runtime_config_package", - default_value="openarm_bringup", - description='Package with the controller\'s configuration in "config" folder. \ - Usually the argument is not set, it enables use of a custom setup.', - ) +def generate_robot_description(context: LaunchContext, description_package, description_file, + arm_type, use_fake_hardware, can_interface, arm_prefix): + """Generate robot description using xacro processing.""" + + # Substitute launch configuration values + description_package_str = context.perform_substitution(description_package) + description_file_str = context.perform_substitution(description_file) + arm_type_str = context.perform_substitution(arm_type) + use_fake_hardware_str = context.perform_substitution(use_fake_hardware) + can_interface_str = context.perform_substitution(can_interface) + arm_prefix_str = context.perform_substitution(arm_prefix) + + # Build xacro file path + xacro_path = os.path.join( + get_package_share_directory(description_package_str), + "urdf", "robot", description_file_str ) - declared_arguments.append( - DeclareLaunchArgument( - "controllers_file", - default_value="openarm_controllers.yaml", - description="YAML file with the controllers configuration.", - ) + + # Process xacro with required arguments + robot_description = xacro.process_file( + xacro_path, + mappings={ + "arm_type": arm_type_str, + "bimanual": "false", + "use_fake_hardware": use_fake_hardware_str, + "ros2_control": "true", + "can_interface": can_interface_str, + "arm_prefix": arm_prefix_str, + } + ).toprettyxml(indent=" ") + + return robot_description + + +def robot_nodes_spawner(context: LaunchContext, description_package, description_file, + arm_type, use_fake_hardware, controllers_file, can_interface, arm_prefix): + """Spawn both robot state publisher and control nodes with shared robot description.""" + + # Generate robot description once + robot_description = generate_robot_description( + context, description_package, description_file, arm_type, use_fake_hardware, can_interface, arm_prefix + ) + + # Get controllers file path + controllers_file_str = context.perform_substitution(controllers_file) + robot_description_param = {"robot_description": robot_description} + + # Robot state publisher node + robot_state_pub_node = Node( + package="robot_state_publisher", + executable="robot_state_publisher", + name="robot_state_publisher", + output="screen", + parameters=[robot_description_param], + ) + + # Control node + control_node = Node( + package="controller_manager", + executable="ros2_control_node", + output="both", + parameters=[robot_description_param, controllers_file_str], ) - declared_arguments.append( + + return [robot_state_pub_node, control_node] + + +def generate_launch_description(): + """Generate launch description for OpenArm unimanual configuration.""" + + # Declare launch arguments + declared_arguments = [ DeclareLaunchArgument( "description_package", default_value="openarm_description", - description="Description package with robot URDF/xacro files. Usually the argument \ - is not set, it enables use of a custom description.", - ) - ) - declared_arguments.append( + description="Description package with robot URDF/xacro files.", + ), DeclareLaunchArgument( "description_file", - default_value="openarm.urdf.xacro", + default_value="v10.urdf.xacro", description="URDF/XACRO description file with the robot.", - ) - ) - declared_arguments.append( + ), DeclareLaunchArgument( - "prefix", - default_value='""', - description="Prefix of the joint names, useful for \ - multi-robot setup. If changed than also joint names in the controllers' configuration \ - have to be updated.", - ) - ) - declared_arguments.append( + "arm_type", + default_value="v10", + description="Type of arm (e.g., v10).", + ), DeclareLaunchArgument( - "hardware_type", - default_value="real", - description="Hardware interface type: 'real', 'sim' (MuJoCo), or 'mock'", - ) - ) - declared_arguments.append( - DeclareLaunchArgument( - "mock_sensor_commands", + "use_fake_hardware", default_value="false", - description="Enable mock command interfaces for sensors used for simple simulations. \ - Used only if 'hardware_type' parameter is 'mock'.", - ) - ) - declared_arguments.append( + description="Use fake hardware instead of real hardware.", + ), DeclareLaunchArgument( "robot_controller", default_value="joint_trajectory_controller", choices=["forward_position_controller", "joint_trajectory_controller"], description="Robot controller to start.", - ) - ) + ), + DeclareLaunchArgument( + "runtime_config_package", + default_value="openarm_bringup", + description="Package with the controller's configuration in config folder.", + ), + DeclareLaunchArgument( + "arm_prefix", + default_value="", + description="Prefix for the arm.", + ), + DeclareLaunchArgument( + "can_interface", + default_value="can0", + description="CAN interface to use.", + ), + DeclareLaunchArgument( + "controllers_file", + default_value="openarm_v10_controllers.yaml", + description="Controllers file(s) to use. Can be a single file or comma-separated list of files.", + ), + ] - # Initialize Arguments - runtime_config_package = LaunchConfiguration("runtime_config_package") - controllers_file = LaunchConfiguration("controllers_file") + # Initialize launch configurations description_package = LaunchConfiguration("description_package") description_file = LaunchConfiguration("description_file") - prefix = LaunchConfiguration("prefix") - hardware_type = LaunchConfiguration("hardware_type") - mock_sensor_commands = LaunchConfiguration("mock_sensor_commands") + arm_type = LaunchConfiguration("arm_type") + use_fake_hardware = LaunchConfiguration("use_fake_hardware") robot_controller = LaunchConfiguration("robot_controller") - - # Get URDF via xacro - robot_description_content = Command( - [ - PathJoinSubstitution([FindExecutable(name="xacro")]), - " ", - PathJoinSubstitution( - [FindPackageShare(description_package), - "urdf", description_file] - ), - " ", - "prefix:=", - prefix, - " ", - "hardware_type:=", - hardware_type, - " ", - "mock_sensor_commands:=", - mock_sensor_commands, - " ", - ] + runtime_config_package = LaunchConfiguration("runtime_config_package") + controllers_file = LaunchConfiguration("controllers_file") + can_interface = LaunchConfiguration("can_interface") + arm_prefix = LaunchConfiguration("arm_prefix") + # Configuration file paths + controllers_file = PathJoinSubstitution( + [FindPackageShare(runtime_config_package), "config", + "v10_controllers", controllers_file] ) - robot_description = {"robot_description": robot_description_content} - - robot_controllers = PathJoinSubstitution( - [FindPackageShare(runtime_config_package), "config", controllers_file] + # Robot nodes spawner (both state publisher and control) + robot_nodes_spawner_func = OpaqueFunction( + function=robot_nodes_spawner, + args=[description_package, description_file, arm_type, + use_fake_hardware, controllers_file, can_interface, arm_prefix] ) + # RViz configuration rviz_config_file = PathJoinSubstitution( - [FindPackageShare(description_package), "rviz", "openarm.rviz"] + [FindPackageShare(description_package), "rviz", + "robot_description.rviz"] ) - control_node = Node( - package="controller_manager", - executable="ros2_control_node", - output="both", - parameters=[robot_description, robot_controllers], - ) - robot_state_pub_node = Node( - package="robot_state_publisher", - executable="robot_state_publisher", - output="both", - parameters=[robot_description], - ) rviz_node = Node( package="rviz2", executable="rviz2", @@ -161,94 +186,50 @@ def generate_launch_description(): arguments=["-d", rviz_config_file], ) + # Joint state broadcaster spawner joint_state_broadcaster_spawner = Node( package="controller_manager", executable="spawner", - arguments=[ - "joint_state_broadcaster", - "--controller-manager", - "/controller_manager", - ], + arguments=["joint_state_broadcaster", + "--controller-manager", "/controller_manager"], ) - robot_controller_names = [robot_controller] - robot_controller_spawners = [] - for controller in robot_controller_names: - robot_controller_spawners += [ - Node( - package="controller_manager", - executable="spawner", - arguments=[controller, "-c", "/controller_manager"], - ) - ] - - inactive_robot_controller_names = [] - inactive_robot_controller_spawners = [] - for controller in inactive_robot_controller_names: - inactive_robot_controller_spawners += [ - Node( - package="controller_manager", - executable="spawner", - arguments=[controller, "-c", - "/controller_manager", "--inactive"], - ) - ] + # Controller spawners + robot_controller_spawner = Node( + package="controller_manager", + executable="spawner", + arguments=[robot_controller, "-c", "/controller_manager"], + ) - # Delay loading and activation of `joint_state_broadcaster` after start of ros2_control_node - delay_joint_state_broadcaster_spawner_after_ros2_control_node = ( - RegisterEventHandler( - event_handler=OnProcessStart( - target_action=control_node, - on_start=[ - TimerAction( - period=3.0, - actions=[joint_state_broadcaster_spawner], - ), - ], - ) - ) + gripper_controller_spawner = Node( + package="controller_manager", + executable="spawner", + arguments=["gripper_controller", "-c", "/controller_manager"], ) - # Delay loading and activation of robot_controller_names after `joint_state_broadcaster` - delay_robot_controller_spawners_after_joint_state_broadcaster_spawner = [] - for i, controller in enumerate(robot_controller_spawners): - delay_robot_controller_spawners_after_joint_state_broadcaster_spawner += [ - RegisterEventHandler( - event_handler=OnProcessExit( - target_action=( - robot_controller_spawners[i - 1] - if i > 0 - else joint_state_broadcaster_spawner - ), - on_exit=[controller], - ) - ) - ] + # Timing and sequencing + delayed_joint_state_broadcaster = TimerAction( + period=1.0, + actions=[joint_state_broadcaster_spawner], + ) - # Delay start of inactive_robot_controller_names after other controllers - delay_inactive_robot_controller_spawners_after_joint_state_broadcaster_spawner = [] - for i, controller in enumerate(inactive_robot_controller_spawners): - delay_inactive_robot_controller_spawners_after_joint_state_broadcaster_spawner += [ - RegisterEventHandler( - event_handler=OnProcessExit( - target_action=( - inactive_robot_controller_spawners[i - 1] - if i > 0 - else robot_controller_spawners[-1] - ), - on_exit=[controller], - ) - ) - ] + delayed_robot_controller = TimerAction( + period=1.0, + actions=[robot_controller_spawner], + ) + delayed_gripper_controller = TimerAction( + period=1.0, + actions=[gripper_controller_spawner], + ) return LaunchDescription( - declared_arguments - + [ - control_node, - robot_state_pub_node, + declared_arguments + [ + robot_nodes_spawner_func, rviz_node, - delay_joint_state_broadcaster_spawner_after_ros2_control_node, + ] + + [ + delayed_joint_state_broadcaster, + delayed_robot_controller, + delayed_gripper_controller, ] - + delay_robot_controller_spawners_after_joint_state_broadcaster_spawner - + delay_inactive_robot_controller_spawners_after_joint_state_broadcaster_spawner ) diff --git a/openarm_bringup/launch/test_forward_position_controller.launch.py b/openarm_bringup/launch/test_forward_position_controller.launch.py deleted file mode 100644 index da1f888..0000000 --- a/openarm_bringup/launch/test_forward_position_controller.launch.py +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright 2025 Reazon Holdings, Inc. -# Copyright 2024 Stogl Robotics Consulting UG (haftungsbeschränkt) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# -# Source of this file are templates in -# [RosTeamWorkspace](https://github.com/StoglRobotics/ros_team_workspace) repository. -# -# Author: Dr. Denis -# - -from launch import LaunchDescription -from launch.substitutions import PathJoinSubstitution -from launch_ros.actions import Node -from launch_ros.substitutions import FindPackageShare - - -def generate_launch_description(): - position_goals = PathJoinSubstitution( - [ - FindPackageShare("openarm_bringup"), - "config", - "test_goal_publishers_config.yaml", - ] - ) - - return LaunchDescription( - [ - Node( - package="ros2_controllers_test_nodes", - executable="publisher_forward_position_controller", - name="publisher_forward_position_controller", - parameters=[position_goals], - output={ - "stdout": "screen", - "stderr": "screen", - }, - ) - ] - ) diff --git a/openarm_bringup/launch/test_joint_trajectory_controller.launch.py b/openarm_bringup/launch/test_joint_trajectory_controller.launch.py deleted file mode 100644 index 3e68ef2..0000000 --- a/openarm_bringup/launch/test_joint_trajectory_controller.launch.py +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright 2025 Reazon Holdings, Inc. -# Copyright 2024 Stogl Robotics Consulting UG (haftungsbeschränkt) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# -# Source of this file are templates in -# [RosTeamWorkspace](https://github.com/StoglRobotics/ros_team_workspace) repository. -# -# Author: Dr. Denis -# - -from launch import LaunchDescription -from launch.substitutions import PathJoinSubstitution -from launch_ros.actions import Node -from launch_ros.substitutions import FindPackageShare - - -def generate_launch_description(): - position_goals = PathJoinSubstitution( - [ - FindPackageShare("openarm_bringup"), - "config", - "test_goal_publishers_config.yaml", - ] - ) - - return LaunchDescription( - [ - Node( - package="ros2_controllers_test_nodes", - executable="publisher_joint_trajectory_controller", - name="publisher_joint_trajectory_controller", - parameters=[position_goals], - output={ - "stdout": "screen", - "stderr": "screen", - }, - ) - ] - ) diff --git a/openarm_bringup/package.xml b/openarm_bringup/package.xml index 7996765..e047aa3 100644 --- a/openarm_bringup/package.xml +++ b/openarm_bringup/package.xml @@ -1,7 +1,7 @@ openarm_bringup - 0.3.0 + 1.0.0 Bringup script for OpenArm Thomason Zhou Apache-2.0 diff --git a/openarm_bringup/rviz/bimanual.rviz b/openarm_bringup/rviz/bimanual.rviz new file mode 100644 index 0000000..e6ad21c --- /dev/null +++ b/openarm_bringup/rviz/bimanual.rviz @@ -0,0 +1,295 @@ +Panels: + - Class: rviz_common/Displays + Help Height: 138 + Name: Displays + Property Tree Widget: + Expanded: + - /Global Options1 + - /Status1 + - /RobotModel1 + Splitter Ratio: 0.5 + Tree Height: 685 + - Class: rviz_common/Selection + Name: Selection + - Class: rviz_common/Tool Properties + Expanded: + - /2D Goal Pose1 + - /Publish Point1 + Name: Tool Properties + Splitter Ratio: 0.5886790156364441 + - Class: rviz_common/Views + Expanded: + - /Current View1 + Name: Views + Splitter Ratio: 0.5 + - Class: rviz_common/Time + Experimental: false + Name: Time + SyncMode: 0 + SyncSource: "" +Visualization Manager: + Class: "" + Displays: + - Alpha: 0.5 + Cell Size: 1 + Class: rviz_default_plugins/Grid + Color: 160; 160; 164 + Enabled: true + Line Style: + Line Width: 0.029999999329447746 + Value: Lines + Name: Grid + Normal Cell Count: 0 + Offset: + X: 0 + Y: 0 + Z: 0 + Plane: XY + Plane Cell Count: 10 + Reference Frame: + Value: true + - Alpha: 1 + Class: rviz_default_plugins/RobotModel + Collision Enabled: false + Description File: "" + Description Source: Topic + Description Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /robot_description + Enabled: true + Links: + All Links Enabled: true + Expand Joint Details: false + Expand Link Details: false + Expand Tree: false + Link Tree Style: Links in Alphabetic Order + openarm_body_link0: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + openarm_left_hand: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + openarm_left_hand_tcp: + Alpha: 1 + Show Axes: false + Show Trail: false + openarm_left_left_finger: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + openarm_left_link0: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + openarm_left_link1: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + openarm_left_link2: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + openarm_left_link3: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + openarm_left_link4: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + openarm_left_link5: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + openarm_left_link6: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + openarm_left_link7: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + openarm_left_link8: + Alpha: 1 + Show Axes: false + Show Trail: false + openarm_left_right_finger: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + openarm_right_hand: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + openarm_right_hand_tcp: + Alpha: 1 + Show Axes: false + Show Trail: false + openarm_right_left_finger: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + openarm_right_link0: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + openarm_right_link1: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + openarm_right_link2: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + openarm_right_link3: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + openarm_right_link4: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + openarm_right_link5: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + openarm_right_link6: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + openarm_right_link7: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + openarm_right_link8: + Alpha: 1 + Show Axes: false + Show Trail: false + openarm_right_right_finger: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + world: + Alpha: 1 + Show Axes: false + Show Trail: false + Mass Properties: + Inertia: false + Mass: false + Name: RobotModel + TF Prefix: "" + Update Interval: 0 + Value: true + Visual Enabled: true + Enabled: true + Global Options: + Background Color: 48; 48; 48 + Fixed Frame: world + Frame Rate: 30 + Name: root + Tools: + - Class: rviz_default_plugins/Interact + Hide Inactive Objects: true + - Class: rviz_default_plugins/MoveCamera + - Class: rviz_default_plugins/Select + - Class: rviz_default_plugins/FocusCamera + - Class: rviz_default_plugins/Measure + Line color: 128; 128; 0 + - Class: rviz_default_plugins/SetInitialPose + Covariance x: 0.25 + Covariance y: 0.25 + Covariance yaw: 0.06853891909122467 + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /initialpose + - Class: rviz_default_plugins/SetGoal + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /goal_pose + - Class: rviz_default_plugins/PublishPoint + Single click: true + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /clicked_point + Transformation: + Current: + Class: rviz_default_plugins/TF + Value: true + Views: + Current: + Class: rviz_default_plugins/Orbit + Distance: 2.1203250885009766 + Enable Stereo Rendering: + Stereo Eye Separation: 0.05999999865889549 + Stereo Focal Distance: 1 + Swap Stereo Eyes: false + Value: false + Focal Point: + X: 0 + Y: 0 + Z: 0 + Focal Shape Fixed Size: true + Focal Shape Size: 0.05000000074505806 + Invert Z Axis: false + Name: Current View + Near Clip Distance: 0.009999999776482582 + Pitch: 0.410398006439209 + Target Frame: + Value: Orbit (rviz) + Yaw: 0.07539838552474976 + Saved: ~ +Window Geometry: + Displays: + collapsed: false + Height: 1162 + Hide Left Dock: false + Hide Right Dock: false + QMainWindow State: 000000ff00000000fd0000000400000000000001da0000039bfc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b000000ab00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c00610079007301000000690000039b0000017800fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000014d0000039bfc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a0056006900650077007301000000690000039b0000012300fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000081400000051fc0100000002fb0000000800540069006d00650100000000000008140000046000fffffffb0000000800540069006d00650100000000000004500000000000000000000004d50000039b00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + Selection: + collapsed: false + Time: + collapsed: false + Tool Properties: + collapsed: false + Views: + collapsed: false + Width: 2068 + X: 60 + Y: 64 diff --git a/openarm_bringup/utils/init_can.sh b/openarm_bringup/utils/init_can.sh deleted file mode 100755 index fc22b74..0000000 --- a/openarm_bringup/utils/init_can.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# -# Copyright 2025 Reazon Holdings, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# This script initializes the CAN interface on a Linux system. - -echo Using CAN interface: $1 with $2 - -if [ ! -e $1 ]; then - echo "Device $1 does not exist." - exit 1 -fi - -bitrate=1000000 -sudo slcand -o -c -s8 $1 -sudo ip link set $2 type can bitrate $bitrate -sudo ip link set $2 up -sudo ip link show $2 diff --git a/openarm_hardware/package.xml b/openarm_hardware/package.xml index 7faa56e..0d0f360 100644 --- a/openarm_hardware/package.xml +++ b/openarm_hardware/package.xml @@ -17,7 +17,7 @@ --> openarm_hardware - 0.3.0 + 1.0.0 Hardware interface for OpenArm Thomason Zhou Apache-2.0 From 9c1deb3c93b8519009f3f369845b18993985a177 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 23 Jul 2025 15:06:05 +0900 Subject: [PATCH 5/9] Add release CI jobs and scripts (#41) Fixes #40 --- .github/workflows/release.yaml | 52 ++++++++++++++++++++++++++++++++++ dev/README.md | 9 ++++++ dev/release.sh | 50 ++++++++++++++++++++++++++++++++ 3 files changed, 111 insertions(+) create mode 100644 .github/workflows/release.yaml create mode 100644 dev/README.md create mode 100755 dev/release.sh diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..84ee1d4 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,52 @@ +# Copyright 2025 Enactic, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Release +on: + push: + tags: + - '**' +jobs: + publish: + name: Publish + runs-on: ubuntu-latest + environment: release + permissions: + contents: write + discussions: write + steps: + - uses: actions/checkout@v4 + - name: Create source archive + run: | + git archive ${GITHUB_REF_NAME} \ + --prefix openarm-ros2-${GITHUB_REF_NAME}/ \ + --output openarm-ros2-${GITHUB_REF_NAME}.tar.gz + sha256sum \ + openarm-ros2-${GITHUB_REF_NAME}.tar.gz > \ + openarm-ros2-${GITHUB_REF_NAME}.tar.gz.sha256 + sha512sum \ + openarm-ros2-${GITHUB_REF_NAME}.tar.gz > \ + openarm-ros2-${GITHUB_REF_NAME}.tar.gz.sha512 + - name: Create GitHub Release + env: + GH_TOKEN: ${{ github.token }} + run: | + version=${GITHUB_REF_NAME} + gh release create ${GITHUB_REF_NAME} \ + --discussion-category Announcements \ + --generate-notes \ + --repo ${GITHUB_REPOSITORY} \ + --title "OpenArm ROS 2 ${version}" \ + --verify-tag \ + openarm-ros2-${GITHUB_REF_NAME}.tar.gz* diff --git a/dev/README.md b/dev/README.md new file mode 100644 index 0000000..1ebab5f --- /dev/null +++ b/dev/README.md @@ -0,0 +1,9 @@ +# Development + +## How to release + +```bash +git clone git@github.com:enactic/openarm_ros2.git +cd openarm_ros2 +dev/release.sh ${VERSION} # e.g. dev/release.sh 1.0.0 +``` diff --git a/dev/release.sh b/dev/release.sh new file mode 100755 index 0000000..e091364 --- /dev/null +++ b/dev/release.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# +# Copyright 2025 Enactic, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eu + +if [ $# -ne 1 ]; then + echo "Usage: $0 version" + echo " e.g.: $0 1.0.0" + exit 1 +fi + +version="$1" + +base_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +cd "${base_dir}" + +if [ "${RELEASE_CHECK_ORIGIN:-yes}" = "yes" ]; then + git_origin_url="$(git remote get-url origin)" + if [ "${git_origin_url}" != "git@github.com:enactic/openarm_ros2.git" ]; then + echo "This script must be run with working copy of enactic/openarm_ros2." + echo "The origin's URL: ${git_origin_url}" + exit 1 + fi +fi + +if [ "${RELEASE_PULL:-yes}" = "yes" ]; then + echo "Ensure using the latest commit" + git checkout main + git pull --ff-only +fi + +if [ "${RELEASE_TAG:-yes}" = "yes" ]; then + echo "Tag" + git tag -a -m "OpenArm ROS 2 ${version}" "${version}" + git push origin "${version}" +fi From c13caffff2ea2a14a762616c1f044441b4704de5 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 23 Jul 2025 15:07:41 +0900 Subject: [PATCH 6/9] Simplify README (#42) --- README.md | 111 ++++-------------------------------------------------- 1 file changed, 7 insertions(+), 104 deletions(-) diff --git a/README.md b/README.md index ae3716a..85dde10 100644 --- a/README.md +++ b/README.md @@ -1,106 +1,8 @@ -# ROS2 packages for OpenArm robots +# ROS 2 packages for OpenArm robots -

- - - - - - -

+ROS 2 (Robot Operating System 2) is a modern, open-source framework for building robotic software: https://www.ros.org/ -[Quickstart](#installation) - - -https://github.com/user-attachments/assets/90b44ef4-5cdc-4bf5-b56f-be2a5ff264b4 - - - -- openarm_bimanual_description: dual arm urdf with torso and realsense head camera -- openarm_bimanual_moveit_config: bimanual motion planning with OctoMap occupancy grid mapping -- openarm_bimanual_bringup: setup scripts for bimanual openarm -- openarm_bringup: setup scripts for single physical openarm -- openarm_description: single arm urdf -- openarm_hardware: hardware interface for ros2_control -- openarm_moveit_config: motion planning with [moveit2](https://github.com/moveit/moveit2) - - -### Description Packages - -Each link has a visual mesh and a collision mesh, as shown in the figures below: - -visual meshes of openarm_bimanual_description urdf in rviz2 -collision meshes of openarm_bimanual_description urdf in rviz2 - -### MoveIt2 Support - -https://github.com/user-attachments/assets/a0f962e5-6150-49ce-b18e-9914bcb322ef - ---- - -## Installation - -1. [Install ROS2 and ros-dev-tools](https://docs.ros.org/en/humble/Installation.html) (tested on Humble with Ubuntu 22.04) -2. [Create a ROS2 workspace and source the overlay](https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Creating-A-Workspace/Creating-A-Workspace.html) - -```sh -source /opt/ros/humble/setup.bash # Change "humble" to your ROS 2 distro, ie: - # source /opt/ros/jazzy/setup.bash -mkdir -p ~/ros2_ws/src -cd ~/ros2_ws/src -git clone https://github.com/enactic/openarm_ros2.git -``` - -3. [Install dependencies with rosdep](https://docs.ros.org/en/humble/Tutorials/Intermediate/Rosdep.html) and [build the packages with colcon](https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Colcon-Tutorial.html) - -```sh -cd ~/ros2_ws -sudo rosdep init -rosdep update -rosdep install --from-paths src -y --ignore-src -r - -sudo apt install -y python3-colcon-common-extensions - -#⚠️ If you're using ROS2 Iron or Jazzy, apply the patch below before building: - -colcon build -``` - -4. *In a new terminal*, source the workspace setup script - -```sh -cd ~/ros2_ws -source install/setup.bash -``` - -5. Test the installation by launching a demo. It may be necessary to restart your computer once. - -```sh -ros2 launch openarm_bimanual_moveit_config demo.launch.py -``` - - -## ROS2 Jazzy patch - -Edit the test source file: -```sh -nano ~/ros2_ws/src/openarm_ros2/openarm_hardware/test/test_openarm_hardware.cpp -``` -Find the line near the bottom: -```sh - ASSERT_NO_THROW(hardware_interface::ResourceManager rm(urdf)); -``` -Replace it with: -```sh - ASSERT_NO_THROW({ - auto logger = rclcpp::get_logger("test_logger"); - auto clock = std::make_shared(RCL_ROS_TIME); - hardware_interface::ResourceManager rm(urdf, clock, logger, true, 0); - }); -``` -Continue with the build. - ---- +This repository provides ROS 2 integration packages. See the [documentation](https://docs.openarm.dev/software/ros2/install) for details. ## Related links @@ -110,9 +12,10 @@ Continue with the build. ## License -All packages of `openarm_ros2` are licensed under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). +[Apache License 2.0](LICENSE) + +Copyright 2025 Enactic, Inc. ## Code of Conduct -All participation in the ROS2 packages for OpenArm project is governed by our -[Code of Conduct](CODE_OF_CONDUCT.md). +All participation in the OpenArm project is governed by our [Code of Conduct](CODE_OF_CONDUCT.md). From 110fd278ffc278cabefb1531a781fa4a45624288 Mon Sep 17 00:00:00 2001 From: Yue Yin Date: Wed, 23 Jul 2025 16:08:34 +0900 Subject: [PATCH 7/9] Update hardware interface (#43) - Minimal working hardware plugin with v1.0 openarmcan. - gripper logic unimplemented --- openarm_hardware/CMakeLists.txt | 38 +- .../include/openarm_hardware/canbus.hpp | 48 -- .../include/openarm_hardware/motor.hpp | 156 ------ .../openarm_hardware/motor_control.hpp | 87 ---- .../openarm_hardware/openarm_hardware.hpp | 110 ---- .../openarm_hardware/v10_simple_hardware.hpp | 138 +++++ openarm_hardware/openarm_hardware.xml | 6 +- openarm_hardware/package.xml | 4 +- openarm_hardware/setup.bash | 34 -- openarm_hardware/src/canbus.cpp | 131 ----- openarm_hardware/src/motor.cpp | 152 ------ openarm_hardware/src/motor_control.cpp | 472 ------------------ openarm_hardware/src/openarm_hardware.cpp | 257 ---------- openarm_hardware/src/v10_simple_hardware.cpp | 322 ++++++++++++ .../test/test_openarm_hardware.cpp | 128 ----- 15 files changed, 474 insertions(+), 1609 deletions(-) delete mode 100644 openarm_hardware/include/openarm_hardware/canbus.hpp delete mode 100644 openarm_hardware/include/openarm_hardware/motor.hpp delete mode 100644 openarm_hardware/include/openarm_hardware/motor_control.hpp delete mode 100644 openarm_hardware/include/openarm_hardware/openarm_hardware.hpp create mode 100644 openarm_hardware/include/openarm_hardware/v10_simple_hardware.hpp delete mode 100755 openarm_hardware/setup.bash delete mode 100644 openarm_hardware/src/canbus.cpp delete mode 100644 openarm_hardware/src/motor.cpp delete mode 100644 openarm_hardware/src/motor_control.cpp delete mode 100644 openarm_hardware/src/openarm_hardware.cpp create mode 100644 openarm_hardware/src/v10_simple_hardware.cpp delete mode 100644 openarm_hardware/test/test_openarm_hardware.cpp diff --git a/openarm_hardware/CMakeLists.txt b/openarm_hardware/CMakeLists.txt index af0ab4d..a76fb3e 100644 --- a/openarm_hardware/CMakeLists.txt +++ b/openarm_hardware/CMakeLists.txt @@ -27,11 +27,11 @@ find_package(pluginlib REQUIRED) find_package(rclcpp REQUIRED) find_package(rclcpp_lifecycle REQUIRED) +# Find openarm_can library +find_package(OpenArmCAN REQUIRED) + add_library(${PROJECT_NAME} SHARED - src/openarm_hardware.cpp - src/canbus.cpp - src/motor.cpp - src/motor_control.cpp + src/v10_simple_hardware.cpp ) target_include_directories( @@ -40,6 +40,10 @@ target_include_directories( include ) +target_link_libraries(${PROJECT_NAME} + OpenArmCAN::openarm_can +) + ament_target_dependencies(${PROJECT_NAME} hardware_interface pluginlib @@ -53,35 +57,11 @@ install( TARGETS ${PROJECT_NAME} DESTINATION lib ) - + install(DIRECTORY include/ DESTINATION include ) - -if(BUILD_TESTING) - find_package(ament_lint_auto REQUIRED) - find_package(ament_cmake_gmock REQUIRED) - find_package(hardware_interface REQUIRED) - find_package(ros2_control_test_assets REQUIRED) - - ament_add_gmock(test_openarm_hardware - test/test_openarm_hardware.cpp - ) - target_link_libraries(test_openarm_hardware - ${PROJECT_NAME} - ) - ament_target_dependencies(test_openarm_hardware - hardware_interface - ros2_control_test_assets - ) - - set(ament_cmake_copyright_FOUND TRUE) - set(ament_cmake_cpplint_FOUND TRUE) - ament_lint_auto_find_test_dependencies() -endif() - - ament_export_include_directories( include ) diff --git a/openarm_hardware/include/openarm_hardware/canbus.hpp b/openarm_hardware/include/openarm_hardware/canbus.hpp deleted file mode 100644 index dfa42a7..0000000 --- a/openarm_hardware/include/openarm_hardware/canbus.hpp +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2025 Reazon Holdings, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#pragma once - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -enum CANMode { CAN_MODE_CLASSIC = 0, CAN_MODE_FD = 1 }; -class CANBus { - public: - explicit CANBus(const std::string& interface, int mode); - ~CANBus(); - int whichCAN(); - bool send(uint16_t motor_id, const std::array& data); - std::array recv(uint16_t& out_id, uint8_t& out_len); - - private: - bool sendClassic(uint16_t motor_id, const std::array& data); - bool sendFD(uint16_t motor_id, const std::array& data); - - struct can_frame recvClassic(); - struct canfd_frame recvFD(); - - int sock_; - int mode_; -}; diff --git a/openarm_hardware/include/openarm_hardware/motor.hpp b/openarm_hardware/include/openarm_hardware/motor.hpp deleted file mode 100644 index e006ee2..0000000 --- a/openarm_hardware/include/openarm_hardware/motor.hpp +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright 2025 Reazon Holdings, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#pragma once - -#include - -#include -#include -#include -#include -#include -#include -#include - -enum class DM_Motor_Type : uint8_t { - DM4310 = 0, - DM4310_48V, - DM4340, - DM4340_48V, - DM6006, - DM8006, - DM8009, - DM10010L, - DM10010, - DMH3510, - DMH6215, - DMG6220, - COUNT -}; - -enum class DM_variable : uint8_t { - UV_Value = 0, - KT_Value, - OT_Value, - OC_Value, - ACC, - DEC, - MAX_SPD, - MST_ID, - ESC_ID, - TIMEOUT, - CTRL_MODE, - Damp, - Inertia, - hw_ver, - sw_ver, - SN, - NPP, - Rs, - LS, - Flux, - Gr, - PMAX, - VMAX, - TMAX, - I_BW, - KP_ASR, - KI_ASR, - KP_APR, - KI_APR, - OV_Value, - GREF, - Deta, - V_BW, - IQ_c1, - VL_c1, - can_br, - sub_ver, - u_off = 50, - v_off, - k1, - k2, - m_off, - dir, - p_m = 80, - xout, - COUNT -}; - -enum class Control_Type : uint8_t { MIT = 1, POS_VEL, VEL, Torque_Pos, COUNT }; - -class Motor { - public: - Motor() = default; - Motor(DM_Motor_Type motorType, uint16_t slaveID, uint16_t masterID); - - void recv_data(double q, double dq, double tau, int tmos, int trotor); - double getPosition() const; - double getVelocity() const; - double getTorque() const; - int getParam(int RID) const; - void setTempParam(int RID, int val); - uint16_t SlaveID; - uint16_t MasterID; - bool isEnable; - Control_Type NowControlMode; - DM_Motor_Type MotorType; - - int getStateTmos() const; - int getStateTrotor() const; - double getGoalPosition() const; - double getGoalVelocity() const; - double getGoalTau() const; - - void setGoalPosition(double pos); - void setGoalVelocity(double vel); - void setGoalTau(double tau); - void setStateTmos(int tmos); - void setStateTrotor(int trotor); - - private: - double Pd, Vd; - double goal_position, goal_velocity, goal_tau; - double state_q, state_dq, state_tau; - int state_tmos, state_trotor; - std::map temp_param_dict; -}; - -double LIMIT_MIN_MAX(double x, double min, double max); - -uint16_t double_to_uint(double x, double x_min, double x_max, int bits); - -double uint_to_double(uint16_t x, double min, double max, int bits); - -std::array double_to_uint8s(double value); - -std::array float_to_uint8s(float value); - -float uint8s_to_float(const std::array& bytes); - -std::array data_to_uint8s(uint32_t value); - -uint32_t uint8s_to_uint32(uint8_t byte1, uint8_t byte2, uint8_t byte3, - uint8_t byte4); - -double uint8s_to_double(uint8_t byte1, uint8_t byte2, uint8_t byte3, - uint8_t byte4); - -bool is_in_ranges(int number); - -void print_hex(const std::vector& data); - -template -T get_enum_by_index(int index); diff --git a/openarm_hardware/include/openarm_hardware/motor_control.hpp b/openarm_hardware/include/openarm_hardware/motor_control.hpp deleted file mode 100644 index 57660a8..0000000 --- a/openarm_hardware/include/openarm_hardware/motor_control.hpp +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2025 Reazon Holdings, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#pragma once - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "canbus.hpp" -#include "motor.hpp" - -class MotorControl { - public: - explicit MotorControl(CANBus& canbus); - bool addMotor(Motor& motor); - void enable(Motor& motor); - void disable(Motor& motor); - void set_zero_position(Motor& motor); - void controlMIT(Motor& motor, double kp, double kd, double q, double dq, - double tau); - void controlMIT2(Motor& motor, double kp, double kd, double q, double dq, - double tau); - void sendData(uint16_t motor_id, const std::array& data); - void recv(); - - void control_delay(Motor& motor, double kp, double kd, double q, double dq, - double tau, double delay); - void controlPosVel(Motor& motor, double q, double dq); - void controlPosVel2(Motor& motor, double q, double dq); - void controlVel(Motor& motor, double dq); - void controlVel2(Motor& motor, double dq); - void controlPosForce(Motor& motor, double q, double vel, double tau); - void controlPosForce2(Motor& motor, double q, double vel, double tau); - - bool switchControlMode(Motor& motor, Control_Type controlMode); - void save_motor_param(Motor& motor); - void change_limit_param(); - // void change_limit_param(DM_Motor_Type motor_type, double PMAX, double VMAX, - // double TMAX); - - void recv_set_param_data(); - - private: - CANBus& canbus_; - - std::map motors_map_; - static constexpr double Limit_Param[12][3] = { - {12.5, 30, 10}, // DM4310 - {12.5, 50, 10}, // DM4310_48V - {12.5, 8, 28}, // DM4340 - {12.5, 10, 28}, // DM4340_48V - {12.5, 45, 20}, // DM6006 - {12.5, 45, 40}, // DM8006 - {12.5, 45, 54}, // DM8009 - {12.5, 25, 200}, // DM10010L - {12.5, 20, 200}, // DM10010 - {12.5, 280, 1}, // DMH3510 - {12.5, 45, 10}, // DMH6215 - {12.5, 45, 10}, // DMG6220 - }; - - void processPacket(const can_frame& frame); - void processPacketFD(const canfd_frame& frame); - void controlCmd(Motor& motor, uint8_t cmd); - void readRIDParam(Motor& motor, DM_variable RID); - void writeMotorParam(Motor& motor, DM_variable RID, double value); -}; diff --git a/openarm_hardware/include/openarm_hardware/openarm_hardware.hpp b/openarm_hardware/include/openarm_hardware/openarm_hardware.hpp deleted file mode 100644 index 6ae13aa..0000000 --- a/openarm_hardware/include/openarm_hardware/openarm_hardware.hpp +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2025 Reazon Holdings, Inc. -// Copyright 2025 Stogl Robotics Consulting UG (haftungsbeschränkt) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#pragma once - -#include -#include -#include - -#include "canbus.hpp" -#include "hardware_interface/handle.hpp" -#include "hardware_interface/hardware_info.hpp" -#include "hardware_interface/system_interface.hpp" -#include "hardware_interface/types/hardware_interface_return_values.hpp" -#include "motor.hpp" -#include "motor_control.hpp" -#include "openarm_hardware/visibility_control.h" -#include "rclcpp/macros.hpp" -#include "rclcpp_lifecycle/state.hpp" - -namespace openarm_hardware { - -std::vector motor_types{ - DM_Motor_Type::DM4340, DM_Motor_Type::DM4340, DM_Motor_Type::DM4340, - DM_Motor_Type::DM4340, DM_Motor_Type::DM4310, DM_Motor_Type::DM4310, - DM_Motor_Type::DM4310}; -std::vector can_device_ids{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}; -std::vector can_master_ids{0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17}; -static const Control_Type CONTROL_MODE = Control_Type::MIT; -static const std::size_t ARM_DOF = 7; -static const std::size_t GRIPPER_DOF = 1; -static const std::size_t TOTAL_DOF = ARM_DOF + GRIPPER_DOF; -static const std::array KP = {80.0, 80.0, 20.0, 55.0, - 5.0, 5.0, 5.0, 0.5}; -static const std::array KD = {2.75, 2.5, 0.7, 0.4, - 0.7, 0.6, 0.5, 0.1}; -static const double START_POS_TOLERANCE_RAD = 0.1; -static const double POS_JUMP_TOLERANCE_RAD = 3.1415 / 16.0; - -static const bool USING_GRIPPER = true; -static const double GRIPPER_REFERENCE_GEAR_RADIUS_M = 0.00853; -static const double GRIPPER_GEAR_DIRECTION_MULTIPLIER = -1.0; -static const int GRIPPER_INDEX = TOTAL_DOF - 1; - -class OpenArmHW : public hardware_interface::SystemInterface { - public: - OpenArmHW(); - - TEMPLATES__ROS2_CONTROL__VISIBILITY_PUBLIC - hardware_interface::CallbackReturn on_init( - const hardware_interface::HardwareInfo& info) override; - - TEMPLATES__ROS2_CONTROL__VISIBILITY_PUBLIC - hardware_interface::CallbackReturn on_configure( - const rclcpp_lifecycle::State& previous_state) override; - - TEMPLATES__ROS2_CONTROL__VISIBILITY_PUBLIC - std::vector export_state_interfaces() - override; - - TEMPLATES__ROS2_CONTROL__VISIBILITY_PUBLIC - std::vector export_command_interfaces() - override; - - TEMPLATES__ROS2_CONTROL__VISIBILITY_PUBLIC - hardware_interface::CallbackReturn on_activate( - const rclcpp_lifecycle::State& previous_state) override; - - TEMPLATES__ROS2_CONTROL__VISIBILITY_PUBLIC - hardware_interface::CallbackReturn on_deactivate( - const rclcpp_lifecycle::State& previous_state) override; - - TEMPLATES__ROS2_CONTROL__VISIBILITY_PUBLIC - hardware_interface::return_type read(const rclcpp::Time& time, - const rclcpp::Duration& period) override; - - TEMPLATES__ROS2_CONTROL__VISIBILITY_PUBLIC - hardware_interface::return_type write( - const rclcpp::Time& time, const rclcpp::Duration& period) override; - - std::size_t curr_dof = ARM_DOF; // minus gripper - private: - std::string prefix_; - std::unique_ptr canbus_; - std::unique_ptr motor_control_; - std::vector pos_commands_; - std::vector pos_states_; - std::vector vel_commands_; - std::vector vel_states_; - std::vector tau_ff_commands_; - std::vector tau_states_; - std::vector> motors_; - - void refresh_motors(); - bool disable_torque_; -}; - -} // namespace openarm_hardware diff --git a/openarm_hardware/include/openarm_hardware/v10_simple_hardware.hpp b/openarm_hardware/include/openarm_hardware/v10_simple_hardware.hpp new file mode 100644 index 0000000..758944b --- /dev/null +++ b/openarm_hardware/include/openarm_hardware/v10_simple_hardware.hpp @@ -0,0 +1,138 @@ +// Copyright 2025 Reazon Holdings, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include +#include +#include + +#include "hardware_interface/handle.hpp" +#include "hardware_interface/hardware_info.hpp" +#include "hardware_interface/system_interface.hpp" +#include "hardware_interface/types/hardware_interface_return_values.hpp" +#include "openarm_hardware/visibility_control.h" +#include "rclcpp/macros.hpp" +#include "rclcpp_lifecycle/state.hpp" + +namespace openarm_hardware { + +/** + * @brief Simplified OpenArm V10 Hardware Interface + * + * This is a simplified version that uses the OpenArm CAN API directly, + * following the pattern from full_arm.cpp example. Much simpler than + * the original implementation. + */ +class OpenArm_v10HW : public hardware_interface::SystemInterface { + public: + OpenArm_v10HW(); + + TEMPLATES__ROS2_CONTROL__VISIBILITY_PUBLIC + hardware_interface::CallbackReturn on_init( + const hardware_interface::HardwareInfo& info) override; + + TEMPLATES__ROS2_CONTROL__VISIBILITY_PUBLIC + hardware_interface::CallbackReturn on_configure( + const rclcpp_lifecycle::State& previous_state) override; + + TEMPLATES__ROS2_CONTROL__VISIBILITY_PUBLIC + std::vector export_state_interfaces() + override; + + TEMPLATES__ROS2_CONTROL__VISIBILITY_PUBLIC + std::vector export_command_interfaces() + override; + + TEMPLATES__ROS2_CONTROL__VISIBILITY_PUBLIC + hardware_interface::CallbackReturn on_activate( + const rclcpp_lifecycle::State& previous_state) override; + + TEMPLATES__ROS2_CONTROL__VISIBILITY_PUBLIC + hardware_interface::CallbackReturn on_deactivate( + const rclcpp_lifecycle::State& previous_state) override; + + TEMPLATES__ROS2_CONTROL__VISIBILITY_PUBLIC + hardware_interface::return_type read(const rclcpp::Time& time, + const rclcpp::Duration& period) override; + + TEMPLATES__ROS2_CONTROL__VISIBILITY_PUBLIC + hardware_interface::return_type write( + const rclcpp::Time& time, const rclcpp::Duration& period) override; + + private: + // V10 default configuration + static constexpr size_t ARM_DOF = 7; + static constexpr bool ENABLE_GRIPPER = true; + + // Default motor configuration for V10 + const std::vector DEFAULT_MOTOR_TYPES = { + openarm::damiao_motor::MotorType::DM8009, // Joint 1 + openarm::damiao_motor::MotorType::DM8009, // Joint 2 + openarm::damiao_motor::MotorType::DM4340, // Joint 3 + openarm::damiao_motor::MotorType::DM4340, // Joint 4 + openarm::damiao_motor::MotorType::DM4310, // Joint 5 + openarm::damiao_motor::MotorType::DM4310, // Joint 6 + openarm::damiao_motor::MotorType::DM4310 // Joint 7 + }; + + const std::vector DEFAULT_SEND_CAN_IDS = {0x01, 0x02, 0x03, 0x04, + 0x05, 0x06, 0x07}; + const std::vector DEFAULT_RECV_CAN_IDS = {0x11, 0x12, 0x13, 0x14, + 0x15, 0x16, 0x17}; + + const openarm::damiao_motor::MotorType DEFAULT_GRIPPER_MOTOR_TYPE = + openarm::damiao_motor::MotorType::DM4310; + const uint32_t DEFAULT_GRIPPER_SEND_CAN_ID = 0x08; + const uint32_t DEFAULT_GRIPPER_RECV_CAN_ID = 0x18; + + // Default gains + const std::vector DEFAULT_KP = {80.0, 80.0, 20.0, 55.0, + 5.0, 5.0, 5.0, 0.5}; + const std::vector DEFAULT_KD = {2.75, 2.5, 0.7, 0.4, + 0.7, 0.6, 0.5, 0.1}; + + // Configuration + std::string can_interface_; + std::string arm_prefix_; + bool hand_; + bool can_fd_; + + // OpenArm instance + std::unique_ptr openarm_; + + // Generated joint names for this arm instance + std::vector joint_names_; + + // ROS2 control state and command vectors + std::vector pos_commands_; + std::vector vel_commands_; + std::vector tau_commands_; + std::vector pos_states_; + std::vector vel_states_; + std::vector tau_states_; + + // Helper methods + void return_to_zero(); + bool parse_config(const hardware_interface::HardwareInfo& info); + void generate_joint_names(); + + // Gripper mapping functions + double joint_to_motor_radians(double joint_value); + double motor_radians_to_joint(double motor_radians); +}; + +} // namespace openarm_hardware \ No newline at end of file diff --git a/openarm_hardware/openarm_hardware.xml b/openarm_hardware/openarm_hardware.xml index 72a8735..07d564b 100644 --- a/openarm_hardware/openarm_hardware.xml +++ b/openarm_hardware/openarm_hardware.xml @@ -15,11 +15,11 @@ --> - - ros2_control hardware interface. + ros2_control hardware interface for OpenArm V10. diff --git a/openarm_hardware/package.xml b/openarm_hardware/package.xml index 0d0f360..d174f95 100644 --- a/openarm_hardware/package.xml +++ b/openarm_hardware/package.xml @@ -17,9 +17,9 @@ --> openarm_hardware - 1.0.0 + 0.3.0 Hardware interface for OpenArm - Thomason Zhou + Enactic, Inc. Apache-2.0 ament_cmake diff --git a/openarm_hardware/setup.bash b/openarm_hardware/setup.bash deleted file mode 100755 index f6c4d0f..0000000 --- a/openarm_hardware/setup.bash +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# -# Copyright 2025 Reazon Holdings, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -CAN_INTERFACE=can0 - -for DEVICE in /dev/ttyACM*; do - if [ -e "$DEVICE" ]; then - echo "Using device: $DEVICE" - break - fi -done - -if [ -z "$DEVICE" ]; then - echo "No /dev/ttyACM* device found." - exit 1 -fi - -sudo pkill -f slcand -sudo slcand -o -c -s8 "$DEVICE" "$CAN_INTERFACE" -sudo ip link set "$CAN_INTERFACE" up type can bitrate 1000000 -ip link show "$CAN_INTERFACE" diff --git a/openarm_hardware/src/canbus.cpp b/openarm_hardware/src/canbus.cpp deleted file mode 100644 index a49d2b5..0000000 --- a/openarm_hardware/src/canbus.cpp +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright 2025 Reazon Holdings, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "openarm_hardware/canbus.hpp" - -CANBus::CANBus(const std::string& interface, int mode) : mode_(mode) { - struct ifreq ifr; - struct sockaddr_can addr; - - sock_ = socket(PF_CAN, SOCK_RAW, CAN_RAW); - if (sock_ < 0) { - perror("Error while opening CAN socket"); - exit(EXIT_FAILURE); - } - - std::strncpy(ifr.ifr_name, interface.c_str(), IFNAMSIZ); - if (ioctl(sock_, SIOCGIFINDEX, &ifr) < 0) { - perror("Error getting interface index"); - exit(EXIT_FAILURE); - } - - std::memset(&addr, 0, sizeof(addr)); - addr.can_family = AF_CAN; - addr.can_ifindex = ifr.ifr_ifindex; - - if (mode_ == CAN_MODE_FD) { - int enable_canfd = 1; - if (setsockopt(sock_, SOL_CAN_RAW, CAN_RAW_FD_FRAMES, &enable_canfd, - sizeof(enable_canfd)) < 0) { - perror("CAN FD setsockopt failed"); - exit(EXIT_FAILURE); - } - } - - if (bind(sock_, (struct sockaddr*)&addr, sizeof(addr)) < 0) { - perror("Error in CAN socket bind"); - exit(EXIT_FAILURE); - } -} - -CANBus::~CANBus() { close(sock_); } - -int CANBus::whichCAN() { return mode_; } - -bool CANBus::send(uint16_t motor_id, const std::array& data) { - if (mode_ == CAN_MODE_FD) - return sendFD(motor_id, data); - else - return sendClassic(motor_id, data); -} - -std::array CANBus::recv(uint16_t& out_id, uint8_t& out_len) { - std::array buffer = {}; - if (mode_ == CAN_MODE_FD) { - auto frame = recvFD(); - out_id = frame.can_id; - out_len = frame.len; - std::copy(frame.data, frame.data + frame.len, buffer.begin()); - } else { - auto frame = recvClassic(); - out_id = frame.can_id; - out_len = frame.can_dlc; - std::copy(frame.data, frame.data + frame.can_dlc, buffer.begin()); - } - return buffer; -} - -bool CANBus::sendClassic(uint16_t motor_id, - const std::array& data) { - struct can_frame frame; - std::memset(&frame, 0, sizeof(frame)); - - frame.can_id = motor_id; - frame.can_dlc = data.size(); - std::copy(data.begin(), data.end(), frame.data); - - if (write(sock_, &frame, sizeof(frame)) != sizeof(frame)) { - perror("Error sending CAN frame"); - return false; - } - return true; -} - -bool CANBus::sendFD(uint16_t motor_id, const std::array& data) { - struct canfd_frame frame; - std::memset(&frame, 0, sizeof(frame)); - - frame.can_id = motor_id; - frame.len = data.size(); - frame.flags = CANFD_BRS; - std::copy(data.begin(), data.end(), frame.data); - - if (write(sock_, &frame, sizeof(frame)) != sizeof(frame)) { - perror("Error sending CAN FD frame"); - return false; - } - return true; -} - -struct can_frame CANBus::recvClassic() { - struct can_frame frame; - std::memset(&frame, 0, sizeof(frame)); - - int nbytes = read(sock_, &frame, sizeof(struct can_frame)); - if (nbytes < 0) { - perror("CAN read error"); - } - return frame; -} - -struct canfd_frame CANBus::recvFD() { - struct canfd_frame frame; - std::memset(&frame, 0, sizeof(frame)); - - int nbytes = read(sock_, &frame, sizeof(struct canfd_frame)); - if (nbytes < 0) { - perror("CAN FD read error"); - } - return frame; -} diff --git a/openarm_hardware/src/motor.cpp b/openarm_hardware/src/motor.cpp deleted file mode 100644 index 06069ba..0000000 --- a/openarm_hardware/src/motor.cpp +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright 2025 Reazon Holdings, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef OPENARM_MOTOR_H_ -#define OPENARM_MOTOR_H_ - -#include "openarm_hardware/motor.hpp" - -Motor::Motor(DM_Motor_Type motorType, uint16_t slaveID, uint16_t masterID) - : MotorType(motorType), - SlaveID(slaveID), - MasterID(masterID), - Pd(0.0), - Vd(0.0), - goal_position(0.0), - goal_tau(0.0), - state_q(0.0), - state_dq(0.0), - state_tau(0.0), - state_tmos(0), - state_trotor(0), - isEnable(false), - NowControlMode(Control_Type::MIT) {} - -void Motor::recv_data(double q, double dq, double tau, int tmos, int trotor) { - state_q = q; - state_dq = dq; - state_tau = tau; - state_tmos = tmos; - state_trotor = trotor; -} - -double Motor::getPosition() const { return state_q; } -double Motor::getVelocity() const { return state_dq; } -double Motor::getTorque() const { return state_tau; } - -double Motor::getGoalPosition() const { return goal_position; } - -void Motor::setGoalPosition(double pos) { goal_position = pos; } - -double Motor::getGoalVelocity() const { return goal_velocity; } - -void Motor::setGoalVelocity(double velocity) { goal_velocity = velocity; } - -double Motor::getGoalTau() const { return goal_tau; } - -void Motor::setGoalTau(double tau) { goal_tau = tau; } - -int Motor::getStateTmos() const { return state_tmos; } - -void Motor::setStateTmos(int tmos) { state_tmos = tmos; } - -int Motor::getStateTrotor() const { return state_trotor; } - -void Motor::setStateTrotor(int trotor) { state_trotor = trotor; } - -int Motor::getParam(int RID) const { - auto it = temp_param_dict.find(RID); - return (it != temp_param_dict.end()) ? it->second : -1; -} - -void Motor::setTempParam(int RID, int value) { temp_param_dict[RID] = value; } - -double LIMIT_MIN_MAX(double x, double min, double max) { - return std::max(min, std::min(x, max)); -} - -uint16_t double_to_uint(double x, double x_min, double x_max, int bits) { - x = LIMIT_MIN_MAX(x, x_min, x_max); - double span = x_max - x_min; - double data_norm = (x - x_min) / span; - return static_cast(data_norm * ((1 << bits) - 1)); -} - -double uint_to_double(uint16_t x, double min, double max, int bits) { - double span = max - min; - double data_norm = static_cast(x) / ((1 << bits) - 1); - return data_norm * span + min; -} - -std::array double_to_uint8s(double value) { - std::array bytes; - std::memcpy(bytes.data(), &value, sizeof(double)); - return bytes; -} - -std::array float_to_uint8s(float value) { - std::array bytes{}; - std::memcpy(bytes.data(), &value, sizeof(float)); - return bytes; -} - -float uint8s_to_float(const std::array& bytes) { - float value; - std::memcpy(&value, bytes.data(), sizeof(float)); - return value; -} - -std::array data_to_uint8s(uint32_t value) { - std::array bytes; - std::memcpy(bytes.data(), &value, sizeof(uint32_t)); - return bytes; -} - -uint32_t uint8s_to_uint32(uint8_t byte1, uint8_t byte2, uint8_t byte3, - uint8_t byte4) { - uint32_t value; - uint8_t bytes[4] = {byte1, byte2, byte3, byte4}; - std::memcpy(&value, bytes, sizeof(uint32_t)); - return value; -} - -double uint8s_to_double(uint8_t byte1, uint8_t byte2, uint8_t byte3, - uint8_t byte4) { - double value; - uint8_t bytes[4] = {byte1, byte2, byte3, byte4}; - std::memcpy(&value, bytes, sizeof(double)); - return value; -} - -bool is_in_ranges(int number) { - return (7 <= number && number <= 10) || (13 <= number && number <= 16) || - (35 <= number && number <= 36); -} - -void print_hex(const std::vector& data) { - for (auto byte : data) { - std::cout << std::hex << std::uppercase << (int)byte << " "; - } - std::cout << std::dec << std::endl; -} - -template -T get_enum_by_index(int index) { - if (index >= 0 && index < static_cast(T::COUNT)) { - return static_cast(index); - } - return static_cast(-1); -} - -#endif // OPENARM_MOTOR_H_ diff --git a/openarm_hardware/src/motor_control.cpp b/openarm_hardware/src/motor_control.cpp deleted file mode 100644 index c5adfde..0000000 --- a/openarm_hardware/src/motor_control.cpp +++ /dev/null @@ -1,472 +0,0 @@ -// Copyright 2025 Reazon Holdings, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "openarm_hardware/motor_control.hpp" - -#include "openarm_hardware/motor.hpp" - -MotorControl::MotorControl(CANBus& canbus) : canbus_(canbus) {} - -bool MotorControl::addMotor(Motor& motor) { - motors_map_[motor.SlaveID] = &motor; - if (motor.MasterID != 0) { - motors_map_[motor.MasterID] = &motor; - } - return true; -} - -void MotorControl::enable(Motor& motor) { - controlCmd(motor, 0xFC); - sleep(0.3); -} - -void MotorControl::disable(Motor& motor) { - controlCmd(motor, 0xFD); - sleep(0.3); -} - -void MotorControl::set_zero_position(Motor& motor) { - controlCmd(motor, 0xFE); - sleep(0.3); - recv(); -} - -void MotorControl::controlMIT(Motor& motor, double kp, double kd, double q, - double dq, double tau) { - if (motors_map_.find(motor.SlaveID) == motors_map_.end()) { - std::cerr << "controlMIT ERROR: Motor ID not found" << std::endl; - return; - } - - uint16_t kp_uint = double_to_uint(kp, 0, 500, 12); - uint16_t kd_uint = double_to_uint(kd, 0, 5, 12); - - int motor_index = static_cast(motor.MotorType); - double Q_MAX = Limit_Param[motor_index][0]; - double DQ_MAX = Limit_Param[motor_index][1]; - double TAU_MAX = Limit_Param[motor_index][2]; - - uint16_t q_uint = double_to_uint(q, -Q_MAX, Q_MAX, 16); - uint16_t dq_uint = double_to_uint(dq, -DQ_MAX, DQ_MAX, 12); - uint16_t tau_uint = double_to_uint(tau, -TAU_MAX, TAU_MAX, 12); - - std::array data = { - static_cast((q_uint >> 8) & 0xFF), - static_cast(q_uint & 0xFF), - static_cast(dq_uint >> 4), - static_cast(((dq_uint & 0xF) << 4) | ((kp_uint >> 8) & 0xF)), - static_cast(kp_uint & 0xFF), - static_cast(kd_uint >> 4), - static_cast(((kd_uint & 0xF) << 4) | ((tau_uint >> 8) & 0xF)), - static_cast(tau_uint & 0xFF)}; - - sendData(motor.SlaveID, data); - recv(); -} - -void MotorControl::controlMIT2(Motor& motor, double kp, double kd, double q, - double dq, double tau) { - if (motors_map_.find(motor.SlaveID) == motors_map_.end()) { - std::cerr << "controlMIT ERROR: Motor ID not found" << std::endl; - return; - } - - uint16_t kp_uint = double_to_uint(kp, 0, 500, 12); - uint16_t kd_uint = double_to_uint(kd, 0, 5, 12); - - int motor_index = static_cast(motor.MotorType); - double Q_MAX = Limit_Param[motor_index][0]; - double DQ_MAX = Limit_Param[motor_index][1]; - double TAU_MAX = Limit_Param[motor_index][2]; - - uint16_t q_uint = double_to_uint(q, -Q_MAX, Q_MAX, 16); - uint16_t dq_uint = double_to_uint(dq, -DQ_MAX, DQ_MAX, 12); - uint16_t tau_uint = double_to_uint(tau, -TAU_MAX, TAU_MAX, 12); - - std::array data = { - static_cast((q_uint >> 8) & 0xFF), - static_cast(q_uint & 0xFF), - static_cast(dq_uint >> 4), - static_cast(((dq_uint & 0xF) << 4) | ((kp_uint >> 8) & 0xF)), - static_cast(kp_uint & 0xFF), - static_cast(kd_uint >> 4), - static_cast(((kd_uint & 0xF) << 4) | ((tau_uint >> 8) & 0xF)), - static_cast(tau_uint & 0xFF)}; - - sendData(motor.SlaveID, data); -} - -void MotorControl::sendData(uint16_t motor_id, - const std::array& data) { - canbus_.send(motor_id, data); -} - -void MotorControl::recv() { - uint16_t id; - uint8_t len; - std::array data = canbus_.recv(id, len); - - if (canbus_.whichCAN() == CAN_MODE_CLASSIC) { - can_frame frame; - std::memset(&frame, 0, sizeof(frame)); - frame.can_id = id; - frame.can_dlc = len; - std::memcpy(frame.data, data.data(), len); - - processPacket(frame); - } else if (canbus_.whichCAN() == CAN_MODE_FD) { - canfd_frame fd_frame; - std::memset(&fd_frame, 0, sizeof(fd_frame)); - fd_frame.can_id = id; - fd_frame.len = len; - std::memcpy(fd_frame.data, data.data(), len); - - processPacketFD(fd_frame); - } -} - -void MotorControl::control_delay(Motor& motor, double kp, double kd, double q, - double dq, double tau, double delay) { - controlMIT(motor, kp, kd, q, dq, tau); - std::this_thread::sleep_for( - std::chrono::milliseconds(static_cast(delay))); -} - -void MotorControl::controlPosVel(Motor& motor, double pos, double vel) { - if (motors_map_.find(motor.SlaveID) == motors_map_.end()) { - std::cerr << "controlPosVel ERROR: Motor ID not found" << std::endl; - return; - } - - uint16_t motor_id = 0x100 + motor.SlaveID; - std::array data_buf = {0}; - - auto vel_buf = float_to_uint8s(static_cast(vel)); - auto pos_buf = float_to_uint8s(static_cast(pos)); - - for (int i = 0; i < 4; ++i) { - data_buf[i] = pos_buf[i]; - data_buf[i + 4] = vel_buf[i]; - } - - sendData(motor_id, data_buf); - - recv(); -} - -void MotorControl::controlPosVel2(Motor& motor, double pos, double vel) { - if (motors_map_.find(motor.SlaveID) == motors_map_.end()) { - std::cerr << "controlPosVel2 ERROR: Motor ID not found" << std::endl; - return; - } - - uint16_t motor_id = 0x100 + motor.SlaveID; - std::array data_buf = {0}; - - auto pos_buf = float_to_uint8s(static_cast(pos)); - auto vel_buf = float_to_uint8s(static_cast(vel)); - - for (int i = 0; i < 4; ++i) { - data_buf[i] = pos_buf[i]; - data_buf[i + 4] = vel_buf[i]; - } - - sendData(motor_id, data_buf); -} - -void MotorControl::controlVel(Motor& motor, double vel) { - if (motors_map_.find(motor.SlaveID) == motors_map_.end()) { - std::cerr << "controlVel ERROR: Motor ID not found" << std::endl; - return; - } - - uint16_t motor_id = 0x200 + motor.SlaveID; - std::array data_buf = {0}; - - auto vel_buf = float_to_uint8s(static_cast(vel)); - for (int i = 0; i < 4; ++i) { - data_buf[i] = vel_buf[i]; - } - - sendData(motor_id, data_buf); - recv(); -} - -void MotorControl::controlVel2(Motor& motor, double vel) { - if (motors_map_.find(motor.SlaveID) == motors_map_.end()) { - std::cerr << "controlVel2 ERROR: Motor ID not found" << std::endl; - return; - } - - uint16_t motor_id = 0x200 + motor.SlaveID; - std::array data_buf = {0}; - - auto vel_buf = float_to_uint8s(static_cast(vel)); - for (int i = 0; i < 4; ++i) { - data_buf[i] = vel_buf[i]; - } - - sendData(motor_id, data_buf); -} - -void MotorControl::controlPosForce(Motor& motor, double pos, double vel, - double tau) { - if (motors_map_.find(motor.SlaveID) == motors_map_.end()) { - std::cerr << "controlPosForce ERROR: Motor ID not found" << std::endl; - return; - } - - uint16_t motor_id = 0x300 + motor.SlaveID; - std::array data_buf = {0}; - - auto pos_buf = float_to_uint8s(static_cast(pos)); - auto vel_buf = float_to_uint8s(static_cast(vel)); - auto tau_buf = float_to_uint8s(static_cast(tau)); - - for (int i = 0; i < 4; ++i) { - data_buf[i] = pos_buf[i]; - } - - data_buf[4] = vel_buf[0]; - data_buf[5] = vel_buf[1]; - - data_buf[6] = tau_buf[0]; - data_buf[7] = tau_buf[1]; - - sendData(motor_id, data_buf); - recv(); -} - -void MotorControl::controlPosForce2(Motor& motor, double pos, double vel, - double tau) { - if (motors_map_.find(motor.SlaveID) == motors_map_.end()) { - std::cerr << "controlPosForce ERROR: Motor ID not found" << std::endl; - return; - } - - uint16_t motor_id = 0x300 + motor.SlaveID; - std::array data_buf = {0}; - - auto pos_buf = float_to_uint8s(static_cast(pos)); - auto vel_buf = float_to_uint8s(static_cast(vel)); - auto tau_buf = float_to_uint8s(static_cast(tau)); - - for (int i = 0; i < 4; ++i) { - data_buf[i] = pos_buf[i]; - } - - data_buf[4] = vel_buf[0]; - data_buf[5] = vel_buf[1]; - - data_buf[6] = tau_buf[0]; - data_buf[7] = tau_buf[1]; - - sendData(motor_id, data_buf); -} - -bool MotorControl::switchControlMode(Motor& motor, Control_Type control_mode) { - const int max_retries = 20; - const double retry_interval = 0.1; - DM_variable RID = DM_variable::CTRL_MODE; - - writeMotorParam(motor, RID, static_cast(control_mode)); - - for (int i = 0; i < max_retries; ++i) { - usleep(static_cast(retry_interval * 1e6)); - recv_set_param_data(); - if (motor.getParam(static_cast(RID)) == - static_cast(control_mode)) { - return true; - } - } - return false; -} -void MotorControl::save_motor_param(Motor& motor) { - std::array data = { - static_cast(motor.SlaveID & 0xFF), - static_cast((motor.SlaveID >> 8) & 0xFF), - 0xAA, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00}; - disable(motor); - canbus_.send(0x7FF, data); - usleep(1000); -} -// void MotorControl::change_limit_param(DM_Motor_Type motor_type, double PMAX, -// double VMAX, double TMAX) { int index = static_cast(motor_type); -// Limit_Param[index][0] = PMAX; -// Limit_Param[index][1] = VMAX; -// Limit_Param[index][2] = TMAX; -// } - -void MotorControl::recv_set_param_data() { - uint16_t id; - uint8_t len; - std::array data = canbus_.recv(id, len); - - uint8_t cmd = 0x11; - - if (len >= 8) { - std::cout << "CANID: 0x" << std::hex << id << ", CMD: 0x" - << static_cast(cmd) << std::dec << std::endl; - for (int i = 0; i < 8; ++i) { - std::cout << "0x" << std::hex << static_cast(data[i]) << " "; - } - std::cout << std::dec << std::endl; - } -} - -void MotorControl::processPacket(const can_frame& frame) { - uint16_t motorID = frame.data[0]; - uint8_t cmd = 0x11; // someday fix - - if (cmd == 0x11) { - if (motorID != 0x00) { - auto it = motors_map_.find(motorID); - if (it != motors_map_.end() && it->second) { - Motor* motor = it->second; - - uint16_t q_uint = (frame.data[1] << 8) | frame.data[2]; - uint16_t dq_uint = (frame.data[3] << 4) | (frame.data[4] >> 4); - uint16_t tau_uint = ((frame.data[4] & 0xf) << 8) | frame.data[5]; - int t_mos = frame.data[6]; - int t_rotor = frame.data[7]; - - double Q_MAX = Limit_Param[static_cast(motor->MotorType)][0]; - double DQ_MAX = Limit_Param[static_cast(motor->MotorType)][1]; - double TAU_MAX = Limit_Param[static_cast(motor->MotorType)][2]; - - double recv_q = uint_to_double(q_uint, -Q_MAX, Q_MAX, 16); - double recv_dq = uint_to_double(dq_uint, -DQ_MAX, DQ_MAX, 12); - double recv_tau = uint_to_double(tau_uint, -TAU_MAX, TAU_MAX, 12); - - motor->recv_data(recv_q, recv_dq, recv_tau, t_mos, t_rotor); - } - } else { - uint16_t MasterID = frame.data[0] & 0x0F; - auto it = motors_map_.find(MasterID); - if (it != motors_map_.end() && it->second) { - Motor* motor = it->second; - - uint16_t q_uint = (frame.data[1] << 8) | frame.data[2]; - uint16_t dq_uint = (frame.data[3] << 4) | (frame.data[4] >> 4); - uint16_t tau_uint = ((frame.data[4] & 0xf) << 8) | frame.data[5]; - int t_mos = frame.data[6]; - int t_rotor = frame.data[7]; - - double Q_MAX = Limit_Param[static_cast(motor->MotorType)][0]; - double DQ_MAX = Limit_Param[static_cast(motor->MotorType)][1]; - double TAU_MAX = Limit_Param[static_cast(motor->MotorType)][2]; - - double recv_q = uint_to_double(q_uint, -Q_MAX, Q_MAX, 16); - double recv_dq = uint_to_double(dq_uint, -DQ_MAX, DQ_MAX, 12); - double recv_tau = uint_to_double(tau_uint, -TAU_MAX, TAU_MAX, 12); - - motor->recv_data(recv_q, recv_dq, recv_tau, t_mos, t_rotor); - } - } - } -} - -void MotorControl::processPacketFD(const canfd_frame& frame) { - uint16_t motorID = frame.data[0]; - uint8_t cmd = 0x11; // someday fix - - if (cmd == 0x11) { - if (motorID != 0x00) { - auto it = motors_map_.find(motorID); - if (it != motors_map_.end() && it->second) { - Motor* motor = it->second; - - uint16_t q_uint = (frame.data[1] << 8) | frame.data[2]; - uint16_t dq_uint = (frame.data[3] << 4) | (frame.data[4] >> 4); - uint16_t tau_uint = ((frame.data[4] & 0xf) << 8) | frame.data[5]; - int t_mos = frame.data[6]; - int t_rotor = frame.data[7]; - - double Q_MAX = Limit_Param[static_cast(motor->MotorType)][0]; - double DQ_MAX = Limit_Param[static_cast(motor->MotorType)][1]; - double TAU_MAX = Limit_Param[static_cast(motor->MotorType)][2]; - - double recv_q = uint_to_double(q_uint, -Q_MAX, Q_MAX, 16); - double recv_dq = uint_to_double(dq_uint, -DQ_MAX, DQ_MAX, 12); - double recv_tau = uint_to_double(tau_uint, -TAU_MAX, TAU_MAX, 12); - - motor->recv_data(recv_q, recv_dq, recv_tau, t_mos, t_rotor); - } - } else { - uint16_t MasterID = frame.data[0] & 0x0F; - auto it = motors_map_.find(MasterID); - if (it != motors_map_.end() && it->second) { - Motor* motor = it->second; - - uint16_t q_uint = (frame.data[1] << 8) | frame.data[2]; - uint16_t dq_uint = (frame.data[3] << 4) | (frame.data[4] >> 4); - uint16_t tau_uint = ((frame.data[4] & 0xf) << 8) | frame.data[5]; - int t_mos = frame.data[6]; - int t_rotor = frame.data[7]; - - double Q_MAX = Limit_Param[static_cast(motor->MotorType)][0]; - double DQ_MAX = Limit_Param[static_cast(motor->MotorType)][1]; - double TAU_MAX = Limit_Param[static_cast(motor->MotorType)][2]; - - double recv_q = uint_to_double(q_uint, -Q_MAX, Q_MAX, 16); - double recv_dq = uint_to_double(dq_uint, -DQ_MAX, DQ_MAX, 12); - double recv_tau = uint_to_double(tau_uint, -TAU_MAX, TAU_MAX, 12); - - motor->recv_data(recv_q, recv_dq, recv_tau, t_mos, t_rotor); - } - } - } -} - -void MotorControl::controlCmd(Motor& motor, uint8_t cmd) { - std::array data_buf = {0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, cmd}; - sendData(motor.SlaveID, data_buf); -} - -void MotorControl::readRIDParam(Motor& motor, DM_variable RID) { - std::array data = { - static_cast(motor.SlaveID & 0xFF), - static_cast((motor.SlaveID >> 8) & 0xFF), - 0x33, - static_cast(RID), - 0x00, - 0x00, - 0x00, - 0x00}; - canbus_.send(0x7FF, data); -} - -void MotorControl::writeMotorParam(Motor& motor, DM_variable RID, - double value) { - std::array data = { - static_cast(motor.SlaveID & 0xFF), - static_cast((motor.SlaveID >> 8) & 0xFF), 0x55, - static_cast(RID)}; - - if (is_in_ranges(static_cast(RID))) { - auto intData = data_to_uint8s(static_cast(value)); - std::copy(intData.begin(), intData.end(), data.begin() + 4); - } else { - auto doubleData = double_to_uint8s(value); - std::copy(doubleData.begin(), doubleData.end(), data.begin() + 4); - } - - canbus_.send(0x7FF, data); -} diff --git a/openarm_hardware/src/openarm_hardware.cpp b/openarm_hardware/src/openarm_hardware.cpp deleted file mode 100644 index 00d9ed5..0000000 --- a/openarm_hardware/src/openarm_hardware.cpp +++ /dev/null @@ -1,257 +0,0 @@ -// Copyright 2025 Reazon Holdings, Inc. -// Copyright 2025 Stogl Robotics Consulting UG (haftungsbeschränkt) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "openarm_hardware/openarm_hardware.hpp" - -#include -#include - -#include "hardware_interface/types/hardware_interface_type_values.hpp" -#include "rclcpp/logging.hpp" -#include "rclcpp/rclcpp.hpp" - -namespace openarm_hardware { - -static const std::string& can_device_name = "can0"; - -OpenArmHW::OpenArmHW() = default; - -hardware_interface::CallbackReturn OpenArmHW::on_init( - const hardware_interface::HardwareInfo& info) { - if (hardware_interface::SystemInterface::on_init(info) != - CallbackReturn::SUCCESS) { - return CallbackReturn::ERROR; - } - - // read hardware parameters - if (info.hardware_parameters.find("can_device") == - info.hardware_parameters.end()) { - RCLCPP_ERROR(rclcpp::get_logger("OpenArmHW"), - "No can_device parameter found"); - return CallbackReturn::ERROR; - } - - auto it = info.hardware_parameters.find("prefix"); - if (it == info.hardware_parameters.end()) { - prefix_ = ""; - } else { - prefix_ = it->second; - } - it = info.hardware_parameters.find("disable_torque"); - if (it == info.hardware_parameters.end()) { - disable_torque_ = false; - } else { - disable_torque_ = it->second == "true"; - } - - // temp CANFD - canbus_ = std::make_unique(info.hardware_parameters.at("can_device"), - CAN_MODE_FD); - motor_control_ = std::make_unique(*canbus_); - - if (USING_GRIPPER) { - motor_types.emplace_back(DM_Motor_Type::DM4310); - can_device_ids.emplace_back(0x08); - can_master_ids.emplace_back(0x18); - ++curr_dof; - } - - motors_.resize(curr_dof); - for (size_t i = 0; i < curr_dof; ++i) { - motors_[i] = std::make_unique(motor_types[i], can_device_ids[i], - can_master_ids[i]); - motor_control_->addMotor(*motors_[i]); - } - - pos_states_.resize(curr_dof, 0.0); - pos_commands_.resize(curr_dof, 0.0); - vel_states_.resize(curr_dof, 0.0); - vel_commands_.resize(curr_dof, 0.0); - tau_states_.resize(curr_dof, 0.0); - tau_ff_commands_.resize(curr_dof, 0.0); - refresh_motors(); - read(rclcpp::Time(0), rclcpp::Duration(0, 0)); - - return CallbackReturn::SUCCESS; -} - -hardware_interface::CallbackReturn OpenArmHW::on_configure( - const rclcpp_lifecycle::State& /*previous_state*/) { - read(rclcpp::Time(0), rclcpp::Duration(0, 0)); - // zero position or calibrate to pose - // for (std::size_t i = 0; i < curr_dof; ++i) - // { - // motor_control_->set_zero_position(*motors_[i]); - // } - - return CallbackReturn::SUCCESS; -} - -std::vector -OpenArmHW::export_state_interfaces() { - std::vector state_interfaces; - for (size_t i = 0; i < curr_dof; ++i) { - state_interfaces.emplace_back(hardware_interface::StateInterface( - info_.joints[i].name, hardware_interface::HW_IF_POSITION, - &pos_states_[i])); - state_interfaces.emplace_back(hardware_interface::StateInterface( - info_.joints[i].name, hardware_interface::HW_IF_VELOCITY, - &vel_states_[i])); - state_interfaces.emplace_back(hardware_interface::StateInterface( - info_.joints[i].name, hardware_interface::HW_IF_EFFORT, - &tau_states_[i])); - RCLCPP_INFO(rclcpp::get_logger("OpenArmHW"), - "Exporting state interface for joint %s", - info_.joints[i].name.c_str()); - } - - return state_interfaces; -} - -std::vector -OpenArmHW::export_command_interfaces() { - std::vector command_interfaces; - for (size_t i = 0; i < curr_dof; ++i) { - command_interfaces.emplace_back(hardware_interface::CommandInterface( - info_.joints[i].name, hardware_interface::HW_IF_POSITION, - &pos_commands_[i])); - command_interfaces.emplace_back(hardware_interface::CommandInterface( - info_.joints[i].name, hardware_interface::HW_IF_VELOCITY, - &vel_commands_[i])); - command_interfaces.emplace_back(hardware_interface::CommandInterface( - info_.joints[i].name, hardware_interface::HW_IF_EFFORT, - &tau_ff_commands_[i])); - } - - return command_interfaces; -} - -void OpenArmHW::refresh_motors() { - for (const auto& motor : motors_) { - motor_control_->controlMIT(*motor, 0.0, 0.0, 0.0, 0.0, 0.0); - } -} - -hardware_interface::CallbackReturn OpenArmHW::on_activate( - const rclcpp_lifecycle::State& /*previous_state*/) { - read(rclcpp::Time(0), rclcpp::Duration(0, 0)); - bool zeroed = false; - for (const auto& motor : motors_) { - motor_control_->enable(*motor); - } - - while (!zeroed) { - bool all_zero = true; - for (std::size_t m = 0; m < curr_dof; ++m) { - const double diff = pos_commands_[m] - pos_states_[m]; - if (std::abs(diff) > START_POS_TOLERANCE_RAD) { - all_zero = false; - } - - const double max_step = std::min(POS_JUMP_TOLERANCE_RAD, std::abs(diff)); - double command = pos_states_[m]; - if (pos_states_[m] < pos_commands_[m]) { - command += max_step; - } else { - command -= max_step; - } - motor_control_->controlMIT(*motors_[m], KP[m], KD[m], command, 0.0, 0.0); - } - if (all_zero) { - zeroed = true; - } else { - sleep(0.01); - read(rclcpp::Time(0), rclcpp::Duration(0, 0)); - } - } - - read(rclcpp::Time(0), rclcpp::Duration(0, 0)); - - return CallbackReturn::SUCCESS; -} - -hardware_interface::CallbackReturn OpenArmHW::on_deactivate( - const rclcpp_lifecycle::State& /*previous_state*/) { - refresh_motors(); - for (const auto& motor : motors_) { - motor_control_->disable(*motor); - } - - return CallbackReturn::SUCCESS; -} - -hardware_interface::return_type OpenArmHW::read( - const rclcpp::Time& /*time*/, const rclcpp::Duration& /*period*/) { - for (size_t i = 0; i < ARM_DOF; ++i) { - pos_states_[i] = motors_[i]->getPosition(); - vel_states_[i] = motors_[i]->getVelocity(); - tau_states_[i] = motors_[i]->getTorque(); - } - if (USING_GRIPPER) { - pos_states_[GRIPPER_INDEX] = -motors_[GRIPPER_INDEX]->getPosition() * - GRIPPER_REFERENCE_GEAR_RADIUS_M * - GRIPPER_GEAR_DIRECTION_MULTIPLIER; - vel_states_[GRIPPER_INDEX] = motors_[GRIPPER_INDEX]->getVelocity() * - GRIPPER_REFERENCE_GEAR_RADIUS_M * - GRIPPER_GEAR_DIRECTION_MULTIPLIER; - tau_states_[GRIPPER_INDEX] = motors_[GRIPPER_INDEX]->getTorque() * - GRIPPER_REFERENCE_GEAR_RADIUS_M * - GRIPPER_GEAR_DIRECTION_MULTIPLIER; - } - - return hardware_interface::return_type::OK; -} - -hardware_interface::return_type OpenArmHW::write( - const rclcpp::Time& /*time*/, const rclcpp::Duration& /*period*/) { - if (disable_torque_) { - // refresh motor state on write - for (size_t i = 0; i < curr_dof; ++i) { - motor_control_->controlMIT(*motors_[i], 0.0, 0.0, 0.0, 0.0, 0.0); - return hardware_interface::return_type::OK; - } - } - - for (size_t i = 0; i < ARM_DOF; ++i) { - if (std::abs(pos_commands_[i] - pos_states_[i]) > POS_JUMP_TOLERANCE_RAD) { - RCLCPP_ERROR(rclcpp::get_logger("OpenArmHW"), - "Position jump detected for joint %s: %f -> %f", - info_.joints[i].name.c_str(), pos_states_[i], - pos_commands_[i]); - return hardware_interface::return_type::ERROR; - } - motor_control_->controlMIT(*motors_[i], KP.at(i), KD.at(i), - pos_commands_[i], vel_commands_[i], - tau_ff_commands_[i]); - } - if (USING_GRIPPER) { - motor_control_->controlMIT( - *motors_[GRIPPER_INDEX], KP.at(GRIPPER_INDEX), KD.at(GRIPPER_INDEX), - -pos_commands_[GRIPPER_INDEX] / GRIPPER_REFERENCE_GEAR_RADIUS_M * - GRIPPER_GEAR_DIRECTION_MULTIPLIER, - vel_commands_[GRIPPER_INDEX] / GRIPPER_REFERENCE_GEAR_RADIUS_M * - GRIPPER_GEAR_DIRECTION_MULTIPLIER, - tau_ff_commands_[GRIPPER_INDEX] / GRIPPER_REFERENCE_GEAR_RADIUS_M * - GRIPPER_GEAR_DIRECTION_MULTIPLIER); - } - return hardware_interface::return_type::OK; -} - -} // namespace openarm_hardware - -#include "pluginlib/class_list_macros.hpp" - -PLUGINLIB_EXPORT_CLASS(openarm_hardware::OpenArmHW, - hardware_interface::SystemInterface) diff --git a/openarm_hardware/src/v10_simple_hardware.cpp b/openarm_hardware/src/v10_simple_hardware.cpp new file mode 100644 index 0000000..6d31ab1 --- /dev/null +++ b/openarm_hardware/src/v10_simple_hardware.cpp @@ -0,0 +1,322 @@ +// Copyright 2025 Reazon Holdings, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "openarm_hardware/v10_simple_hardware.hpp" + +#include +#include +#include +#include +#include + +#include "hardware_interface/types/hardware_interface_type_values.hpp" +#include "rclcpp/logging.hpp" +#include "rclcpp/rclcpp.hpp" + +namespace openarm_hardware { + +OpenArm_v10HW::OpenArm_v10HW() = default; + +bool OpenArm_v10HW::parse_config(const hardware_interface::HardwareInfo& info) { + // Parse CAN interface (default: can0) + auto it = info.hardware_parameters.find("can_interface"); + can_interface_ = (it != info.hardware_parameters.end()) ? it->second : "can0"; + + // Parse arm prefix (default: empty for single arm, "left_" or "right_" for + // bimanual) + it = info.hardware_parameters.find("arm_prefix"); + arm_prefix_ = (it != info.hardware_parameters.end()) ? it->second : ""; + + // Parse gripper enable (default: true for V10) + it = info.hardware_parameters.find("hand"); + if (it == info.hardware_parameters.end()) { + hand_ = true; // Default to true for V10 + } else { + // Handle both "true"/"True" and "false"/"False" + std::string value = it->second; + std::transform(value.begin(), value.end(), value.begin(), ::tolower); + hand_ = (value == "true"); + } + + // Parse CAN-FD enable (default: true for V10) + it = info.hardware_parameters.find("can_fd"); + if (it == info.hardware_parameters.end()) { + can_fd_ = true; // Default to true for V10 + } else { + // Handle both "true"/"True" and "false"/"False" + std::string value = it->second; + std::transform(value.begin(), value.end(), value.begin(), ::tolower); + can_fd_ = (value == "true"); + } + + RCLCPP_INFO(rclcpp::get_logger("OpenArm_v10HW"), + "Configuration: CAN=%s, arm_prefix=%s, hand=%s, can_fd=%s", + can_interface_.c_str(), arm_prefix_.c_str(), + hand_ ? "enabled" : "disabled", can_fd_ ? "enabled" : "disabled"); + + return true; +} + +void OpenArm_v10HW::generate_joint_names() { + joint_names_.clear(); + // TODO: read from urdf properly in the future + // Generate arm joint names: openarm_{arm_prefix}joint{N} + for (size_t i = 1; i <= ARM_DOF; ++i) { + std::string joint_name = + "openarm_" + arm_prefix_ + "joint" + std::to_string(i); + joint_names_.push_back(joint_name); + } + + // Generate gripper joint name if enabled + if (hand_) { + std::string gripper_joint_name = "openarm_" + arm_prefix_ + "finger_joint1"; + joint_names_.push_back(gripper_joint_name); + RCLCPP_INFO(rclcpp::get_logger("OpenArm_v10HW"), "Added gripper joint: %s", + gripper_joint_name.c_str()); + } else { + RCLCPP_INFO(rclcpp::get_logger("OpenArm_v10HW"), + "Gripper joint NOT added because hand_=false"); + } + + RCLCPP_INFO(rclcpp::get_logger("OpenArm_v10HW"), + "Generated %zu joint names for arm prefix '%s'", + joint_names_.size(), arm_prefix_.c_str()); +} + +hardware_interface::CallbackReturn OpenArm_v10HW::on_init( + const hardware_interface::HardwareInfo& info) { + if (hardware_interface::SystemInterface::on_init(info) != + CallbackReturn::SUCCESS) { + return CallbackReturn::ERROR; + } + // Parse configuration + if (!parse_config(info)) { + return CallbackReturn::ERROR; + } + + // Generate joint names based on arm prefix + generate_joint_names(); + + // Validate joint count (7 arm joints + optional gripper) + size_t expected_joints = ARM_DOF + (hand_ ? 1 : 0); + if (joint_names_.size() != expected_joints) { + RCLCPP_ERROR(rclcpp::get_logger("OpenArm_v10HW"), + "Generated %zu joint names, expected %zu", joint_names_.size(), + expected_joints); + return CallbackReturn::ERROR; + } + + // Initialize OpenArm with configurable CAN-FD setting + RCLCPP_INFO(rclcpp::get_logger("OpenArm_v10HW"), + "Initializing OpenArm on %s with CAN-FD %s...", + can_interface_.c_str(), can_fd_ ? "enabled" : "disabled"); + openarm_ = + std::make_unique(can_interface_, can_fd_); + + // Initialize arm motors with V10 defaults + openarm_->init_arm_motors(DEFAULT_MOTOR_TYPES, DEFAULT_SEND_CAN_IDS, + DEFAULT_RECV_CAN_IDS); + + // Initialize gripper if enabled + if (hand_) { + RCLCPP_INFO(rclcpp::get_logger("OpenArm_v10HW"), "Initializing gripper..."); + openarm_->init_gripper_motor(DEFAULT_GRIPPER_MOTOR_TYPE, + DEFAULT_GRIPPER_SEND_CAN_ID, + DEFAULT_GRIPPER_RECV_CAN_ID); + } + + // Initialize state and command vectors based on generated joint count + const size_t total_joints = joint_names_.size(); + pos_commands_.resize(total_joints, 0.0); + vel_commands_.resize(total_joints, 0.0); + tau_commands_.resize(total_joints, 0.0); + pos_states_.resize(total_joints, 0.0); + vel_states_.resize(total_joints, 0.0); + tau_states_.resize(total_joints, 0.0); + + RCLCPP_INFO(rclcpp::get_logger("OpenArm_v10HW"), + "OpenArm V10 Simple HW initialized successfully"); + + return CallbackReturn::SUCCESS; +} + +hardware_interface::CallbackReturn OpenArm_v10HW::on_configure( + const rclcpp_lifecycle::State& /*previous_state*/) { + // Set callback mode to ignore during configuration + openarm_->set_callback_mode_all(openarm::damiao_motor::CallbackMode::IGNORE); + openarm_->refresh_all(); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + openarm_->recv_all(); + + return CallbackReturn::SUCCESS; +} + +std::vector +OpenArm_v10HW::export_state_interfaces() { + std::vector state_interfaces; + + for (size_t i = 0; i < joint_names_.size(); ++i) { + state_interfaces.emplace_back(hardware_interface::StateInterface( + joint_names_[i], hardware_interface::HW_IF_POSITION, &pos_states_[i])); + state_interfaces.emplace_back(hardware_interface::StateInterface( + joint_names_[i], hardware_interface::HW_IF_VELOCITY, &vel_states_[i])); + state_interfaces.emplace_back(hardware_interface::StateInterface( + joint_names_[i], hardware_interface::HW_IF_EFFORT, &tau_states_[i])); + } + + return state_interfaces; +} + +std::vector +OpenArm_v10HW::export_command_interfaces() { + std::vector command_interfaces; + + for (size_t i = 0; i < joint_names_.size(); ++i) { + command_interfaces.emplace_back(hardware_interface::CommandInterface( + joint_names_[i], hardware_interface::HW_IF_POSITION, + &pos_commands_[i])); + command_interfaces.emplace_back(hardware_interface::CommandInterface( + joint_names_[i], hardware_interface::HW_IF_VELOCITY, + &vel_commands_[i])); + command_interfaces.emplace_back(hardware_interface::CommandInterface( + joint_names_[i], hardware_interface::HW_IF_EFFORT, &tau_commands_[i])); + } + + return command_interfaces; +} + +hardware_interface::CallbackReturn OpenArm_v10HW::on_activate( + const rclcpp_lifecycle::State& /*previous_state*/) { + RCLCPP_INFO(rclcpp::get_logger("OpenArm_v10HW"), "Activating OpenArm V10..."); + + // Set callback mode to state and enable all motors (like full_arm.cpp) + openarm_->set_callback_mode_all(openarm::damiao_motor::CallbackMode::STATE); + openarm_->enable_all(); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + openarm_->recv_all(); + + // Return to zero position smoothly + return_to_zero(); + + RCLCPP_INFO(rclcpp::get_logger("OpenArm_v10HW"), "OpenArm V10 activated"); + return CallbackReturn::SUCCESS; +} + +hardware_interface::CallbackReturn OpenArm_v10HW::on_deactivate( + const rclcpp_lifecycle::State& /*previous_state*/) { + RCLCPP_INFO(rclcpp::get_logger("OpenArm_v10HW"), + "Deactivating OpenArm V10..."); + + // Disable all motors (like full_arm.cpp exit) + openarm_->disable_all(); + openarm_->recv_all(); + + RCLCPP_INFO(rclcpp::get_logger("OpenArm_v10HW"), "OpenArm V10 deactivated"); + return CallbackReturn::SUCCESS; +} + +hardware_interface::return_type OpenArm_v10HW::read( + const rclcpp::Time& /*time*/, const rclcpp::Duration& /*period*/) { + // Receive all motor states + openarm_->set_callback_mode_all(openarm::damiao_motor::CallbackMode::STATE); + openarm_->recv_all(); + std::this_thread::sleep_for(std::chrono::microseconds(300)); + openarm_->set_callback_mode_all(openarm::damiao_motor::CallbackMode::IGNORE); + + // Read arm joint states + const auto& arm_motors = openarm_->get_arm().get_motors(); + for (size_t i = 0; i < ARM_DOF && i < arm_motors.size(); ++i) { + pos_states_[i] = arm_motors[i].get_position(); + vel_states_[i] = arm_motors[i].get_velocity(); + tau_states_[i] = arm_motors[i].get_torque(); + } + + // Read gripper state if enabled + if (hand_ && joint_names_.size() > ARM_DOF) { + const auto& gripper_motors = openarm_->get_gripper().get_motors(); + if (!gripper_motors.empty()) { + // TODO the mappings are unimplemented, need to actually implement the + // mappings for pos, vel, tau Convert motor position (radians) to joint + // value (0-1) + double motor_pos = gripper_motors[0].get_position(); + pos_states_[ARM_DOF] = motor_radians_to_joint(motor_pos); + + // Velocity and torque can be passed through directly for now + vel_states_[ARM_DOF] = 0; // gripper_motors[0].get_velocity(); + tau_states_[ARM_DOF] = 0; // gripper_motors[0].get_torque(); + } + } + + return hardware_interface::return_type::OK; +} + +hardware_interface::return_type OpenArm_v10HW::write( + const rclcpp::Time& /*time*/, const rclcpp::Duration& /*period*/) { + // Control arm motors with MIT control + std::vector arm_params; + for (size_t i = 0; i < ARM_DOF; ++i) { + arm_params.push_back({DEFAULT_KP[i], DEFAULT_KD[i], pos_commands_[i], + vel_commands_[i], tau_commands_[i]}); + } + openarm_->get_arm().mit_control_all(arm_params); + // Control gripper if enabled + if (hand_ && joint_names_.size() > ARM_DOF) { + // Convert joint value (0-1) to motor position (radians) + double motor_command = joint_to_motor_radians(pos_commands_[ARM_DOF]); + + openarm_->get_gripper().mit_control_all({{5.0, 1.0, motor_command, 0, 0}}); + } + std::this_thread::sleep_for(std::chrono::microseconds(300)); + openarm_->recv_all(); + return hardware_interface::return_type::OK; +} + +void OpenArm_v10HW::return_to_zero() { + RCLCPP_INFO(rclcpp::get_logger("OpenArm_v10HW"), + "Returning to zero position..."); + + // Return arm to zero with MIT control + std::vector arm_params; + for (size_t i = 0; i < ARM_DOF; ++i) { + arm_params.push_back({DEFAULT_KP[i], DEFAULT_KD[i], 0.0, 0.0, 0.0}); + } + openarm_->get_arm().mit_control_all(arm_params); + + // Return gripper to zero if enabled + if (hand_) { + openarm_->get_gripper().mit_control_all({{5.0, 1.0, 0.0, 0.0, 0.0}}); + } + + // // Wait for motors to settle + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + openarm_->recv_all(); +} + +// Gripper mapping helper functions +double OpenArm_v10HW::joint_to_motor_radians(double joint_value) { + // Joint 0=closed -> motor 0 rad, Joint 1=open -> motor -1.0472 rad + return joint_value * (-1.0472); // Scale from 0-1 to 0 to -1.0472 +} + +double OpenArm_v10HW::motor_radians_to_joint(double motor_radians) { + // Motor 0 rad=closed -> joint 0, Motor -1.0472 rad=open -> joint 1 + return motor_radians / (-1.0472); // Scale from 0 to -1.0472 to 0-1 +} + +} // namespace openarm_hardware + +#include "pluginlib/class_list_macros.hpp" + +PLUGINLIB_EXPORT_CLASS(openarm_hardware::OpenArm_v10HW, + hardware_interface::SystemInterface) \ No newline at end of file diff --git a/openarm_hardware/test/test_openarm_hardware.cpp b/openarm_hardware/test/test_openarm_hardware.cpp deleted file mode 100644 index c2cc4f7..0000000 --- a/openarm_hardware/test/test_openarm_hardware.cpp +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright 2025 Reazon Holdings, Inc. -// Copyright 2025 Stogl Robotics Consulting UG (haftungsbeschränkt) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include - -#include - -#include "hardware_interface/resource_manager.hpp" -#include "ros2_control_test_assets/components_urdfs.hpp" -#include "ros2_control_test_assets/descriptions.hpp" - -class TestOpenArmHW : public ::testing::Test { - protected: - void SetUp() override { - openarm_hardware_7dof_ = - R"( - - - - mock_components/GenericSystem - openarm_hardware/OpenArmHW - - - - - - - 0 - - - - - - - - - - 0 - - - - - - - - - - 0 - - - - - - - - - - 0 - - - - - - - - - - 0 - - - - - - - - - - 0 - - - - - - - - - - 0 - - - - - - - - 0 - - - - - - 0 - - - - )"; - } - - std::string openarm_hardware_7dof_; -}; - -TEST_F(TestOpenArmHW, load_openarm_hardware_7dof) { - auto urdf = ros2_control_test_assets::urdf_head + openarm_hardware_7dof_ + - ros2_control_test_assets::urdf_tail; - ASSERT_NO_THROW(hardware_interface::ResourceManager rm(urdf)); -} From 10580443064549f6720d6dec29c3e6d17ae6dc0d Mon Sep 17 00:00:00 2001 From: Yue Yin Date: Wed, 23 Jul 2025 16:25:21 +0900 Subject: [PATCH 8/9] Remove moveit from main (#44) - As it is still work in progress, we will keep the experiments in `moveit2` branch. --- openarm/package.xml | 1 - .../.setup_assistant | 24 - openarm_bimanual_moveit_config/CMakeLists.txt | 30 - openarm_bimanual_moveit_config/LICENSE | 202 ------- openarm_bimanual_moveit_config/README.md | 19 - .../config/initial_positions.yaml | 33 - .../config/joint_limits.yaml | 104 ---- .../config/kinematics.yaml | 34 -- .../config/moveit.rviz | 562 ------------------ .../config/moveit_controllers.yaml | 61 -- .../config/openarm_bimanual.srdf | 456 -------------- .../config/openarm_bimanual.urdf.xacro | 31 - .../config/pilz_cartesian_limits.yaml | 20 - .../config/ros2_controllers.yaml | 147 ----- .../config/sensors_3d.yaml | 37 -- .../launch/demo.launch.py | 66 -- .../launch/move_group.launch.py | 23 - .../launch/moveit_rviz.launch.py | 23 - .../launch/rsp.launch.py | 23 - .../launch/setup_assistant.launch.py | 23 - .../launch/spawn_controllers.launch.py | 23 - .../launch/static_virtual_joint_tfs.launch.py | 23 - .../launch/warehouse_db.launch.py | 23 - openarm_bimanual_moveit_config/package.xml | 67 --- 24 files changed, 2055 deletions(-) delete mode 100644 openarm_bimanual_moveit_config/.setup_assistant delete mode 100644 openarm_bimanual_moveit_config/CMakeLists.txt delete mode 100644 openarm_bimanual_moveit_config/LICENSE delete mode 100644 openarm_bimanual_moveit_config/README.md delete mode 100644 openarm_bimanual_moveit_config/config/initial_positions.yaml delete mode 100644 openarm_bimanual_moveit_config/config/joint_limits.yaml delete mode 100644 openarm_bimanual_moveit_config/config/kinematics.yaml delete mode 100644 openarm_bimanual_moveit_config/config/moveit.rviz delete mode 100644 openarm_bimanual_moveit_config/config/moveit_controllers.yaml delete mode 100644 openarm_bimanual_moveit_config/config/openarm_bimanual.srdf delete mode 100644 openarm_bimanual_moveit_config/config/openarm_bimanual.urdf.xacro delete mode 100644 openarm_bimanual_moveit_config/config/pilz_cartesian_limits.yaml delete mode 100644 openarm_bimanual_moveit_config/config/ros2_controllers.yaml delete mode 100644 openarm_bimanual_moveit_config/config/sensors_3d.yaml delete mode 100644 openarm_bimanual_moveit_config/launch/demo.launch.py delete mode 100644 openarm_bimanual_moveit_config/launch/move_group.launch.py delete mode 100644 openarm_bimanual_moveit_config/launch/moveit_rviz.launch.py delete mode 100644 openarm_bimanual_moveit_config/launch/rsp.launch.py delete mode 100644 openarm_bimanual_moveit_config/launch/setup_assistant.launch.py delete mode 100644 openarm_bimanual_moveit_config/launch/spawn_controllers.launch.py delete mode 100644 openarm_bimanual_moveit_config/launch/static_virtual_joint_tfs.launch.py delete mode 100644 openarm_bimanual_moveit_config/launch/warehouse_db.launch.py delete mode 100644 openarm_bimanual_moveit_config/package.xml diff --git a/openarm/package.xml b/openarm/package.xml index 03966be..7633791 100644 --- a/openarm/package.xml +++ b/openarm/package.xml @@ -24,7 +24,6 @@ ament_cmake - openarm_bimanual_moveit_config openarm_bringup openarm_description openarm_hardware diff --git a/openarm_bimanual_moveit_config/.setup_assistant b/openarm_bimanual_moveit_config/.setup_assistant deleted file mode 100644 index e48c9d9..0000000 --- a/openarm_bimanual_moveit_config/.setup_assistant +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2025 Reazon Holdings, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -moveit_setup_assistant_config: - urdf: - package: openarm_bimanual_description - relative_path: urdf/openarm_bimanual.urdf.xacro - srdf: - relative_path: config/openarm_bimanual.srdf - package_settings: - author_name: Thomason Zhou - author_email: t95zhou@uwaterloo.ca - generated_timestamp: 1745486864 diff --git a/openarm_bimanual_moveit_config/CMakeLists.txt b/openarm_bimanual_moveit_config/CMakeLists.txt deleted file mode 100644 index 58989a3..0000000 --- a/openarm_bimanual_moveit_config/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2025 Reazon Holdings, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -cmake_minimum_required(VERSION 3.22) -project(openarm_bimanual_moveit_config) - -find_package(ament_cmake REQUIRED) - -ament_package() - -if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/launch") - install( - DIRECTORY launch - DESTINATION share/${PROJECT_NAME} - PATTERN "setup_assistant.launch" EXCLUDE) -endif() - -install(DIRECTORY config DESTINATION share/${PROJECT_NAME}) -install(FILES .setup_assistant DESTINATION share/${PROJECT_NAME}) diff --git a/openarm_bimanual_moveit_config/LICENSE b/openarm_bimanual_moveit_config/LICENSE deleted file mode 100644 index d645695..0000000 --- a/openarm_bimanual_moveit_config/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/openarm_bimanual_moveit_config/README.md b/openarm_bimanual_moveit_config/README.md deleted file mode 100644 index 5bcf31b..0000000 --- a/openarm_bimanual_moveit_config/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# MoveIt2 on Bimanual Openarms - -Ensure the ROS2 packages and dependencies are installed by following the instructions in `openarm_ros2/README.md`. - -## Physical Hardware -1. Run `init_can.sh` from `openarm_bringup/utils`. - By default, can0 is the right arm and can1 is the left arm, but this can be adjusted in the ros2_control definition in `openarm_description/urdf/openarm.ros2_control.xacro`. - -2. Optionally, start the head-mounted realsense camera. This enables the octomap occupancy grid for planning around obstacles. - -```sh -ros2 launch openarm_bimanual_bringup depth_camera.launch.py -``` - -## Launch the demo - -```sh -ros2 launch openarm_bimanual_moveit_config demo.launch.py -``` diff --git a/openarm_bimanual_moveit_config/config/initial_positions.yaml b/openarm_bimanual_moveit_config/config/initial_positions.yaml deleted file mode 100644 index 4740b89..0000000 --- a/openarm_bimanual_moveit_config/config/initial_positions.yaml +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2025 Reazon Holdings, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Default initial positions for openarm_bimanual's ros2_control fake system - -initial_positions: - left_gripper: 0 - left_rev1: 0 - left_rev2: 0 - left_rev3: 0 - left_rev4: 0 - left_rev5: 0 - left_rev6: 0 - left_rev7: 0 - right_gripper: 0 - right_rev1: 0 - right_rev2: 0 - right_rev3: 0 - right_rev4: 0 - right_rev5: 0 - right_rev6: 0 - right_rev7: 0 diff --git a/openarm_bimanual_moveit_config/config/joint_limits.yaml b/openarm_bimanual_moveit_config/config/joint_limits.yaml deleted file mode 100644 index 69ce9b0..0000000 --- a/openarm_bimanual_moveit_config/config/joint_limits.yaml +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright 2025 Reazon Holdings, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# joint_limits.yaml allows the dynamics properties specified in the URDF to be overwritten or augmented as needed - -# For beginners, we downscale velocity and acceleration limits. -# You can always specify higher scaling factors (<= 1.0) in your motion requests. # Increase the values below to 1.0 to always move at maximum speed. -default_velocity_scaling_factor: 0.1 -default_acceleration_scaling_factor: 0.1 - -# Specific joint properties can be changed with the keys [max_position, min_position, max_velocity, max_acceleration] -# Joint limits can be turned off with [has_velocity_limits, has_acceleration_limits] -joint_limits: - left_gripper: - has_velocity_limits: true - max_velocity: 0.10000000000000001 - has_acceleration_limits: false - max_acceleration: 0 - left_rev1: - has_velocity_limits: false - max_velocity: 0 - has_acceleration_limits: false - max_acceleration: 0 - left_rev2: - has_velocity_limits: false - max_velocity: 0 - has_acceleration_limits: false - max_acceleration: 0 - left_rev3: - has_velocity_limits: false - max_velocity: 0 - has_acceleration_limits: false - max_acceleration: 0 - left_rev4: - has_velocity_limits: false - max_velocity: 0 - has_acceleration_limits: false - max_acceleration: 0 - left_rev5: - has_velocity_limits: false - max_velocity: 0 - has_acceleration_limits: false - max_acceleration: 0 - left_rev6: - has_velocity_limits: false - max_velocity: 0 - has_acceleration_limits: false - max_acceleration: 0 - left_rev7: - has_velocity_limits: false - max_velocity: 0 - has_acceleration_limits: false - max_acceleration: 0 - right_gripper: - has_velocity_limits: true - max_velocity: 0.10000000000000001 - has_acceleration_limits: false - max_acceleration: 0 - right_rev1: - has_velocity_limits: false - max_velocity: 0 - has_acceleration_limits: false - max_acceleration: 0 - right_rev2: - has_velocity_limits: false - max_velocity: 0 - has_acceleration_limits: false - max_acceleration: 0 - right_rev3: - has_velocity_limits: false - max_velocity: 0 - has_acceleration_limits: false - max_acceleration: 0 - right_rev4: - has_velocity_limits: false - max_velocity: 0 - has_acceleration_limits: false - max_acceleration: 0 - right_rev5: - has_velocity_limits: false - max_velocity: 0 - has_acceleration_limits: false - max_acceleration: 0 - right_rev6: - has_velocity_limits: false - max_velocity: 0 - has_acceleration_limits: false - max_acceleration: 0 - right_rev7: - has_velocity_limits: false - max_velocity: 0 - has_acceleration_limits: false - max_acceleration: 0 diff --git a/openarm_bimanual_moveit_config/config/kinematics.yaml b/openarm_bimanual_moveit_config/config/kinematics.yaml deleted file mode 100644 index 050f902..0000000 --- a/openarm_bimanual_moveit_config/config/kinematics.yaml +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2025 Reazon Holdings, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -left_arm: - kinematics_solver: kdl_kinematics_plugin/KDLKinematicsPlugin - kinematics_solver_search_resolution: 0.0050000000000000001 - kinematics_solver_timeout: 0.0050000000000000001 -left_side: - kinematics_solver: cached_ik_kinematics_plugin/CachedKDLKinematicsPlugin - kinematics_solver_search_resolution: 0.0050000000000000001 - kinematics_solver_timeout: 0.0050000000000000001 -right_arm: - kinematics_solver: kdl_kinematics_plugin/KDLKinematicsPlugin - kinematics_solver_search_resolution: 0.0050000000000000001 - kinematics_solver_timeout: 0.0050000000000000001 -right_side: - kinematics_solver: kdl_kinematics_plugin/KDLKinematicsPlugin - kinematics_solver_search_resolution: 0.0050000000000000001 - kinematics_solver_timeout: 0.0050000000000000001 -upper_body: - kinematics_solver: kdl_kinematics_plugin/KDLKinematicsPlugin - kinematics_solver_search_resolution: 0.0050000000000000001 - kinematics_solver_timeout: 0.0050000000000000001 diff --git a/openarm_bimanual_moveit_config/config/moveit.rviz b/openarm_bimanual_moveit_config/config/moveit.rviz deleted file mode 100644 index 6afd61b..0000000 --- a/openarm_bimanual_moveit_config/config/moveit.rviz +++ /dev/null @@ -1,562 +0,0 @@ -# Copyright 2025 Reazon Holdings, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -Panels: - - Class: rviz_common/Displays - Help Height: 70 - Name: Displays - Property Tree Widget: - Expanded: - - /MotionPlanning1 - - /MotionPlanning1/Planning Request1 - Splitter Ratio: 0.5 - Tree Height: 160 - - Class: rviz_common/Help - Name: Help - - Class: rviz_common/Views - Expanded: - - /Current View1 - Name: Views - Splitter Ratio: 0.5 -Visualization Manager: - Class: "" - Displays: - - Alpha: 0.5 - Cell Size: 1 - Class: rviz_default_plugins/Grid - Color: 160; 160; 164 - Enabled: true - Line Style: - Line Width: 0.029999999329447746 - Value: Lines - Name: Grid - Normal Cell Count: 0 - Offset: - X: 0 - Y: 0 - Z: 0 - Plane: XY - Plane Cell Count: 10 - Reference Frame: - Value: true - - Acceleration_Scaling_Factor: 0.1 - Class: moveit_rviz_plugin/MotionPlanning - Enabled: true - Move Group Namespace: "" - MoveIt_Allow_Approximate_IK: false - MoveIt_Allow_External_Program: false - MoveIt_Allow_Replanning: false - MoveIt_Allow_Sensor_Positioning: false - MoveIt_Planning_Attempts: 10 - MoveIt_Planning_Time: 5 - MoveIt_Use_Cartesian_Path: false - MoveIt_Use_Constraint_Aware_IK: false - MoveIt_Workspace: - Center: - X: 0 - Y: 0 - Z: 0 - Size: - X: 2 - Y: 2 - Z: 2 - Name: MotionPlanning - Planned Path: - Color Enabled: false - Interrupt Display: false - Links: - All Links Enabled: true - Expand Joint Details: false - Expand Link Details: false - Expand Tree: false - Link Tree Style: Links in Alphabetic Order - base_link: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_accel_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_accel_optical_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_bottom_screw_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_color_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_color_optical_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_depth_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_depth_optical_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_gyro_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_gyro_optical_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_infra1_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_infra1_optical_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_infra2_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_infra2_optical_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - left_dummy_link: - Alpha: 1 - Show Axes: false - Show Trail: false - left_gripper_center: - Alpha: 1 - Show Axes: false - Show Trail: false - left_link1: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - left_link2: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - left_link3: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - left_link4: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - left_link5: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - left_link6: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - left_link7: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - left_link8: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - left_link_left_jaw: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - left_link_right_jaw: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - pedestal_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - right_dummy_link: - Alpha: 1 - Show Axes: false - Show Trail: false - right_gripper_center: - Alpha: 1 - Show Axes: false - Show Trail: false - right_link1: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - right_link2: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - right_link3: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - right_link4: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - right_link5: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - right_link6: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - right_link7: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - right_link8: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - right_link_left_jaw: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - right_link_right_jaw: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - world: - Alpha: 1 - Show Axes: false - Show Trail: false - Loop Animation: true - Robot Alpha: 0.5 - Robot Color: 150; 50; 150 - Show Robot Collision: false - Show Robot Visual: true - Show Trail: false - State Display Time: 0.05 s - Trail Step Size: 1 - Trajectory Topic: display_planned_path - Use Sim Time: false - Planning Metrics: - Payload: 1 - Show Joint Torques: false - Show Manipulability: false - Show Manipulability Index: false - Show Weight Limit: false - TextHeight: 0.07999999821186066 - Planning Request: - Colliding Link Color: 255; 0; 0 - Goal State Alpha: 1 - Goal State Color: 250; 128; 0 - Interactive Marker Size: 0.15000000596046448 - Joint Violation Color: 255; 0; 255 - Planning Group: upper_body - Query Goal State: true - Query Start State: false - Show Workspace: false - Start State Alpha: 1 - Start State Color: 0; 255; 0 - Planning Scene Topic: monitored_planning_scene - Robot Description: robot_description - Scene Geometry: - Scene Alpha: 1 - Scene Color: 50; 230; 50 - Scene Display Time: 0.009999999776482582 - Show Scene Geometry: true - Voxel Coloring: Z-Axis - Voxel Rendering: Occupied Voxels - Scene Robot: - Attached Body Color: 150; 50; 150 - Links: - All Links Enabled: true - Expand Joint Details: false - Expand Link Details: false - Expand Tree: false - Link Tree Style: Links in Alphabetic Order - base_link: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_accel_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_accel_optical_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_bottom_screw_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_color_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_color_optical_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_depth_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_depth_optical_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_gyro_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_gyro_optical_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_infra1_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_infra1_optical_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_infra2_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_infra2_optical_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - camera_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - left_dummy_link: - Alpha: 1 - Show Axes: false - Show Trail: false - left_gripper_center: - Alpha: 1 - Show Axes: false - Show Trail: false - left_link1: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - left_link2: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - left_link3: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - left_link4: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - left_link5: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - left_link6: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - left_link7: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - left_link8: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - left_link_left_jaw: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - left_link_right_jaw: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - pedestal_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - right_dummy_link: - Alpha: 1 - Show Axes: false - Show Trail: false - right_gripper_center: - Alpha: 1 - Show Axes: false - Show Trail: false - right_link1: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - right_link2: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - right_link3: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - right_link4: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - right_link5: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - right_link6: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - right_link7: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - right_link8: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - right_link_left_jaw: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - right_link_right_jaw: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - world: - Alpha: 1 - Show Axes: false - Show Trail: false - Robot Alpha: 0.5 - Show Robot Collision: false - Show Robot Visual: true - Value: true - Velocity_Scaling_Factor: 0.1 - Enabled: true - Global Options: - Background Color: 48; 48; 48 - Fixed Frame: world - Frame Rate: 30 - Name: root - Tools: - - Class: rviz_default_plugins/Interact - Hide Inactive Objects: true - - Class: rviz_default_plugins/MoveCamera - - Class: rviz_default_plugins/Select - Transformation: - Current: - Class: rviz_default_plugins/TF - Value: true - Views: - Current: - Class: rviz_default_plugins/Orbit - Distance: 3.150280475616455 - Enable Stereo Rendering: - Stereo Eye Separation: 0.05999999865889549 - Stereo Focal Distance: 1 - Swap Stereo Eyes: false - Value: false - Focal Point: - X: -0.10000000149011612 - Y: 0.25 - Z: 0.30000001192092896 - Focal Shape Fixed Size: true - Focal Shape Size: 0.05000000074505806 - Invert Z Axis: false - Name: Current View - Near Clip Distance: 0.009999999776482582 - Pitch: 0.5 - Target Frame: world - Value: Orbit (rviz_default_plugins) - Yaw: -0.6230000257492065 - Saved: ~ -Window Geometry: - Displays: - collapsed: false - Height: 975 - Help: - collapsed: false - Hide Left Dock: false - Hide Right Dock: false - MotionPlanning: - collapsed: false - MotionPlanning - Trajectory Slider: - collapsed: false - QMainWindow State: 000000ff00000000fd0000000100000000000002b400000375fc0200000005fb00000044004d006f00740069006f006e0050006c0061006e006e0069006e00670020002d0020005400720061006a006500630074006f0072007900200053006c00690064006500720000000000ffffffff0000004100fffffffb000000100044006900730070006c006100790073010000003d00000123000000c900fffffffb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e00670100000166000001910000017d00fffffffb0000000800480065006c0070000000029a0000006e0000006e00fffffffb0000000a0056006900650077007301000002fd000000b5000000a400ffffff000001f60000037500000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 - Views: - collapsed: false - Width: 1200 - X: 120 - Y: 27 diff --git a/openarm_bimanual_moveit_config/config/moveit_controllers.yaml b/openarm_bimanual_moveit_config/config/moveit_controllers.yaml deleted file mode 100644 index 676b2fe..0000000 --- a/openarm_bimanual_moveit_config/config/moveit_controllers.yaml +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright 2025 Reazon Holdings, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# MoveIt uses this configuration for controller management - -moveit_controller_manager: moveit_simple_controller_manager/MoveItSimpleControllerManager - -moveit_simple_controller_manager: - controller_names: - - left_arm_controller - - right_arm_controller - - left_gripper_controller - - right_gripper_controller - - left_arm_controller: - type: FollowJointTrajectory - joints: - - left_rev1 - - left_rev2 - - left_rev3 - - left_rev4 - - left_rev5 - - left_rev6 - - left_rev7 - action_ns: follow_joint_trajectory - default: true - right_arm_controller: - type: FollowJointTrajectory - joints: - - right_rev1 - - right_rev2 - - right_rev3 - - right_rev4 - - right_rev5 - - right_rev6 - - right_rev7 - action_ns: follow_joint_trajectory - default: true - left_gripper_controller: - type: GripperCommand - joints: - - left_gripper - action_ns: gripper_cmd - default: true - right_gripper_controller: - type: GripperCommand - joints: - - right_gripper - action_ns: gripper_cmd - default: true diff --git a/openarm_bimanual_moveit_config/config/openarm_bimanual.srdf b/openarm_bimanual_moveit_config/config/openarm_bimanual.srdf deleted file mode 100644 index e2b3f30..0000000 --- a/openarm_bimanual_moveit_config/config/openarm_bimanual.srdf +++ /dev/null @@ -1,456 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/openarm_bimanual_moveit_config/config/openarm_bimanual.urdf.xacro b/openarm_bimanual_moveit_config/config/openarm_bimanual.urdf.xacro deleted file mode 100644 index c87d773..0000000 --- a/openarm_bimanual_moveit_config/config/openarm_bimanual.urdf.xacro +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/openarm_bimanual_moveit_config/config/pilz_cartesian_limits.yaml b/openarm_bimanual_moveit_config/config/pilz_cartesian_limits.yaml deleted file mode 100644 index 38b142a..0000000 --- a/openarm_bimanual_moveit_config/config/pilz_cartesian_limits.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2025 Reazon Holdings, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Limits for the Pilz planner -cartesian_limits: - max_trans_vel: 1.0 - max_trans_acc: 2.25 - max_trans_dec: -5.0 - max_rot_vel: 1.57 diff --git a/openarm_bimanual_moveit_config/config/ros2_controllers.yaml b/openarm_bimanual_moveit_config/config/ros2_controllers.yaml deleted file mode 100644 index 3a18e76..0000000 --- a/openarm_bimanual_moveit_config/config/ros2_controllers.yaml +++ /dev/null @@ -1,147 +0,0 @@ -# Copyright 2025 Reazon Holdings, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This config file is used by ros2_control -controller_manager: - ros__parameters: - update_rate: 100 # Hz - - left_arm_controller: - type: joint_trajectory_controller/JointTrajectoryController - - - right_arm_controller: - type: joint_trajectory_controller/JointTrajectoryController - - - left_gripper_controller: - type: position_controllers/GripperActionController - - - right_gripper_controller: - type: position_controllers/GripperActionController - - - left_side_controller: - type: joint_trajectory_controller/JointTrajectoryController - - - right_side_controller: - type: joint_trajectory_controller/JointTrajectoryController - - - upper_body_controller: - type: joint_trajectory_controller/JointTrajectoryController - - - joint_state_broadcaster: - type: joint_state_broadcaster/JointStateBroadcaster - -left_arm_controller: - ros__parameters: - joints: - - left_rev1 - - left_rev2 - - left_rev3 - - left_rev4 - - left_rev5 - - left_rev6 - - left_rev7 - command_interfaces: - - position - - velocity - state_interfaces: - - position - - velocity -right_arm_controller: - ros__parameters: - joints: - - right_rev1 - - right_rev2 - - right_rev3 - - right_rev4 - - right_rev5 - - right_rev6 - - right_rev7 - command_interfaces: - - position - - velocity - state_interfaces: - - position - - velocity -left_gripper_controller: - ros__parameters: - joint: left_gripper -right_gripper_controller: - ros__parameters: - joint: right_gripper -left_side_controller: - ros__parameters: - joints: - - left_rev1 - - left_rev2 - - left_rev3 - - left_rev4 - - left_rev5 - - left_rev6 - - left_rev7 - - left_gripper - command_interfaces: - - position - - velocity - state_interfaces: - - position - - velocity -right_side_controller: - ros__parameters: - joints: - - right_rev1 - - right_rev2 - - right_rev3 - - right_rev4 - - right_rev5 - - right_rev6 - - right_rev7 - - right_gripper - command_interfaces: - - position - - velocity - state_interfaces: - - position - - velocity -upper_body_controller: - ros__parameters: - joints: - - left_rev1 - - left_rev2 - - left_rev3 - - left_rev4 - - left_rev5 - - left_rev6 - - left_rev7 - - left_gripper - - right_rev1 - - right_rev2 - - right_rev3 - - right_rev4 - - right_rev5 - - right_rev6 - - right_rev7 - - right_gripper - command_interfaces: - - position - - velocity - state_interfaces: - - position - - velocity diff --git a/openarm_bimanual_moveit_config/config/sensors_3d.yaml b/openarm_bimanual_moveit_config/config/sensors_3d.yaml deleted file mode 100644 index 048fbc5..0000000 --- a/openarm_bimanual_moveit_config/config/sensors_3d.yaml +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2025 Reazon Holdings, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -sensors: - - default_sensor - - kinect_depthimage -default_sensor: - filtered_cloud_topic: filtered_cloud - max_range: 5.0 - max_update_rate: 1.0 - padding_offset: 0.1 - padding_scale: 1.0 - point_cloud_topic: /camera/camera/depth/color/points - point_subsample: 1 - sensor_plugin: occupancy_map_monitor/PointCloudOctomapUpdater -kinect_depthimage: - far_clipping_plane_distance: 5.0 - filtered_cloud_topic: filtered_cloud - image_topic: /head_mount_kinect/depth_registered/image_raw - max_update_rate: 1.0 - near_clipping_plane_distance: 0.3 - padding_offset: 0.03 - padding_scale: 4.0 - queue_size: 5 - sensor_plugin: occupancy_map_monitor/DepthImageOctomapUpdater - shadow_threshold: 0.2 diff --git a/openarm_bimanual_moveit_config/launch/demo.launch.py b/openarm_bimanual_moveit_config/launch/demo.launch.py deleted file mode 100644 index 08d8b80..0000000 --- a/openarm_bimanual_moveit_config/launch/demo.launch.py +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright 2025 Reazon Holdings, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from moveit_configs_utils import MoveItConfigsBuilder -from moveit_configs_utils.launches import generate_demo_launch -from launch import LaunchDescription -from launch.actions import DeclareLaunchArgument -from launch.substitutions import LaunchConfiguration, Command, PathJoinSubstitution, FindExecutable -from launch_ros.substitutions import FindPackageShare - - -def generate_launch_description(): - declared_arguments = [] - declared_arguments.append( - DeclareLaunchArgument( - "hardware_type", - default_value="real", - description="Hardware interface type: 'real', 'sim' (MuJoCo), or 'mock'", - ) - ) - declared_arguments.append( - DeclareLaunchArgument( - "mock_sensor_commands", - default_value="false", - description="Enable writable sensor interfaces when using mock hardware", - ) - ) - - hardware_type = LaunchConfiguration("hardware_type") - mock_sensor_commands = LaunchConfiguration("mock_sensor_commands") - - moveit_config = ( - MoveItConfigsBuilder("openarm_bimanual", - package_name="openarm_bimanual_moveit_config") - .robot_description( - file_path="config/openarm_bimanual.urdf.xacro", - mappings={ - "hardware_type": hardware_type, - "mock_sensor_commands": mock_sensor_commands, - }, - ) - .to_moveit_configs() - ) - - demo_ld = generate_demo_launch(moveit_config) - - ld = LaunchDescription() - - for arg in declared_arguments: - ld.add_action(arg) - - for entity in demo_ld.entities: - ld.add_action(entity) - - return ld diff --git a/openarm_bimanual_moveit_config/launch/move_group.launch.py b/openarm_bimanual_moveit_config/launch/move_group.launch.py deleted file mode 100644 index 1ea72bf..0000000 --- a/openarm_bimanual_moveit_config/launch/move_group.launch.py +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2025 Reazon Holdings, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from moveit_configs_utils import MoveItConfigsBuilder -from moveit_configs_utils.launches import generate_move_group_launch - - -def generate_launch_description(): - moveit_config = MoveItConfigsBuilder( - "openarm_bimanual", package_name="openarm_bimanual_moveit_config" - ).to_moveit_configs() - return generate_move_group_launch(moveit_config) diff --git a/openarm_bimanual_moveit_config/launch/moveit_rviz.launch.py b/openarm_bimanual_moveit_config/launch/moveit_rviz.launch.py deleted file mode 100644 index 6ba122d..0000000 --- a/openarm_bimanual_moveit_config/launch/moveit_rviz.launch.py +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2025 Reazon Holdings, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from moveit_configs_utils import MoveItConfigsBuilder -from moveit_configs_utils.launches import generate_moveit_rviz_launch - - -def generate_launch_description(): - moveit_config = MoveItConfigsBuilder( - "openarm_bimanual", package_name="openarm_bimanual_moveit_config" - ).to_moveit_configs() - return generate_moveit_rviz_launch(moveit_config) diff --git a/openarm_bimanual_moveit_config/launch/rsp.launch.py b/openarm_bimanual_moveit_config/launch/rsp.launch.py deleted file mode 100644 index 72beea6..0000000 --- a/openarm_bimanual_moveit_config/launch/rsp.launch.py +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2025 Reazon Holdings, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from moveit_configs_utils import MoveItConfigsBuilder -from moveit_configs_utils.launches import generate_rsp_launch - - -def generate_launch_description(): - moveit_config = MoveItConfigsBuilder( - "openarm_bimanual", package_name="openarm_bimanual_moveit_config" - ).to_moveit_configs() - return generate_rsp_launch(moveit_config) diff --git a/openarm_bimanual_moveit_config/launch/setup_assistant.launch.py b/openarm_bimanual_moveit_config/launch/setup_assistant.launch.py deleted file mode 100644 index fc158b4..0000000 --- a/openarm_bimanual_moveit_config/launch/setup_assistant.launch.py +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2025 Reazon Holdings, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from moveit_configs_utils import MoveItConfigsBuilder -from moveit_configs_utils.launches import generate_setup_assistant_launch - - -def generate_launch_description(): - moveit_config = MoveItConfigsBuilder( - "openarm_bimanual", package_name="openarm_bimanual_moveit_config" - ).to_moveit_configs() - return generate_setup_assistant_launch(moveit_config) diff --git a/openarm_bimanual_moveit_config/launch/spawn_controllers.launch.py b/openarm_bimanual_moveit_config/launch/spawn_controllers.launch.py deleted file mode 100644 index 95c7565..0000000 --- a/openarm_bimanual_moveit_config/launch/spawn_controllers.launch.py +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2025 Reazon Holdings, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from moveit_configs_utils import MoveItConfigsBuilder -from moveit_configs_utils.launches import generate_spawn_controllers_launch - - -def generate_launch_description(): - moveit_config = MoveItConfigsBuilder( - "openarm_bimanual", package_name="openarm_bimanual_moveit_config" - ).to_moveit_configs() - return generate_spawn_controllers_launch(moveit_config) diff --git a/openarm_bimanual_moveit_config/launch/static_virtual_joint_tfs.launch.py b/openarm_bimanual_moveit_config/launch/static_virtual_joint_tfs.launch.py deleted file mode 100644 index 6cfa2e7..0000000 --- a/openarm_bimanual_moveit_config/launch/static_virtual_joint_tfs.launch.py +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2025 Reazon Holdings, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from moveit_configs_utils import MoveItConfigsBuilder -from moveit_configs_utils.launches import generate_static_virtual_joint_tfs_launch - - -def generate_launch_description(): - moveit_config = MoveItConfigsBuilder( - "openarm_bimanual", package_name="openarm_bimanual_moveit_config" - ).to_moveit_configs() - return generate_static_virtual_joint_tfs_launch(moveit_config) diff --git a/openarm_bimanual_moveit_config/launch/warehouse_db.launch.py b/openarm_bimanual_moveit_config/launch/warehouse_db.launch.py deleted file mode 100644 index 5886bb7..0000000 --- a/openarm_bimanual_moveit_config/launch/warehouse_db.launch.py +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2025 Reazon Holdings, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from moveit_configs_utils import MoveItConfigsBuilder -from moveit_configs_utils.launches import generate_warehouse_db_launch - - -def generate_launch_description(): - moveit_config = MoveItConfigsBuilder( - "openarm_bimanual", package_name="openarm_bimanual_moveit_config" - ).to_moveit_configs() - return generate_warehouse_db_launch(moveit_config) diff --git a/openarm_bimanual_moveit_config/package.xml b/openarm_bimanual_moveit_config/package.xml deleted file mode 100644 index 40ac99d..0000000 --- a/openarm_bimanual_moveit_config/package.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - openarm_bimanual_moveit_config - 1.0.0 - - An automatically generated package with all the configuration and launch files for using the openarm_bimanual with the MoveIt Motion Planning Framework - - Thomason Zhou - - Apache-2.0 - - http://moveit.ros.org/ - https://github.com/ros-planning/moveit2/issues - https://github.com/ros-planning/moveit2 - - Thomason Zhou - - ament_cmake - - moveit_ros_move_group - moveit_kinematics - moveit_planners - moveit_simple_controller_manager - joint_state_publisher - joint_state_publisher_gui - tf2_ros - xacro - - - - controller_manager - moveit_configs_utils - moveit_ros_move_group - moveit_ros_visualization - moveit_ros_perception - moveit_setup_assistant - openarm_bimanual_description - robot_state_publisher - ros2_control - ros2_controllers - rviz2 - rviz_common - rviz_default_plugins - tf2_ros - - - - ament_cmake - - From 26b7f51d3a83929735de354072c4926af0dd2168 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 23 Jul 2025 16:26:42 +0900 Subject: [PATCH 9/9] Update license headers (#45) --- openarm/CMakeLists.txt | 2 +- ...penarm_v10_bimanual_controllers_namespaced.yaml | 14 ++++++++++++++ openarm_bringup/rviz/bimanual.rviz | 14 ++++++++++++++ openarm_hardware/CMakeLists.txt | 3 +-- .../openarm_hardware/v10_simple_hardware.hpp | 4 ++-- .../include/openarm_hardware/visibility_control.h | 2 +- openarm_hardware/openarm_hardware.xml | 2 +- openarm_hardware/package.xml | 2 +- openarm_hardware/src/v10_simple_hardware.cpp | 4 ++-- 9 files changed, 37 insertions(+), 10 deletions(-) diff --git a/openarm/CMakeLists.txt b/openarm/CMakeLists.txt index da30a8f..7d52f75 100644 --- a/openarm/CMakeLists.txt +++ b/openarm/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 2025 Reazon Holdings, Inc. +# Copyright 2025 Enactic, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/openarm_bringup/config/v10_controllers/openarm_v10_bimanual_controllers_namespaced.yaml b/openarm_bringup/config/v10_controllers/openarm_v10_bimanual_controllers_namespaced.yaml index 6892eba..ca0b972 100644 --- a/openarm_bringup/config/v10_controllers/openarm_v10_bimanual_controllers_namespaced.yaml +++ b/openarm_bringup/config/v10_controllers/openarm_v10_bimanual_controllers_namespaced.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 Enactic, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + /**: ros__parameters: update_rate: 100 # Hz diff --git a/openarm_bringup/rviz/bimanual.rviz b/openarm_bringup/rviz/bimanual.rviz index e6ad21c..6574b9a 100644 --- a/openarm_bringup/rviz/bimanual.rviz +++ b/openarm_bringup/rviz/bimanual.rviz @@ -1,3 +1,17 @@ +# Copyright 2025 Enactic, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + Panels: - Class: rviz_common/Displays Help Height: 138 diff --git a/openarm_hardware/CMakeLists.txt b/openarm_hardware/CMakeLists.txt index a76fb3e..9f1cf11 100644 --- a/openarm_hardware/CMakeLists.txt +++ b/openarm_hardware/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 2025 Reazon Holdings, Inc. +# Copyright 2025 Enactic, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. - cmake_minimum_required(VERSION 3.22) project(openarm_hardware) diff --git a/openarm_hardware/include/openarm_hardware/v10_simple_hardware.hpp b/openarm_hardware/include/openarm_hardware/v10_simple_hardware.hpp index 758944b..64f85f3 100644 --- a/openarm_hardware/include/openarm_hardware/v10_simple_hardware.hpp +++ b/openarm_hardware/include/openarm_hardware/v10_simple_hardware.hpp @@ -1,4 +1,4 @@ -// Copyright 2025 Reazon Holdings, Inc. +// Copyright 2025 Enactic, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -135,4 +135,4 @@ class OpenArm_v10HW : public hardware_interface::SystemInterface { double motor_radians_to_joint(double motor_radians); }; -} // namespace openarm_hardware \ No newline at end of file +} // namespace openarm_hardware diff --git a/openarm_hardware/include/openarm_hardware/visibility_control.h b/openarm_hardware/include/openarm_hardware/visibility_control.h index b45d9f8..e4a3a23 100644 --- a/openarm_hardware/include/openarm_hardware/visibility_control.h +++ b/openarm_hardware/include/openarm_hardware/visibility_control.h @@ -1,4 +1,4 @@ -// Copyright 2025 Reazon Holdings, Inc. +// Copyright 2025 Enactic, Inc. // Copyright 2025 Stogl Robotics Consulting UG (haftungsbeschränkt) // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/openarm_hardware/openarm_hardware.xml b/openarm_hardware/openarm_hardware.xml index 07d564b..fd4fee9 100644 --- a/openarm_hardware/openarm_hardware.xml +++ b/openarm_hardware/openarm_hardware.xml @@ -1,5 +1,5 @@