Skip to content

dual arm plan in python #3615

@ywu2014

Description

@ywu2014

Background

I'm trying to using moveit2 python environment to do dual arm plan. I found many examples with C++, but didn't found any using python. I tried below code:

...
self.cr3_arm_group: PlanningComponent = self.robot.get_planning_component("cr3_arm")
self.nova2_arm_group: PlanningComponent = self.robot.get_planning_component("nova2_arm")
self.dual_arm_group: PlanningComponent = self.robot.get_planning_component("dual_arm")
...

cr3_pose_goal = PoseStamped()
cr3_pose_goal.header.frame_id = "base_link"
cr3_pose_goal.pose.position.x = -0.299975
cr3_pose_goal.pose.position.y = -0.50000693
cr3_pose_goal.pose.position.z = 0.069975

cr3_pose_goal.pose.orientation.w = 0.0
cr3_pose_goal.pose.orientation.x = 0.0
cr3_pose_goal.pose.orientation.y = 1.0
cr3_pose_goal.pose.orientation.z = 0.0

nova2_pose_goal = PoseStamped()
nova2_pose_goal.header.frame_id = "nova2_base_link"
nova2_pose_goal.pose.position.x = 0.30004
nova2_pose_goal.pose.position.y = -0.49997307
nova2_pose_goal.pose.position.z = 0.070025

nova2_pose_goal.pose.orientation.w = 0.0
nova2_pose_goal.pose.orientation.x = 0.0
nova2_pose_goal.pose.orientation.y = 1.0
nova2_pose_goal.pose.orientation.z = 0.0

self.dual_arm_group.set_start_state_to_current_state()
self.dual_arm_group.set_goal_state(pose_stamped_msg=cr3_pose_goal, pose_link="Link6")
self.dual_arm_group.set_goal_state(pose_stamped_msg=nova2_pose_goal, pose_link="nova2_Link6")

plan_result = self.plan(self.dual_arm_group)

but it didn't work, only the second arm(nova2_arm) was planed

Image

I want to know how to plan dual arm with python, thanks.

Environment

ROS2: Humble
Moveit: Moveit2
Python: 3.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions