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

Merge refined codebase from hackathon branch to main. #64

Closed
wants to merge 72 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
5ca9e84
add stretch3 and bathing demo (wip)
YoruCathy Apr 17, 2024
f6c4b05
remove bullet ik
YoruCathy Apr 19, 2024
534ec23
bathing demo
YoruCathy Apr 19, 2024
40ebce9
exe path
YoruCathy Apr 20, 2024
4753de6
add mac
YoruCathy Apr 20, 2024
ab137ba
test install for windows mac and linux
YoruCathy Apr 21, 2024
edbe810
Added build outputs to LFS.
YoruCathy Apr 21, 2024
2f11154
install guide
YoruCathy Apr 21, 2024
b9e993e
hackathon branch instruction
YoruCathy Apr 21, 2024
f7da5e4
path
YoruCathy Apr 21, 2024
8d718e6
add example commands
YoruCathy Apr 21, 2024
7bee8ba
- Made changes to the README.md to make directions more clear for hac…
AnthonyBSong Apr 21, 2024
58a1ece
- Reworked the README.md
AnthonyBSong Apr 21, 2024
6acac7b
Add sponge attribute
thisjustin123 Apr 21, 2024
31c9e33
Merge branch 'hackathon' into justin/hackathon-sponge-and-wetting
thisjustin123 Apr 21, 2024
46619ac
- Changed README.md
AnthonyBSong Apr 21, 2024
b4dcfc0
- Changed README.md
AnthonyBSong Apr 21, 2024
b6f8da6
- Changes to README.md
AnthonyBSong Apr 21, 2024
9689808
- Removed unnecessary .save file
AnthonyBSong Apr 21, 2024
b8d259b
Merge pull request #49 from AnthonyBSong/hackathon
AnthonyBSong Apr 21, 2024
33dabca
- Changed the README.md in the Hackathon branch to make directions mo…
AnthonyBSong Apr 21, 2024
9fdd4b9
- Fixed typos on README.md in the Hackathon branch.
AnthonyBSong Apr 21, 2024
ac74471
mac fake x8664 command
YoruCathy Apr 21, 2024
4d8c079
Merge branch 'hackathon' of github.com:empriselab/RCareWorld into hac…
YoruCathy Apr 21, 2024
46fac90
Add force and paint proportion data
thisjustin123 Apr 22, 2024
eda1105
Merge remote-tracking branch 'origin/hackathon' into justin/hackathon…
thisjustin123 Apr 22, 2024
aa0a201
- Made changes to README.md to include how to test to make sure insta…
AnthonyBSong Apr 22, 2024
d2ab7a9
- Added image.
AnthonyBSong Apr 22, 2024
847770e
- Fixed README.md so that image should show.
AnthonyBSong Apr 22, 2024
1da22c1
Image
AnthonyBSong Apr 22, 2024
67ada82
Fixed titling on README.md
AnthonyBSong Apr 22, 2024
0df13d9
Merge pull request #51 from AnthonyBSong/hackathon
AnthonyBSong Apr 22, 2024
8a4d1e2
conda environment activation and fixed the test_install_mac
AnthonyBSong Apr 22, 2024
fcaf143
Merge pull request #52 from AnthonyBSong/hackathon
YoruCathy Apr 22, 2024
74d39ef
bathing tmp
YoruCathy Apr 22, 2024
a793b7f
Merge pull request #50 from thisjustin123/justin/hackathon-sponge-and…
YoruCathy Apr 22, 2024
9a86c7e
Merge branch 'hackathon' of github.com:empriselab/RCareWorld into hac…
YoruCathy Apr 22, 2024
1a67042
free space instruction
YoruCathy Apr 22, 2024
f30d925
code comments
YoruCathy Apr 23, 2024
6945638
auto generated doc
YoruCathy Apr 23, 2024
1bade6a
mac script change order
YoruCathy Apr 23, 2024
c6e999a
remove doc
YoruCathy Apr 23, 2024
1457622
add ignore for doc
YoruCathy Apr 23, 2024
d9387fe
Add cloth scoring attribute
thisjustin123 Apr 24, 2024
0dfcb86
Merge pull request #53 from thisjustin123/justin/dressing-score
YoruCathy Apr 25, 2024
281f9e7
ignore unnecessary files in build
YoruCathy Apr 25, 2024
da555f5
Added a test script for grasping.
YoruCathy Apr 25, 2024
ef6add0
Added lfs matching rules for zip and build.
YoruCathy Apr 25, 2024
9345d97
Merge branch 'hackathon' of github.com:empriselab/RCareWorld into hac…
YoruCathy Apr 25, 2024
bf95314
Add interface and example for fetching particle positions
thisjustin123 Apr 18, 2024
c947995
Remove laggy print statement
thisjustin123 Apr 18, 2024
ff39e4e
Removed unuseful jekyll doc generation action.
YoruCathy Apr 26, 2024
959c0be
Added pdoc document generation action.
YoruCathy Apr 26, 2024
eae4006
Fixed doc generation action, skipping any errors.
YoruCathy Apr 26, 2024
214bc9f
Removed deprecated examples.
thisjustin123 Apr 18, 2024
f5c74b2
Merge branch 'hackathon' of github.com:empriselab/RCareWorld into hac…
YoruCathy Apr 26, 2024
53d78ec
Added API website.
YoruCathy Apr 26, 2024
3adb52c
Updated windows installation script.
YoruCathy Apr 26, 2024
d8871d2
Added cloth_score attr.
YoruCathy Apr 26, 2024
de32777
Merge branch 'hackathon' of github.com:empriselab/RCareWorld into hac…
YoruCathy Apr 26, 2024
a970a27
Removed Build in gitignore.
YoruCathy Apr 27, 2024
9af2766
Removed gitignore for build.
YoruCathy Apr 27, 2024
e0e3df3
Added bathing envs.
YoruCathy Apr 27, 2024
42e71ea
Added starter script for bathing.
YoruCathy Apr 27, 2024
809821c
Added dressing envs.
YoruCathy Apr 27, 2024
7342517
Added dressing starter script.
YoruCathy Apr 27, 2024
dc7dce7
Update Bathing env.
YoruCathy Apr 27, 2024
4ac0cce
update bathing env
YoruCathy Apr 27, 2024
8ea4627
update dressing env
YoruCathy Apr 27, 2024
725b82c
Fix cloth attr.
YoruCathy Apr 27, 2024
8e7fbf8
Added test scripts for camera without reshape.
YoruCathy Apr 28, 2024
2a3bd80
Added test script for gripper rotate.
YoruCathy Apr 28, 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
51 changes: 0 additions & 51 deletions .github/workflows/jekyll-gh-pages.yml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/pdoc_build.yaml
Copy link
Member Author

Choose a reason for hiding this comment

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

remove this. we don't use this to build doc anymore.

Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Generate Documents with pdoc

on:
push:
branches:
- main
- hackathon

jobs:
setup-python:
name: Generate Documentations
runs-on: ubuntu-22.04
permissions: # Job-level permissions configuration starts here
contents: write # 'write' access to repository contents
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Ensures history is available for pushing changes

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10' # Set this to your Python version

- name: install-rcareworld
run: |
cd ./pyrcareworld
pip install -r requirements.txt
pip install -e .
cd ../

- name: Install pdoc
run: |
pip install pdoc3
pdoc --skip-errors --html pyrcareworld -o docs

- name: Commit Documentation
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git add docs/*
git commit -m "Update documentation" || echo "No changes to commit"

- name: Push Changes
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
/[Uu]ser[Ss]ettings/
/[Dd]oc/
/[Dd]ocs/

# MemoryCaptures can get excessive in size.
# They also could contain extremely sensitive data
Expand Down
117 changes: 104 additions & 13 deletions README.md
Copy link
Member Author

Choose a reason for hiding this comment

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

keep the original readme

Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,107 @@

# Here is the code for RCareWorld V1.0.0 🦾
- Check the website https://emprise.cs.cornell.edu/rcareworld/
- Check the documentation and tutorials
- [Full Install](https://sunny-building-1e7.notion.site/Full-install-RCareWorld-All-you-need-to-know-c5432d938f9545299f2b268373ec8abc?pvs=4)
- [Minimum install](https://sunny-building-1e7.notion.site/Prebuilt-RCareWorld-All-you-need-to-know-8081cfe25ac4446784f463bc25152dc8?pvs=4)
- Discuss in the forum https://github.com/empriselab/RCareWorld/discussions
- Watch our presentation https://www.youtube.com/watch?v=mNy1cloWrP0
- Online OH calendar https://calendar.google.com/calendar/u/1?cid=Y18yODM5NTEwZDJjMjViOGQ1Njc4ZjAxNmI0NjYxYjQ5NDNhMjI1MTg1Y2Q4MGE1MGFhN2QwMDMyMDhkZjE5NWNmQGdyb3VwLmNhbGVuZGFyLmdvb2dsZS5jb20
And book additional time slots: https://calendly.com/ruolinye

# RCareWorld now available on pypi and docker
https://pypi.org/project/pyrcareworld/1.0.0/
Run `pip install pyrcareworld==1.0.0` to install from pypi

https://hub.docker.com/repository/docker/cathyye2000/rcareworld/general The docker image for Python environment. Documents coming soon
- Auto-generated APIs https://emprise.cs.cornell.edu/rcareworld-doc/

We support Windows, Linux (Tested on Ubuntu), and MacOS. You need to make sure git and git-lfs are installed on your system. You should use Git Bash if you have it (else Powershell) for windows,
and use bash for Linux and MacOS.

Please make sure your computer has enough (at least 5GB) free space before starting.

# Pre-Installation Guide

## Installing Git and Git Large File Storage

You can skip this step if you already have git and git-lfs installed on your system.

### Windows
Follow https://www.youtube.com/watch?v=JgOs70Y7jew for git installation on Windows.

### Linux
#### Fedora
Use `sudo dnf install git-all`
#### Debian-Based Distribution (Ubuntu)
Use `sudo apt install git-all`
#### Other options
Reference https://git-scm.com/download/linux

### Mac
Follow https://www.youtube.com/watch?v=Mf3l8z6oxQ0 for git installation on Mac.

### Git Large File Storage
Installation for git-lfs on all OS systems can be found here: https://docs.github.com/en/repositories/working-with-files/managing-large-files/installing-git-large-file-storage.

## Cloning the Hackathon Repo

Open up Terminal, Git Bash, or Powershell depending on the Operating System your computer is using.

If you have ssh key setup on github use:
`git clone [email protected]:empriselab/RCareWorld.git`

otherwise,
`git clone https://github.com/empriselab/RCareWorld.git`

Navigate to the `RCareWorld` repository using the cd command.
Example command: `cd RCareWorld`

Checkout to the hackathon branch:
`git checkout hackathon`

Next, `git lfs pull`.

Then navigate to `TestInstall` folder which is in `hackathon_demo` folder.

You should expect to see `Linux.zip`, `Mac.zip`, and `Windows.zip` under `hackathon_demo/Build/TestInstall` folder. Unzip the one that matches your system.

# Install Guide

If you are preceeding immediately after the "Cloning the Hackathon Repo" step, navigate back to the RCareWorld directory.
Example commands: `cd ~/RCareWorld`

If you already have anaconda installed on your system, skip installing `install_conda`.

## Windows
Run `install/Windows/install_conda.bat`, and then run `install/Windows/install_pyrcareworld.bat`.

Example commands:
`./install/Windows/install_pyrcareworld.bat`

Note on Windows you may need to install Microsoft Visual C++ 14.0 or greater using Visual Studio Installer.
If you are confused as to how to do this, reference this tutorial: https://www.youtube.com/watch?v=yBvxsw6OOw4.

## Ubuntu
Run `install/Ubuntu/install_conda.sh`, and then run `install/Ubuntu/install_pyrcareworld.sh`.

Example commands:
`bash install/Ubuntu/install_pyrcareworld.sh`

## Mac
Run `install/Mac/install_conda.sh`, and then run `install/Mac/install_pyrcareworld.sh`.

Example commands:
`bash install/Mac/install_pyrcareworld.sh`.

# Testing Installation
Navigate to the `RCareWorld` folder and then to the `hackathon_demo` folder.

Inside the `hackathon_demo` folder, you will find four files titled `test_install_linux.py`, `test_install_mac.py`, `test_install_mac_silicon.py`, and `test_install_windows.py`. In order to test installation, use the following commands:

First activate the conda environment: `conda activate rcareworld`.

## Windows
Run `python test_install_windows.py`.

## Linux
Run `python test_install_linux.py`.

## Mac
### Intel
Run `python test_install_mac.py`.
### Apple Silicon
Run `python test_install_mac_silicon.py`.
### Don't know if Intel or Apple Silicon
It is necessary that you run the correct test. If you do not know whether you have Apple Silicon or Intel, please reference this site https://www.sweetwater.com/sweetcare/articles/intel-based-mac-or-mac-with-apple-silicon/.

## Test Result
If you have correctly installed based on the installation guide, then a Unity window should open up and the resulting image should appear.
![alt text](Test_Install_Image.png)
Binary file added Test_Install_Image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions hackathon_demo/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Build filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
1 change: 1 addition & 0 deletions hackathon_demo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!**/*.zip
3 changes: 3 additions & 0 deletions hackathon_demo/Build/Bathing/Mac.zip
Copy link
Member Author

Choose a reason for hiding this comment

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

Remove these large files.

Git LFS file not shown
3 changes: 3 additions & 0 deletions hackathon_demo/Build/Bathing/Ubuntu.zip
Copy link
Member Author

Choose a reason for hiding this comment

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

remove

Git LFS file not shown
3 changes: 3 additions & 0 deletions hackathon_demo/Build/Bathing/Windows.zip
Copy link
Member Author

Choose a reason for hiding this comment

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

rm

Copy link
Member Author

Choose a reason for hiding this comment

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

same for the zip files below.

Git LFS file not shown
3 changes: 3 additions & 0 deletions hackathon_demo/Build/Dressing/Mac.zip
Git LFS file not shown
3 changes: 3 additions & 0 deletions hackathon_demo/Build/Dressing/Ubuntu.zip
Git LFS file not shown
3 changes: 3 additions & 0 deletions hackathon_demo/Build/Dressing/Windows.zip
Git LFS file not shown
3 changes: 3 additions & 0 deletions hackathon_demo/Build/TestInstall/Linux.zip
Git LFS file not shown
3 changes: 3 additions & 0 deletions hackathon_demo/Build/TestInstall/Mac.zip
Git LFS file not shown
3 changes: 3 additions & 0 deletions hackathon_demo/Build/TestInstall/Windows.zip
Git LFS file not shown
64 changes: 64 additions & 0 deletions hackathon_demo/test_bathing.py
Copy link
Member Author

