Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attach collision objects when planning motion #5

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions isaac_ros_cumotion/isaac_ros_cumotion/cumotion_planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,22 @@ def execute_callback(self, goal_handle):
else:
start_state = current_joint_state

# attach object to end effector:
objs = []
for obj in scene.robot_state.attached_collision_objects:
collision_objects, supported_objects = self.get_cumotion_collision_object(obj.object)
if supported_objects:
objs.extend(collision_objects)
if objs:
self.get_logger().info(f'Attach object to link {obj.link_name}')
ee_pose = self.motion_gen.compute_kinematics(start_state).ee_pose
self.motion_gen.attach_external_objects_to_robot(
start_state,
objs,
link_name=obj.link_name,
world_objects_pose_offset=ee_pose,
)

if len(plan_req.goal_constraints[0].joint_constraints) > 0:
self.get_logger().info('Calculating goal pose from Joint target')
goal_config = [
Expand Down