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

Merged
merged 95 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from 94 commits
Commits
Show all changes
95 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
0c91740
Merge branch 'og-develop' of https://github.com/StanfordVL/OmniGibson…
hang-yin Dec 16, 2024
1c67794
add reverse_preprocess_command to all curobo joint pos execution
ChengshuLi Dec 20, 2024
69651f8
fix minor bug for is_grasping in manipulation_robot
ChengshuLi Dec 20, 2024
c87d7d1
Add attached object to collision checks
hang-yin Jan 3, 2025
86d5f9b
allows user to pick robot for primitives rs int example
hang-yin Jan 3, 2025
b26aa0b
Make collision activation distance configurable; add comments to moti…
hang-yin Jan 3, 2025
02d6266
More fixes for primitives
hang-yin Jan 6, 2025
c7ccf5a
Small cuRobo changes
hang-yin Jan 9, 2025
a8ce45f
Bug fix - implement holonomic base joint controller
hang-yin Jan 9, 2025
3e0b36f
Updated primitives cfg for holonomic base and no-impedance
hang-yin Jan 9, 2025
2ca1c8f
Major primitives refactoring and bug fixes
hang-yin Jan 10, 2025
5b6104b
Minor fixes to primitives
hang-yin Jan 10, 2025
997df4f
Merge branch 'og-develop' of https://github.com/StanfordVL/OmniGibson…
hang-yin Jan 10, 2025
b750dcb
Torch to cb for holonomic base joint controller
hang-yin Jan 10, 2025
201022e
Primitive fixes
hang-yin Jan 10, 2025
0188068
Tiny fix
hang-yin Jan 10, 2025
c9b014d
Set velocity target as zero when setting position target
hang-yin Jan 10, 2025
4cf40e7
Make primitives robot settle time longer
hang-yin Jan 10, 2025
7951477
Merge branch 'fixes/controller' of https://github.com/StanfordVL/Omni…
hang-yin Jan 11, 2025
17fd4f7
Fix holonomic base joint controller angle clipping bug
hang-yin Jan 11, 2025
088bc78
Fix tests
hang-yin Jan 11, 2025
b90ea7c
Small fixes for primitive config
hang-yin Jan 11, 2025
9cf7d7b
Merge branch 'og-develop' into feat/curobo-primitives
hang-yin Jan 13, 2025
c9c694c
Add option to ignore object during curobo obstacle update
hang-yin Jan 13, 2025
bc26e06
Holonomic base control fixes; angle wrapping helper
hang-yin Jan 13, 2025
c91fd52
Bug fixes
hang-yin Jan 13, 2025
44500b8
Fix curobo motion constraint
hang-yin Jan 14, 2025
7a43f38
Fix primitives test
hang-yin Jan 14, 2025
89732ad
Fix tests
hang-yin Jan 14, 2025
f50696e
address comments
ChengshuLi Jan 15, 2025
2d6a69e
stick with robot.default_arm for primitive
ChengshuLi Jan 15, 2025
5e608a2
remove unnecessary as_float32 in holonomic base joint controller
ChengshuLi Jan 15, 2025
e85848d
address comments
ChengshuLi Jan 16, 2025
7350d2a
address comments
ChengshuLi Jan 17, 2025
4c29f32
address comments
ChengshuLi Jan 17, 2025
e9d328e
address final comments
ChengshuLi Jan 18, 2025
52e91af
fix robot test and curobo test
ChengshuLi Jan 18, 2025
0bea80c
fix primitive test, factor out sample_grasp_pose
ChengshuLi Jan 18, 2025
d02eaf1
reduce curobo batch size for primitive tests
ChengshuLi Jan 18, 2025
24dd194
fix T.align_vector_sets, minor fixes for curobo test and sampling utils
ChengshuLi Jan 21, 2025
99d8b3c
add gf_quat_to_torch
ChengshuLi Jan 22, 2025
f42dd11
add local orientation and position for joint prim
ChengshuLi Jan 22, 2025
311691e
fix update_locked_joints with arbitrary joint state
ChengshuLi Jan 22, 2025
d79d2c0
check world collision when checking reachability, minimize update_obs…
ChengshuLi Jan 22, 2025
13435ec
clean up intrinsic euler conversion, fix set pose and velocity bugs i…
ChengshuLi Jan 23, 2025
4c97748
during placing, plan with open gripper to prepare for the subsequent …
ChengshuLi Jan 23, 2025
10e7f39
Use upload artifacts v4
cgokmen Jan 23, 2025
16adfbe
fix curobo commit hash, slightly improve primitive test
ChengshuLi Jan 24, 2025
1677925
Merge branch 'feat/curobo-primitives' of https://github.com/StanfordV…
ChengshuLi Jan 24, 2025
bda9ea1
uncomment th.jit.script
ChengshuLi Jan 24, 2025
a5ce569
add a few more TODO items for primitives
ChengshuLi Jan 24, 2025
d5a8c54
add onre more TODO
ChengshuLi Jan 24, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
continue-on-error: true

