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

Integrate cuRobo into action primitives & primitives refactoring #1027

Open
wants to merge 43 commits into
base: og-develop
Choose a base branch
from

Conversation

hang-yin
Copy link
Contributor

@hang-yin hang-yin commented Nov 6, 2024

  • Replace OMPL planning context with cuRobo motion planning & collision checking
  • Implement cuRobo single IK solver for robot reachability test
  • Implement linear motion in cartesian space with cuRobo constrained planning
  • Generalize primitives to dual-arm settings
  • Investigate why cuRobo planning keeps failing if we do not do reset+gripper matching
  • Accommodate differential drive base planning (implement a light-weight RRT)
tiago_primitives_demo.mov

@hang-yin hang-yin self-assigned this Nov 6, 2024
…checks in batched mode; generalize primitives to dual-arm setting
Base automatically changed from feat/curobo-improved to og-develop November 22, 2024 07:45
@hang-yin hang-yin changed the title [WIP] Integrate cuRobo into action primitives & primitives refactoring Integrate cuRobo into action primitives & primitives refactoring Dec 4, 2024
@hang-yin hang-yin marked this pull request as ready for review December 4, 2024 01:01
@@ -228,7 +228,7 @@ def __init__(
num_trajopt_seeds=4,
num_graph_seeds=4,
interpolation_dt=0.03,
collision_activation_distance=0.005,
collision_activation_distance=0.05,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we make this configurable from the outside? Also, 0.05 seems a bit too large, not sure.

Comment on lines 516 to 522
# Add the pose cost metric
if motion_constraint is None:
motion_constraint = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
pose_cost_metric = lazy.curobo.wrap.reacher.motion_gen.PoseCostMetric(
hold_partial_pose=False, hold_vec_weight=self._tensor_args.to_device(motion_constraint)
)
plan_cfg.pose_cost_metric = pose_cost_metric
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add some comments to explain what this means?
for example, if someone passes in motion constraint [1, 0, 0, 0, 0 ,0], what does it mean?

Comment on lines +599 to +601
world_objects_pose_offset=lazy.curobo.types.math.Pose.from_list(
[0, 0, 0.01, 1, 0, 0, 0], self._tensor_args
),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm I still prefer using scale rather than world_objects_pose_offset. IMO "shrinking" the object is still better than "lifting" the object.

arm_left:
name: JointController
subsume_controllers: [trunk]
# subsume_controllers: [trunk]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why comment out?

use_impedances: true
pos_kp: 200
pos_ki: 0.5
max_integral_error: 10.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this?

Comment on lines +1474 to +1480
if isinstance(self.robot, Fetch):
pose = {
self.arm: (
th.tensor([0.48688125, -0.12507881, 0.97888719]),
th.tensor([0.61324748, 0.61305553, -0.35266518, 0.35173529]),
)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove fetch?

Comment on lines +1481 to +1513
elif isinstance(self.robot, R1):
pose = {
self.robot.arm_names[0]: (
th.tensor([0.43, 0.2, 1.2]),
th.tensor([1.0, 0.0, 0.0, 0.0]),
),
self.robot.arm_names[1]: (
th.tensor([0.43, -0.2, 1.2]),
th.tensor([-1.0, 0.0, 0.0, 0.0]),
),
}
elif isinstance(self.robot, Tiago):
# TODO: default trunk position vs. raised trunk position
# pose = {
# self.robot.arm_names[0]: (
# th.tensor([0.4997, 0.2497, 0.6357]),
# th.tensor([-0.5609, 0.5617, 0.4299, 0.4302]),
# ),
# self.robot.arm_names[1]: (
# th.tensor([0.4978, -0.2521, 0.6357]),
# th.tensor([-0.5609, -0.5617, 0.4299, -0.4302]),
# ),
# }
pose = {
self.robot.arm_names[0]: (
th.tensor([0.5021, 0.2458, 0.7648]),
th.tensor([-0.5599, 0.5649, 0.4303, 0.4269]),
),
self.robot.arm_names[1]: (
th.tensor([0.4999, -0.2486, 0.7633]),
th.tensor([-0.5592, -0.5646, 0.4311, -0.4274]),
),
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the same as the reset joint pos?

@@ -1584,12 +1571,12 @@ def _get_reset_joint_pos(self):
4.50000000e-02,
]
)
if self.robot_model == "Fetch":
if isinstance(self.robot, Fetch):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove fetch and add R1?

context=context,
)
pose_3d = self._get_robot_pose_from_2d_pose(pose_2d)
# TODO: why was this 0.1?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this comment still valid?

@@ -2042,12 +2049,13 @@ def _settle_robot(self):
Returns:
th.tensor or None: Action array for one step for the robot to do nothing
"""
# TODO: fix empty action
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this comment still valid?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants