Open zhangbo9426426 opened 9 months ago
Seems the controller is not activated.
[both_arm_controller]: Can't accept new action goals. Controller is not running.
Thank you for the tip. I browsed the ros2_controllers.yaml file and it seems to be working fine.The following is the contents of the file:
controller_manager: ros__parameters: update_rate: 100
left_arm_controller: type: joint_trajectory_controller/JointTrajectoryController right_arm_controller: type: joint_trajectory_controller/JointTrajectoryController both_arm_controller: type: joint_trajectory_controller/JointTrajectoryController joint_state_broadcaster: type: joint_state_broadcaster/JointStateBroadcaster
left_arm_controller:
ros__parameters: joints:
- robot_joint1_l
- robot_joint2_l
- robot_joint3_l
- robot_joint4_l
- robot_joint5_l
- robot_joint6_l command_interfaces:
- position state_interfaces:
- position
- velocity right_arm_controller: ros__parameters: joints:
- robot_joint1_r
- robot_joint2_r
- robot_joint4_r
- robot_joint5_r
- robot_joint6_r
- robot_joint7_r command_interfaces:
- position state_interfaces:
- position
- velocity both_arm_controller: ros__parameters: joints:
- robot_joint1_l
- robot_joint2_l
- robot_joint3_l
- robot_joint4_l
- robot_joint5_l
- robot_joint6_l
- robot_joint1_r
- robot_joint2_r
- robot_joint4_r
- robot_joint5_r
- robot_joint6_r
- robot_joint7_r command_interfaces:
- position state_interfaces:
- position
- velocity
In addition, when demo.launch is just started, I check the terminal output information about both_arm_controllers as follows:
[spawner-7] [INFO] [1708439166.190132793] [spawner_both_arm_controller]: Loaded both_arm_controller [ros2_control_node-4] [INFO] [1708439166.191525742] [controller_manager]: Configuring controller 'both_arm_controller' [ros2_control_node-4] [INFO] [1708439166.191724376] [both_arm_controller]: No specific joint names are used for command interfaces. Using 'joints' parameter. [ros2_control_node-4] [INFO] [1708439166.191740117] [both_arm_controller]: Command interfaces are [position] and state interfaces are [position velocity]. [ros2_control_node-4] [INFO] [1708439166.191786248] [both_arm_controller]: Using 'splines' interpolation method. [ros2_control_node-4] [INFO] [1708439166.192174940] [both_arm_controller]: Controller state will be published at 50.00 Hz. [ros2_control_node-4] [INFO] [1708439166.192842625] [both_arm_controller]: Action status changes will be monitored at 20.00 Hz. [ros2_control_node-4] [ERROR] [1708439166.208465603] [controller_manager]: Resource conflict for controller 'both_arm_controller'. Command interface 'robot_joint1_l/position' is already claimed. [spawner-7] [INFO] [1708439166.219404553] [spawner_both_arm_controller]: Configured and activated both_arm_controller
Therer is a error:
[controller_manager]: Resource conflict for controller 'both_arm_controller'. Command interface 'robot_joint1_l/position' is already claimed.
I wonder if this error is to blame.
It seems that the problem is indeed resource conflict. After I delete the two separate planning groups left_arm and right_arm and keep only the planning group both_arm, I can successfully plan and execute the dual-robot at the same time.
However, when I have three planning groups in ROS1, left_arm, right_arm and both_arm, this problem does not occur. I can plan and execute for single robot or dual-robot.
Is there a solution to this resource conflict problem in moveit2?
Right! Because both_arm_controller
claims the same hardware interfaces as the other ones, they can't both be activated at the same time. So you'll need to call into the ros2_control
API to activate/deactivate the right controllers.
If you were running your robot from MoveIt2 code (and not RViz), there are ways around it where MoveIt will take care of this for you, like explicitly specifying the controller names you want in your planning request.
Move Group Interface: https://github.com/ros-planning/moveit2/pull/2257
MoveItCpp: https://github.com/ros-planning/moveit2/pull/1838
Thank you for your answer, I will go to learn about these methods.
Description
There is a dual-robot urdf model that used to work normally in ros1, and now the function pack is built in ros2 with moveit2_setup_assistant. Three planning groups are set:
left_arm
,right_arm
, andboth_arm
(including left_arm and right_arm). Rundemo.launch.py
, the planning and execution of a single robot are all normal. However, when both_arm is selected to plan dual-robot, the planning succeeds but the execution fails.Your environment
git clone https://github.com/ros-planning/moveit2_tutorials -b humble --depth 1 moveit2_ws/src/moveit2_tutorials
vcs import < moveit2_tutorials/moveit2_tutorials.repos
Backtrace or Console output
Select both_arm planning group, then When I click
plan
in motionplanning in rviz, the terminal output:When I click
execute
in motionplanning in rviz, the terminal output: