Skip to content

[Feature] Added RGBD diffusion policy implementation as well as Draw Triangle and Draw SVG task #643

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

Merged
merged 49 commits into from
Feb 22, 2025

Conversation

arnavg115
Copy link
Collaborator

@arnavg115 arnavg115 commented Oct 21, 2024

DrawTriangle, DrawSVG: #638
Diff policy RGBD: #616

MP_SOLUTIONS = {"DrawTriangle-v1": solveDrawTriangle}


def parse_args(args=None):
Copy link
Member

Choose a reason for hiding this comment

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

thanks for adding this file.

we might want to consider having a more unified motion planning interface for all robots with some base classes and run scripts etc., this should be fine for now though!

@@ -50,7 +51,12 @@ def observation(self, observation: Dict):
if self.include_rgb and not self.include_depth:
ret["rgb"] = images
elif self.include_rgb and self.include_depth:
ret["rgbd"] = images
# todo: might not be the best way or the right place to perform this
Copy link
Member

Choose a reason for hiding this comment

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

remove the todo. I think this is fine. I normally myself wouldn't merge rgb and depth but this is just for compatibility with a lot of old code from MS2 that assumed "rgbd" as a key.

@@ -0,0 +1,330 @@
import math
Copy link
Member

Choose a reason for hiding this comment

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

image

Is it possible to make the outline 1. not transparent and 2. just be below the dots/ink? instead of over it. Looks a bit strange here

to create their own drawing type tasks.
"""

MAX_DOTS = 1010
Copy link
Member

Choose a reason for hiding this comment

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

reduce this down significantly, maybe to 300. and max episode steps should be down to 300

vis=vis,
base_pose=env.unwrapped.agent.robot.pose,
visualize_target_grasp_pose=vis,
print_env_info=False,
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 lower the max allowed joint velocities? Right now the result drawings are a bit too fast (dots are too spread out).

maybe lets tune it so that the typical solve time is about the 200-250 steps mark



def make_eval_envs(env_id, num_envs: int, sim_backend: str, env_kwargs: dict, other_kwargs: dict, video_dir: Optional[str] = None, wrappers: list[gym.Wrapper] = []):
class DictFrameStack(GymFrameStack):
Copy link
Member

Choose a reason for hiding this comment

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

can this not just inherit the maniskill frame stack wrapper?

I purposely didn't use the original framestack wrapper from gymnasium since it was not properly GPU parallelized.

@arnavg115 arnavg115 changed the title Added RGBD diffusion policy implementation as well as Draw Triangle task Added RGBD diffusion policy implementation as well as Draw Triangle and Draw SVG task Oct 31, 2024
Copy link
Member

@StoneT2000 StoneT2000 left a comment

Choose a reason for hiding this comment

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

Add a new baselines.sh file and update README to point to that file. Write a script to train for each of the tasks you tested, using the datasets generated by the script here: https://github.com/haosulab/ManiSkill/blob/main/scripts/data_generation/replay_for_il_baselines.sh

Also make sure to add a draw triangle replay trajectory script to the file above.

@StoneT2000
Copy link
Member

all the changes nearly look ready. I will make a few small edits on baselines.sh file to be closer to what we did to act baselines. The diffusion policy one i did before for state based results is kind of hard to read, it was meant to experiment with DP training on motion planning or RL generated datasets (but doing that needs tuning other hyparameters anyway).

Will also merge in #870 which is blocking me from easily testing all the baselines and uploading results to wandb since things take forever for the physx_cpu evals.

@StoneT2000 StoneT2000 changed the base branch from main to dp-cleanup February 22, 2025 18:26
@StoneT2000 StoneT2000 changed the title Added RGBD diffusion policy implementation as well as Draw Triangle and Draw SVG task [Feature] Added RGBD diffusion policy implementation as well as Draw Triangle and Draw SVG task Feb 22, 2025
@StoneT2000
Copy link
Member

Merging to a separate branch for now so i make the final minor changes and merge. nice work!

@StoneT2000 StoneT2000 merged commit 109f50d into haosulab:dp-cleanup Feb 22, 2025
StoneT2000 added a commit that referenced this pull request Feb 25, 2025
* [Feature] Added RGBD diffusion policy implementation as well as Draw Triangle and Draw SVG task (#643)

* Added draw triangle with success condition

* parallelized progress

* fixed triangle rotation issues

* clean up and format

* rgbd diffusion policy progress

* diff policy rgbd cpu fixes

* minor diff policy fixes and finished draw triangle parallelization

* Added depth arg to diff pol rgbd + formatting

* Removed unused code

* Made requested fixes, made bugfix to frame stack wrapper

* Edited make_env and frame_stack

* Added state obs to draw triangle

* Update draw_triangle max steps

* Added DrawTriangle Docs

* Fixed naming

* draw svg progress

* fixed most issues and parallelized draw svg

* Update draw_svg.py

* added success condition and state based obs

* Added discontinuous paths for draw svg

* formatting, discontinuous state

* Updated run.py

* fixed state obs error for drawing envs

* Changed drawsvg imports

* Update draw_svg.py

* Update draw_svg.py

* Small bugfix

* Update draw_svg.py

* Update draw_svg.py

* Update draw_triangle.py

* Bugfixes, speed progress

* success condition speed up

* small fix

* Updated draw_triangle

* drawing env gpu bugfixes

* diff poll rgbd fixes

* minor changes

* fix for wandb logging

* autobuild docs for DrawTriangle and SVG

* Update utils.py to add PushCube

* adjustments for rgb

* added initial pose for drawing envs

* Update draw_triangle.py

* adjusted training arguments and shell scripts

* StackCube fix

* work

* w

* w

* w

* w

* w

* w

* w

* update docs

* update docs

* work

* w

* Update utils.py

* remove dead code

* Update flatten.py

* Update flatten.py

* fix flatten wrapper

* possibly better docs

* simplify cli args and remove assumption of rgb existing

* Update README.md

---------

Co-authored-by: Arnav G. <[email protected]>
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