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

Docs #36

Open
wants to merge 62 commits into
base: master
Choose a base branch
from
Open

Docs #36

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
e2957d2
Updated the dockerfile to include CUDA
n-yoshikawa Sep 28, 2023
b585319
Changed instructions after build to make it more sequential
n-yoshikawa Sep 28, 2023
ea35e49
Undid the scratchpad change
sagniksom Sep 28, 2023
40a434c
Update README.md to include the source image argument
sagniksom Sep 28, 2023
4844cc3
Update docker-compose.yml
sagniksom Sep 28, 2023
565639e
prevented a dialog debian frontend
sagniksom Sep 29, 2023
befe993
Changed order of debian frontend to prevent dailog during build
sagniksom Oct 1, 2023
7290e46
Made cuda devices visible
sagniksom Oct 2, 2023
13de14c
Removed sudo access for create and run commands
sagniksom Oct 2, 2023
4ce38a5
created a new folder for pick and place feature implementation
Ruthrash Oct 2, 2023
07da738
added the nvidia runtime to the docker compose
sagniksom Oct 2, 2023
b0c9875
first commit in pick and place implementation
Ruthrash Oct 2, 2023
bf507c4
added grasp recorder and pick and place with aruco tag detection
Oct 3, 2023
ed9cf36
added a timeout function to timeout if no return came for zmq pose re…
Oct 3, 2023
ae28a53
changed aruco board data to list, so that it could be written to json…
Oct 3, 2023
da3b4e2
added instructions to run tests for PR and added config dictionary to…
Oct 3, 2023
99b684f
removed obselete implementation of picknplace
Oct 3, 2023
a30ab65
added missed chanes in test_pick_n_place script
Oct 3, 2023
3788c42
Merge branch 'dev/pick_and_place' of https://github.com/pairlab/frank…
Ruthrash Oct 31, 2023
48d7207
added gitignore
Ruthrash Oct 31, 2023
df84b54
added installation of dope, contactgraspnet and commented instruction…
Ruthrash Nov 3, 2023
57810f2
added method to popup image window to get bbox annotations and also p…
Ruthrash Nov 3, 2023
f004757
added first implementatios of grasping with pose estimator
Ruthrash Nov 3, 2023
3d82a2a
logging total data samples in cmdline
Ruthrash Nov 3, 2023
6cec3da
modified test scripts for testing grasps with aruco and megapose
Ruthrash Nov 3, 2023
4290983
modified test scripts to include pick and place with megapose
Ruthrash Nov 3, 2023
998bc32
features for dope pose detector
Ruthrash Nov 3, 2023
e7a1403
modified git ignore to ignore mesh files
Ruthrash Nov 3, 2023
a078cf6
classes for inference models for object pose estimation and grasp pre…
Ruthrash Nov 3, 2023
34e940c
test cases for megapose, contact graspnet and bbox annotator
Ruthrash Nov 3, 2023
00a7d08
added gitgnore to track nothing in scratchpad directory
Ruthrash Jan 31, 2024
959cd75
added DOPE, contactgraspnet installation to workstation dockerfile
Ruthrash Jan 31, 2024
5988b5b
update robot_toolkit/docs/README
Ruthrash Jan 31, 2024
9087e34
extra documentation for running inference with DOPE, megapose and con…
Ruthrash Jan 31, 2024
c8a5011
added a method to perform segmentation using depthmap
Ruthrash Jan 31, 2024
3b38586
added contactgraspnet class and testscript
Ruthrash Jan 31, 2024
7e55f89
added DOPE class and test script
Ruthrash Jan 31, 2024
8b6dac3
megapose class and test script
Ruthrash Jan 31, 2024
9349281
modified .gitignore to track some meshes for megapose examples
Ruthrash Jan 31, 2024
d4a7e88
scripts needed for pick and place and grasp recording
Ruthrash Jan 31, 2024
3a6b214
updated frankapy robot arm object
Ruthrash Jan 31, 2024
e92a1f0
added options to define custom ids in aruco board for aruco board bas…
Ruthrash Jan 31, 2024
5c82228
update robot_toolkit/test_create_tag.py
Ruthrash Jan 31, 2024
505b794
added test scripts for bbox annotator and megapose
Ruthrash Jan 31, 2024
956310a
added test script to visualize franka hands mesh in open3d
Ruthrash Jan 31, 2024
53af1a0
update README.md
Ruthrash Jan 31, 2024
463247c
fixed bug in aruco board
Ruthrash Feb 7, 2024
ac9f0a6
fixed bugs in robot-camera calibration
Ruthrash Feb 9, 2024
9eb0e77
updated README and docs
Ruthrash Feb 15, 2024
ade361f
fixed conda, python and build bugs in workstation dockerfile
Ruthrash Feb 15, 2024
a8f3736
added meshes for testing megapose
Ruthrash Feb 15, 2024
636cfa6
Update Dockerfile to solve frankapy bug with conda
Ruthrash Mar 7, 2024
221435c
Update Dockerfile
Ruthrash Mar 7, 2024
0209839
fixing long runtime issues with contact graspnet
Mar 11, 2024
5a20a02
Merge branch 'dev/pick_n_place_with_prediction' of https://github.com…
Mar 11, 2024
f804492
first commit in adding docstrings
Mar 13, 2024
59e0fc2
Updated docstrings
Mar 13, 2024
4b48ccc
added docstrings to the rest of the code
Ruthrash Mar 13, 2024
1d4dbd3
added doxyfile
Ruthrash Mar 13, 2024
9563f62
resolved merge commits
Ruthrash Mar 15, 2024
14aabc4
finishing up docstrings for commits made for pick_n_place features
Ruthrash Mar 15, 2024
ee13176
finishing up docstrings for commits made for pick_n_place features
Ruthrash Mar 15, 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
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,15 @@ franka_control_suite/build/
!robot_toolkit/calibration_board/target_A4.pdf
!robot_toolkit/calibration_board/target_US_letter.pdf
!robot_toolkit/tests/data/*.png
!robot_toolkit/tests/data/*.pdf
!robot_toolkit/tests/data/*.pdf

*.mtl
*.dae
*.mtl
*.obj
*.ply
*.tgz

!robot_toolkit/robot_arm_algos/src/inference/objects/**/*.dae
!robot_toolkit/robot_arm_algos/src/inference/objects/**/*.mtl
!robot_toolkit/robot_arm_algos/src/inference/objects/**/*.obj
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ This repository contains scripts and off-the-shelf starter scripts for developpi
- docker
- git
- openssh-server

- nvidia-container-toolkit (look at [robot_toolkit/docs/nvidia-container-toolkit.md](robot_toolkit/docs/nvidia-container-toolkit.md) )
- GPU with necessary Nvidia drivers (if using workstation docker)
```
sudo apt-get install docker.io docker-compose git
```
Expand Down Expand Up @@ -59,14 +60,22 @@ make
```

## [Workstation Computer](#workstation)
Build docker container for the workstation computer that has GPU/nvidia drivers
Build, create, and start the docker container for the workstation computer that has GPU/nvidia drivers

**Note: it is important to pass the workstation IP address as seen by the Realtime computer here**
```
docker-compose -f docker/workstation_computer/docker-compose-gui.yml build \
--build-arg workstation_ip=<workstation_ip address>
--build-arg workstation_ip=<workstation_ip address> \
--build-arg use_robotiq=1 \
--build-arg build_dope=1 \
--build-arg build_contactgraspnet=1 \
--build-arg build_megapose=1

docker-compose -f docker/workstation_computer/docker-compose-gui.yml create
docker-compose -f docker/workstation_computer/docker-compose-gui.yml start

```
**Note:** The default CUDA version is 11.3 and Ubuntu version is 20.04, if you would like to change these, please aquire an appropriate docker image and use `--build-arg image=<your image>`.
**Note:** if you want to use [roboiq gripper](https://robotiq.com/products), please set `--build-arg use_robotiq=1` in the previous command for building workstation docker.

Note: While building the docker container, the above command might print warnings in red color, don't be alarmed and let the process run. If it stops building, that's when there is an error.
Expand Down Expand Up @@ -205,8 +214,11 @@ python3 docker_frankapy_test.py

## Using calibration

Please checkout [robot_toolkit/docs](robot_toolkit/docs) for documentations of robot camera extrinsic calibration, usage of this tool.
Please checkout [robot_toolkit/docs](robot_toolkit/docs) for documentations of robot camera extrinsic calibration, usage of this tool. We also have a video showing how to use our tool [here](https://drive.google.com/file/d/1VMregvZZmWaFMxj7J3FgXDaWfS2ae4tQ/view?usp=sharing)

## Using Deeplearning based prediciton models

Please checkout [robot_toolkit/docs/deep_learning_models.md](robot_toolkit/docs/deep_learning_models.md) and [robot_toolkit/docs/nvidia-container-toolkit.md](robot_toolkit/docs/nvidia-container-toolkit.md) for running Neural network models with GPUs.

## Test robotiq gripper
To run the robotiq device, first in a terminal do
Expand Down
3 changes: 3 additions & 0 deletions docker/scratchpad/.gitignore
100644 → 100755
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!.gitignore
!install_cudnn.sh
192 changes: 125 additions & 67 deletions docker/workstation_computer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
#FROM ubuntu:focal

FROM osrf/ros:noetic-desktop-full

ARG image=nvidia/cudagl:11.1.1-devel-ubuntu20.04
FROM ${image}

ARG DEBIAN_FRONTEND=noninteractive
ARG workstation_ip=192.168.0.1
ARG use_robotiq=1
ARG build_dope=1
ARG build_contactgraspnet=1
ARG build_megapose=1
ENV WS_DIR="/root/git"
WORKDIR ${WS_DIR}

SHELL ["/bin/bash", "-c"]

ARG DEBIAN_FRONTEND=noninteractive
ARG workstation_ip=192.168.0.1
ARG use_robotiq=0

# Dependencies for latency plot
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
curl \
Expand All @@ -22,25 +21,7 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y \
python3 \
python3-distutils \
gnuplot-qt \
sshpass
# Dependencies for Bash unit-tests
RUN apt-get update && apt-get install -y \
bats \
dialog \
tmux \
iputils-ping

# Fetch most recent version of rt-tests and mklatencyplot
# Dependencies for latency plot
RUN apt-get update && apt-get install -y \
curl \
grep \
build-essential \
make \
libnuma-dev \
python3 \
python3-distutils \
gnuplot-qt\
sshpass \
iproute2 \
python3-pip \
gnome-terminal\
Expand All @@ -51,7 +32,28 @@ RUN apt-get update && apt-get install -y \
bats \
dialog \
tmux \
iputils-ping
iputils-ping

# ROS Install
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
RUN echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list

RUN apt-get update && apt-get install --no-install-recommends -y \
python3-rosdep \
python3-rosinstall \
python3-vcstools \
python3-catkin-tools \
ros-noetic-jsk-tools \
&& rm -rf /var/lib/apt/lists/*

RUN rosdep init && \
rosdep update

RUN apt-get update && apt-get install -y \
ros-noetic-desktop-full \
&& rm -rf /var/lib/apt/lists/*

ENV ROS_DISTRO noetic

# Dependencies for franka-interface and protobuf
RUN apt-get update && apt-get install -y \
Expand All @@ -66,6 +68,7 @@ RUN apt-get update && apt-get install -y \
unzip \
python3-catkin-tools \
python3-tk

# Build and install Protobuf
RUN cd \
# && mkdir git \
Expand All @@ -87,24 +90,36 @@ RUN apt-get install -y \
ros-noetic-franka-gripper \
ros-noetic-realsense2-camera

RUN echo "Installing conda"
ENV PATH /opt/conda/bin:$PATH
RUN export CONDA_DIR=/opt/conda \
&& wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh \
&& /bin/bash ~/miniconda.sh -b -p /opt/conda \
&& export PATH=$CONDA_DIR/bin:$PATH \
&& source ~/.bashrc \
&& conda config --set auto_activate_base false \
&& conda init bash \
&& conda install python=3.8
# && conda deactivate

RUN echo "cloning building autolab perception"
RUN cd ~/git \
&& git clone --recurse-submodules https://github.com/BerkeleyAutomation/perception
RUN cd ~/git/perception \
&& sudo pip3 install -e .
&& pip3 install -e .

RUN echo "cloning frankapy"
RUN pip3 install -U rosdep rosinstall_generator wstool rosinstall six vcstools

RUN echo "cloning frankapy"
RUN cd ~/git \
&& git clone --recurse-submodules https://github.com/Ruthrash/frankapy



RUN echo "building frankapy python modules"
RUN cd ~/git/frankapy \
&& sudo pip3 install -e .
&& pip3 install empy==3.3.4 \
&& pip3 install -e .

RUN echo "compiling catkin_ws"
RUN echo "compiling frankapy catkin_ws"
RUN cd ~/git/frankapy \
&& source /opt/ros/noetic/setup.bash \
&& ./bash_scripts/make_catkin.sh
Expand All @@ -116,53 +131,96 @@ RUN cd ~/git/frankapy \
RUN apt-get install -y \
ros-noetic-libfranka \
ros-noetic-franka-ros \
ros-noetic-franka-gripper
ros-noetic-franka-gripper \
ros-noetic-rosbash ros-noetic-ros-comm

RUN echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
RUN echo "source ~/git/frankapy/catkin_ws/devel/setup.bash " >> ~/.bashrc
RUN echo "source /root/git/frankapy/catkin_ws/devel/setup.bash " >> ~/.bashrc

# RUN echo "export ROS_HOSTNAME=192.168.0.1" >> ~/.bashrc
# RUN echo "export ROS_IP=192.168.0.1" >> ~/.bashrc
# RUN echo "export ROS_MASTER_URI=http://192.168.0.1:11311" >> ~/.bashrc

# RUN echo "export ROS_HOSTNAME=${workstation_ip}" >> ~/.bashrc
RUN echo "export ROS_IP=${workstation_ip}" >> ~/.bashrc
RUN echo "export ROS_MASTER_URI=http://${workstation_ip}:11311" >> ~/.bashrc
RUN echo "export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python" >> ~/.bashrc


RUN pip3 install --upgrade protobuf

RUN sudo pip3 install --upgrade protobuf

RUN sudo pip3 install numpy --force-reinstall
RUN pip3 install numpy --force-reinstall
#reinstalling numba seems to solve an error when we import FrankaArm from frankapy
RUN pip3 install zmq pyrealsense2 numba scipy open3d


# install librealsense sdk
# RUN mkdir -p /etc/apt/keyrings \
# && echo "deb [signed-by=/etc/apt/keyrings/librealsense.pgp] https://librealsense.intel.com/Debian/apt-repo `lsb_release -cs` main" | \
# sudo tee /etc/apt/sources.list.d/librealsense.list \
# && apt-get update \
# && apt-get install librealsense2-dkms \
# && apt-get install librealsense2-utils

# RUN cd /root/git/franka_arm_infra/franka_control_suite \
# && mkdir build \
# && cd build \
# && cmake .. \
# && make
ARG DEBIAN_FRONTEND=dialog

RUN pip3 install zmq pyrealsense2 numba scipy open3d opencv-python wrapt_timeout_decorator
RUN if [[ "x$use_robotiq" == "x1" ]] ;\
then echo "use_robotiq is set to TRUE" \
&& apt-get install ros-noetic-soem \
&& pip3 install -U pymodbus==2.5.3 \
&& pip3 install -U pymodbus==2.5.3 empy==3.3.4 \
&& cd ~/git \
&& mkdir -p robotiq_ws/src \
&& cd robotiq_ws/src \
&& git clone https://github.com/pairlab/robotiq.git \
&& cd ../ \
&& source /opt/ros/${ROS_DISTRO}/setup.bash\
&& source /opt/ros/noetic/setup.bash\
&& catkin build \
&& echo "source ~/git/robotiq_ws/devel/setup.bash" >> ~/.bashrc ; \
fi
&& echo "source ~/git/robotiq_ws/devel/setup.bash --extend" >> ~/.bashrc ; \
fi

RUN if [[ "x$build_contactgraspnet" == "x1" ]] ;\
then echo "build_contactgraspnet is set to TRUE" \
&& echo "Building conda for contact_graspnet" \
&& apt-get update && apt-get upgrade -y && apt-get install -y freeglut3-dev\
&& cd /root/git \
&& git clone https://github.com/NVlabs/contact_graspnet \
&& cd contact_graspnet\
&& conda env create -f contact_graspnet_env.yml \
&& source activate contact_graspnet_env\
&& pip3 install open3d pyrealsense2\
&& cd ~/git/frankapy \
# && pip install empy==3.3.4 \
&& pip3 install -e . \
&& conda deactivate\
&& conda deactivate; \
fi


RUN if [[ "x$build_dope" == "x1" ]] ;\
then echo "build_dope is set to TRUE" \
&& apt-get install ros-noetic-vision-msgs \
&& echo "Building conda for DOPE" \
&& cd /root/git && git clone https://github.com/NVlabs/Deep_Object_Pose.git dope \
&& export CONDA_DIR=/opt/conda && export PATH=$CONDA_DIR/bin:$PATH \
&& conda create --name dope python=3.8 \
&& source activate dope\
&& pip3 install catkin_pkg\
&& cd dope && python3 -m pip install -r requirements.txt\
&& pip3 install -e . \
&& pip3 install torch torchvision --upgrade \
&& pip3 install numpy==1.20.3 \
&& pip3 install open3d pyrealsense2 \
&& cd ~/git/frankapy \
# && pip install empy==3.3.4 \
&& pip3 install -e . \
&& conda deactivate \
&& conda deactivate;\
fi

RUN if [[ "x$build_megapose" == "x1" ]] ;\
then echo "build_megapose is set to TRUE" \
&& cd /root/git && git clone --recurse-submodules https://github.com/megapose6d/megapose6d megapose \
&& export CONDA_DIR=/opt/conda && export PATH=$CONDA_DIR/bin:$PATH \
&& cd /root/git/megapose/conda \
&& sed -i 's/notebook/notebook==6.4.12/g' environment_full.yaml \
&& conda env create -f environment_full.yaml \
&& source activate megapose\
&& cd /root/git/megapose && pip3 install -e . \
&& python -m megapose.scripts.download --megapose_models \
&& pip3 install torch torchvision --upgrade \
# && pip3 install numpy==1.20.3 \
&& pip3 install open3d pyrealsense2 \
&& cd ~/git/frankapy \
&& pip install empy==3.3.4 \
&& pip3 install -e . \
&& conda deactivate\
&& conda deactivate \
&& pip3 install rospkg wrapt-timeout-decorator;\
fi



SHELL ["conda", "run", "-n", "myenv", "/bin/bash", "-c"]
2 changes: 1 addition & 1 deletion docker/workstation_computer/docker-compose-gui.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "2.2"
version: "2.4"
services:
docker_workstation_computer:
extends:
Expand Down
5 changes: 4 additions & 1 deletion docker/workstation_computer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "2.2"
version: "2.4"
services:
docker_workstation_computer:
build:
Expand All @@ -8,6 +8,8 @@ services:
tty: true
cap_add:
- SYS_NICE
environment:
- CUDA_VISIBLE_DEVICES=0
ulimits:
rtprio: 99
rttime: -1
Expand All @@ -16,6 +18,7 @@ services:
privileged: true
devices:
- /dev:/dev
runtime: nvidia
volumes:
# - ../../calibration:/root/git/calibration
- ../../frankapy_control_test_scripts:/root/git/frankapy_control_test_scripts
Expand Down
Loading