Choose a reason for hiding this comment

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

keep the demos, but rename the folder from hackathon_demo to 'demo'

Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
from pyrcareworld.envs import RCareWorld
from pyrcareworld.attributes import sponge_attr
import random

# Script to test bed bathing in hackathon.
if __name__ == "__main__":
# connect with the Unity environment
# Change the path to the Unity executable file
env = RCareWorld(
executable_file="<YOurPathHere>"
)

# A collection of all force readings over all steps.
all_nonzero_forces = []

# Create a robot and a target object
# Control the robot arm
robot = env.create_robot(
id=123456, gripper_list=[123456], robot_name="stretch3", base_pos=[0, 0, 0]
)
# Control the robot base
robot_base = env.create_robot(id = 12346, robot_name = 'mobile_base', base_pos = [0, 0, 1])
# The red cuba in the environment
target = env.create_object(id=2333, name="Cube", is_in_scene=True)
# Move the robot to the target object
for i in range(10):
position = target.getPosition()
# print(position)
robot.BioIKMove(position)
env.step()
# Move the robot base, don't move faster than this
for i in range(100):
position = robot_base.getRobotState()["position"]
position[2]+=0.004
print(position)
robot_base.setTransform(position)
env.step()
while True:
position = target.getPosition()
rotation = target.getRotation()
robot.directlyMoveTo(position)

# force on the sponge
forces = env.instance_channel.data[509]["forces"]
# painted area
prop = env.instance_channel.data[509]["proportion"]
msg = ""
if len(forces) > 0:
for force in forces:
all_nonzero_forces.append(force)

msg += (
"Forces Score: "
+ str(sponge_attr.score_forces(all_nonzero_forces))
+ "\n"
)

if prop != None:
msg += "Bathing Score: " + str(prop) + "\n"
if len(msg) > 0:
msg += "*************"
print(msg)

env.step()
16 changes: 16 additions & 0 deletions hackathon_demo/test_camera_raw.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from pyrcareworld.envs import RCareWorld
import cv2
import numpy as np

env = RCareWorld(executable_file="@Editor")


env.instance_channel.set_action("GetRGB", id=654321, width=512, height=1024)
info = env.instance_channel.data[654321]

env.step()
image_byte = env.instance_channel.data[654321]["rgb"]
image_rgb = np.frombuffer(image_byte, dtype=np.uint8)
image_rgb = cv2.imdecode(image_rgb, cv2.IMREAD_COLOR)
cv2.imshow("show", image_rgb)
cv2.waitKey(0)
11 changes: 11 additions & 0 deletions hackathon_demo/test_camera_rcw.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from pyrcareworld.envs import RCareWorld
import cv2
import numpy as np

env = RCareWorld(executable_file="@Editor")
cam = env.create_camera(id=654321, name="Camera", width=512, height=1024, is_in_scene=True)
image_rgb = cam.getRGB()
image_rgb = cv2.imdecode(image_rgb, cv2.IMREAD_COLOR)
cv2.imshow("show", image_rgb)
cv2.waitKey(0)

Loading
Loading