- name: Deploy artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ github.run_id }}-tests-${{ matrix.test_file }}
path: ${{ matrix.test_file }}.xml
Expand Down
2 changes: 1 addition & 1 deletion docker/prod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ RUN wget --no-verbose -O /cuda-keyring.deb https://developer.download.nvidia.com
DEBIAN_FRONTEND=noninteractive apt-get install -y cuda-toolkit-11-8 && \
TORCH_CUDA_ARCH_LIST='7.5;8.0;8.6+PTX' PATH=/usr/local/cuda-11.8/bin:$PATH LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH \
micromamba run -n omnigibson pip install \
git+https://github.com/StanfordVL/curobo@6a4eb2ca8677829b0f57451ad107e0a3186525e9#egg=nvidia_curobo \
git+https://github.com/StanfordVL/curobo@cbaf7d32436160956dad190a9465360fad6aba73#egg=nvidia_curobo \
ChengshuLi marked this conversation as resolved.
Show resolved Hide resolved
--no-build-isolation > /dev/null && \
apt-get remove -y cuda-toolkit-11-8 && apt-get autoremove -y && apt-get autoclean -y && rm -rf /var/lib/apt/lists/*

Expand Down
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
373 changes: 298 additions & 75 deletions omnigibson/action_primitives/curobo.py

Large diffs are not rendered by default.

1,449 changes: 751 additions & 698 deletions omnigibson/action_primitives/starter_semantic_action_primitives.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class SymbolicSemanticActionPrimitiveSet(IntEnum):


class SymbolicSemanticActionPrimitives(StarterSemanticActionPrimitives):
def __init__(self, env):
super().__init__(env)
def __init__(self, env, robot):
super().__init__(env, robot, skip_curobo_initilization=True)
self.controller_functions = {
SymbolicSemanticActionPrimitiveSet.GRASP: self._grasp,
SymbolicSemanticActionPrimitiveSet.PLACE_ON_TOP: self._place_on_top,
Expand All @@ -59,12 +59,12 @@ def __init__(self, env):
SymbolicSemanticActionPrimitiveSet.RELEASE: self._release,
}

def apply_ref(self, prim, *args, attempts=3):
def apply_ref(self, primitive, *args, attempts=3):
"""
Yields action for robot to execute the primitive with the given arguments.

Args:
prim (SymbolicSemanticActionPrimitiveSet): Primitive to execute
primitive (SymbolicSemanticActionPrimitiveSet): Primitive to execute
args: Arguments for the primitive
attempts (int): Number of attempts to make before raising an error

Expand All @@ -75,7 +75,7 @@ def apply_ref(self, prim, *args, attempts=3):
ActionPrimitiveError: If primitive fails to execute
"""
assert attempts > 0, "Must make at least one attempt"
ctrl = self.controller_functions[prim]
ctrl = self.controller_functions[primitive]

if any(isinstance(arg, BaseRobot) for arg in args):
raise ActionPrimitiveErrorGroup(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ env:
flatten_action_space: false # (bool): whether to flatten the action space as a sinle 1D-array
flatten_obs_space: false # (bool): whether the observation space should be flattened when generated
use_external_obs: false # (bool): Whether to use external observations or not
initial_pos_z_offset: 0.1
external_sensors: null # (None or list): If specified, list of sensor configurations for external sensors to add. Should specify sensor "type" and any additional kwargs to instantiate the sensor. Each entry should be the kwargs passed to @create_sensor, in addition to position, orientation

render:
Expand All @@ -31,36 +30,83 @@ scene:
include_robots: false

robots:
- type: Fetch
- type: R1
obs_modalities: [rgb]
scale: 1.0
self_collisions: true
action_normalize: false
action_type: continuous
grasping_mode: sticky
default_arm_pose: diagonal30
reset_joint_pos: [
0.0000,
-0.0000,
0.0247,
0.0009,
0.0004,
-0.0000,
0.0000,
0.0000,
0.0000,
0.0000,
-0.0464,
0.0464,
2.6172,
2.6168,
-1.4584,
-1.4570,
-0.0433,
0.0418,
1.5899,
-1.5896,
-1.1587,
1.1593,
0.0300,
0.0300,
0.0300,
0.0300,
]
sensor_config:
VisionSensor:
sensor_kwargs:
image_height: 128
image_width: 128
controller_config:
base:
name: DifferentialDriveController
name: HolonomicBaseJointController
motor_type: position
command_input_limits: null
use_impedances: false
trunk:
name: JointController
arm_0:
motor_type: position
command_input_limits: null
use_delta_commands: false
use_impedances: false
arm_left:
name: JointController
motor_type: position
command_input_limits: null
use_delta_commands: false
use_impedances: false
arm_right:
name: JointController
subsume_controllers: [trunk]
motor_type: position
command_input_limits: null
use_delta_commands: false
gripper_0:
use_impedances: false
gripper_left:
name: JointController
motor_type: position
command_input_limits: [-1, 1]
command_output_limits: null
command_input_limits: null
use_delta_commands: false
camera:
use_impedances: false
gripper_right:
name: JointController
use_delta_commands: False
motor_type: position
command_input_limits: null
use_delta_commands: false
use_impedances: false

objects: []

task:
type: DummyTask
59 changes: 48 additions & 11 deletions omnigibson/configs/tiago_primitives.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,51 +32,88 @@ scene:

robots:
- type: Tiago
obs_modalities: [rgb, depth, seg_semantic, normal, seg_instance, seg_instance_id]
obs_modalities: [rgb]
scale: 1.0
self_collisions: true
action_normalize: false
action_type: continuous
grasping_mode: sticky
default_arm_pose: vertical
reset_joint_pos: [
hang-yin marked this conversation as resolved.
Show resolved Hide resolved
0.0000,
0.0000,
-0.0000,
-0.0000,
-0.0000,
-0.0000,
0.3500,
0.9052,
0.9052,
0.0000,
-0.4281,
-0.4281,
-0.4500,
2.2350,
2.2350,
1.6463,
1.6463,
0.7687,
0.7687,
-0.7946,
-0.7946,
-1.0891,
-1.0891,
0.0450,
0.0450,
0.0450,
0.0450,
]
sensor_config:
VisionSensor:
sensor_kwargs:
image_height: 128
image_width: 128
controller_config:
base:
name: JointController
name: HolonomicBaseJointController
motor_type: position
command_input_limits: null
use_impedances: false
trunk:
name: JointController
motor_type: position
command_input_limits: null
use_delta_commands: false
use_impedances: false
arm_left:
name: JointController
subsume_controllers: [trunk]
motor_type: position
command_input_limits: null
command_output_limits: null
use_delta_commands: false
use_impedances: False
arm_right:
name: JointController
motor_type: position
command_input_limits: null
command_output_limits: null
use_delta_commands: false
use_impedances: false
gripper_left:
name: JointController
motor_type: position
command_input_limits: [-1, 1]
command_output_limits: null
command_input_limits: null
use_delta_commands: false
use_impedances: false
gripper_right:
name: JointController
motor_type: position
command_input_limits: [-1, 1]
command_output_limits: null
command_input_limits: null
use_delta_commands: false
use_impedances: false
camera:
name: JointController

motor_type: position
command_input_limits: null
use_delta_commands: false
ChengshuLi marked this conversation as resolved.
Show resolved Hide resolved
use_impedances: false
objects: []

task:
Expand Down
2 changes: 2 additions & 0 deletions omnigibson/controllers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
ManipulationController,
)
from omnigibson.controllers.dd_controller import DifferentialDriveController
from omnigibson.controllers.holonomic_base_joint_controller import HolonomicBaseJointController
from omnigibson.controllers.ik_controller import InverseKinematicsController
from omnigibson.controllers.joint_controller import JointController
from omnigibson.controllers.multi_finger_gripper_controller import MultiFingerGripperController
Expand Down Expand Up @@ -39,6 +40,7 @@ def create_controller(name, **kwargs):
"create_controller",
"DifferentialDriveController",
"GripperController",
"HolonomicBaseJointController",
"InverseKinematicsController",
"IsGraspingState",
"JointController",
Expand Down
Loading
Loading