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
Open
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
3123d1d
Remove OMPL and robot copy from primitives
hang-yin Nov 4, 2024
f94c760
Merge branch 'feat/curobo-improved' of https://github.com/StanfordVL/…
hang-yin Nov 5, 2024
5871adc
Refactor action primitives and replace OMPL with curobo for manipulation
hang-yin Nov 5, 2024
f902e86
Minor primitives refactoring
hang-yin Nov 6, 2024
8f73b6f
Completely remove OMPL planning context from action primitives plus r…
hang-yin Nov 6, 2024
ee0f8f6
Merge branch 'feat/curobo-improved' into feat/curobo-primitives
hang-yin Nov 6, 2024
5740749
Merge branch 'feat/curobo-improved' of https://github.com/StanfordVL/…
hang-yin Nov 6, 2024
519f5e5
Fix grasp pose bug
hang-yin Nov 8, 2024
0fbefe7
Primitives & curobo bug fixes - grasp mostly working
hang-yin Nov 8, 2024
749d2cf
Refactor primitives and get grasp working
hang-yin Nov 8, 2024
9f0e101
Merge branch 'feat/curobo-improved' of https://github.com/StanfordVL/…
hang-yin Nov 8, 2024
c06029c
Make primitives more robust and fast; add debug marker
hang-yin Nov 11, 2024
ced8693
Merge branch 'feat/curobo-improved' of https://github.com/StanfordVL/…
hang-yin Nov 11, 2024
c1b4986
Adapt curobo primitives to Tiago; call curobo planning and collision …
hang-yin Nov 12, 2024
863f3b6
Merge branch 'feat/curobo-improved' of https://github.com/StanfordVL/…
hang-yin Nov 12, 2024
671db19
Tune batch size to avoid gpu memory error
hang-yin Nov 12, 2024
b3fd62b
Add integral term to joint controller
hang-yin Nov 12, 2024
81647d3
Move hand upwards by a little after grasp to avoid getting stuck
hang-yin Nov 12, 2024
9e5c349
Merge branch 'feat/curobo-primitives' of https://github.com/StanfordV…
hang-yin Nov 12, 2024
071baa3
Add reset robot for arms and torso
hang-yin Nov 12, 2024
7ba8054
Fix head tracking
hang-yin Nov 13, 2024
6b8b670
Disable eef tracking by default; add low precision mode for motion pl…
hang-yin Nov 14, 2024
08e9b14
Merge branch 'feat/curobo-improved' of https://github.com/StanfordVL/…
hang-yin Nov 14, 2024
ec5d68b
Support for arm setting
hang-yin Nov 15, 2024
4466ee5
Robustify grasp primitive
hang-yin Nov 18, 2024
6e5682b
Add arm locking mode
hang-yin Nov 19, 2024
267fad0
Subsumed pull request #934
hang-yin Nov 19, 2024
90c3b0c
Merge branch 'feat/curobo-improved' of https://github.com/StanfordVL/…
hang-yin Nov 19, 2024
3615f24
Merge branch 'feat/curobo-improved' of https://github.com/StanfordVL/…
hang-yin Nov 19, 2024
bd6768a
Merge branch 'feat/curobo-improved' of https://github.com/StanfordVL/…
hang-yin Nov 20, 2024
b4c83c7
Make primitives faster and more robust
hang-yin Nov 21, 2024
c7629d3
Quick fix for ag state
hang-yin Nov 22, 2024
2dfa062
Merge branch 'og-develop' into feat/curobo-primitives
hang-yin Nov 25, 2024
09e68f5
Merge branch 'feat/curobo-primitives' of https://github.com/StanfordV…
hang-yin Dec 3, 2024
f24e4b9
Primitives clean up
hang-yin Dec 3, 2024
a997b28
More primitives refactoring
hang-yin Dec 4, 2024
b93185e
add IK-only mode for curobo
ChengshuLi Dec 11, 2024
fe3c003
remove test_curobo.py from all robots
ChengshuLi Dec 11, 2024
5b9d242
Merge branch 'og-develop' into feat/curobo-primitives
ChengshuLi Dec 11, 2024
82fffbe
syntax fix
ChengshuLi Dec 11, 2024
21fa12e
use curobo for IK in primitive
ChengshuLi Dec 11, 2024
b284d28
cleanup robot and world frame
ChengshuLi Dec 11, 2024
1eb7244
Fix unit test failures
hang-yin Dec 13, 2024
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
11 changes: 3 additions & 8 deletions omnigibson/action_primitives/action_primitive_set_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,9 @@ def __init_subclass__(cls, **kwargs):
if not inspect.isabstract(cls):
REGISTERED_PRIMITIVE_SETS[cls.__name__] = cls

def __init__(self, env):
def __init__(self, env, robot):
self.env = env

@property
def robot(self):
# Currently returns the first robot in the environment, but can be scaled to multiple robots
# by creating multiple action generators and passing in a robot index etc.
return self.env.robots[0]
self.robot = robot

@abstractmethod
def get_action_space(self):
Expand All @@ -84,7 +79,7 @@ def apply(self, action):
pass

@abstractmethod
def apply_ref(self, action, *args):
def apply_ref(self, primitive, *args):
"""
Apply a primitive action by reference.

Expand Down
25 changes: 20 additions & 5 deletions omnigibson/action_primitives/curobo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

self_collision_check=True,
maximum_trajectory_dt=None,
fixed_iters_trajopt=True,
Expand Down Expand Up @@ -336,6 +336,7 @@ def check_collisions(
self,
q,
check_self_collision=True,
skip_obstacle_update=False,
):
"""
Checks collisions between the sphere representation of the robot and the rest of the current scene
Expand All @@ -353,7 +354,8 @@ def check_collisions(
emb_sel = CuroboEmbodimentSelection.DEFAULT

# Update obstacles
self.update_obstacles()
if not skip_obstacle_update:
self.update_obstacles()

q_pos = self.robot.get_joint_positions().unsqueeze(0)
cu_joint_state = lazy.curobo.types.state.JointState(
Expand Down Expand Up @@ -428,7 +430,9 @@ def compute_trajectories(
return_full_result=False,
success_ratio=None,
attached_obj=None,
motion_constraint=None,
attached_obj_scale=None,
skip_obstacle_update=False,
emb_sel=CuroboEmbodimentSelection.DEFAULT,
):
"""
Expand Down Expand Up @@ -509,8 +513,16 @@ def compute_trajectories(
success_ratio=1.0 / self.batch_size if success_ratio is None else success_ratio,
)

# Refresh the collision state
self.update_obstacles()
# 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?


if not skip_obstacle_update:
self.update_obstacles()

for link_name in target_pos.keys():
target_pos_link = target_pos[link_name]
Expand Down Expand Up @@ -581,9 +593,12 @@ def compute_trajectories(
object_names=obj_paths,
ee_pose=ee_pose,
link_name=self.robot.curobo_attached_object_link_names[ee_link_name],
scale=0.99 if attached_obj_scale is None else attached_obj_scale[ee_link_name],
scale=1.0 if attached_obj_scale is None else attached_obj_scale[ee_link_name],
pitch_scale=1.0,
merge_meshes=True,
world_objects_pose_offset=lazy.curobo.types.math.Pose.from_list(
[0, 0, 0.01, 1, 0, 0, 0], self._tensor_args
),
Comment on lines +670 to +672
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.

)

all_rollout_fns = [
Expand Down
Loading
Loading