Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
130 changes: 1 addition & 129 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -105,139 +105,11 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
less \
gdb \
nano \
tmux
tmux

# Set up the user's .bashrc file and shell.
CMD ["/usr/bin/bash"]


##################################################
# Starting from the specified MoveIt Pro release with CUDA GPU #
##################################################
# The image tag is specified in the argument itself.
# hadolint ignore=DL3006
FROM ${MOVEIT_STUDIO_BASE_IMAGE} AS base-gpu

# Create a non-root user
ARG USERNAME
ARG USER_UID
ARG USER_GID

# hadolint ignore=DL3008
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && apt-get install wget -y -q --no-install-recommends && \
wget --progress=dot:giga https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb && \
dpkg -i cuda-keyring_1.1-1_all.deb && \
apt-get update && \
apt-get install -q -y --no-install-recommends \
libcudnn9-cuda-12 \
libcudnn9-dev-cuda-12 \
libcublas-12-6 \
cuda-cudart-12-6 \
libcurand-12-6 \
libcufft-12-6 \
libnvinfer10 \
libnvinfer-plugin10 \
libnvonnxparsers10 \
libtree

# Misleading name: onnxruntime_gpu is actually specifically the CUDA package. This is only shipped for x86-64
RUN if [ "$(uname -m)" = "x86_64" ]; then pip3 install --no-cache-dir onnxruntime_gpu==1.19.0; fi

# Copy source code from the workspace's ROS 2 packages to a workspace inside the container
ARG USER_WS=/home/${USERNAME}/user_ws
ENV USER_WS=${USER_WS}

# Also mkdir with user permission directories which will be mounted later to avoid docker creating them as root
WORKDIR $USER_WS
# hadolint ignore=DL3008
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
groupadd --gid $USER_GID ${USERNAME} && \
useradd --uid $USER_UID --gid $USER_GID --shell /bin/bash --create-home ${USERNAME} && \
apt-get update && \
apt-get install -q -y --no-install-recommends sudo && \
echo ${USERNAME} ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/${USERNAME} && \
chmod 0440 /etc/sudoers.d/${USERNAME} && \
cp -r /etc/skel/. /home/${USERNAME} && \
mkdir -p \
/home/${USERNAME}/.ccache \
/home/${USERNAME}/.config \
/home/${USERNAME}/.ignition \
/home/${USERNAME}/.colcon \
/home/${USERNAME}/.ros && \
chown -R $USER_UID:$USER_GID /home/${USERNAME} /opt/overlay_ws/

# Install additional dependencies
# You can also add any necessary apt-get install, pip install, etc. commands at this point.
# NOTE: The /opt/overlay_ws folder contains MoveIt Pro binary packages and the source file.
# hadolint ignore=SC1091
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
--mount=type=bind,target=${USER_WS}/,source=. \
. /opt/overlay_ws/install/setup.sh && \
apt-get update && \
rosdep install -q -y \
--from-paths src \
--ignore-src

# Set up colcon defaults for the new user
USER ${USERNAME}
RUN colcon mixin add default \
https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml && \
colcon mixin update && \
colcon metadata add default \
https://raw.githubusercontent.com/colcon/colcon-metadata-repository/master/index.yaml && \
colcon metadata update
COPY colcon-defaults.yaml /home/${USERNAME}/.colcon/defaults.yaml

# hadolint ignore=DL3002
USER root

# Set up the user's .bashrc file and shell.
CMD ["/usr/bin/bash"]

###################################################################
# Target for the developer build which does not compile any code. #
###################################################################
FROM base-gpu AS user-overlay-gpu-dev

ARG USERNAME
ARG USER_WS=/home/${USERNAME}/user_ws
ENV USER_WS=${USER_WS}

# Install any additional packages for development work
# hadolint ignore=DL3008
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && \
apt-get install -y --no-install-recommends \
less \
gdb \
nano

# Set up the user's .bashrc file and shell.
CMD ["/usr/bin/bash"]

#########################################
# Target for compiled, deployable image with GPU support #
#########################################
FROM base-gpu AS user-overlay-gpu

ARG USERNAME
ARG USER_WS=/home/${USERNAME}/user_ws
ENV USER_WS=${USER_WS}

ENV LD_LIBRARY_PATH=/usr/local/lib/python3.10/dist-packages/onnxruntime/capi:/usr/lib/x86_64-linux-gnu:/usr/local/cuda-12.6/targets/x86_64-linux/lib:$LD_LIBRARY_PATH

# Compile the workspace
WORKDIR $USER_WS

# Set up the user's .bashrc file and shell.
CMD ["/usr/bin/bash"]


#########################################
# Target for compiled, deployable image #
#########################################
Expand Down
14 changes: 14 additions & 0 deletions src/lab_sim/objectives/_scan_scene.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
joint_group_name="manipulator"
controller_names="joint_trajectory_controller"
waypoint_name="Park Far Right"
acceleration_scale_factor="1.0"
controller_action_server="/joint_trajectory_controller/follow_joint_trajectory"
keep_orientation="false"
keep_orientation_tolerance="0.05"
link_padding="0.01"
seed="0"
velocity_scale_factor="1.0"
/>
<SubTree ID="Take Scene Camera Snapshot" _collapsed="true" />
<SubTree
Expand All @@ -22,6 +29,13 @@
joint_group_name="manipulator"
controller_names="joint_trajectory_controller"
waypoint_name="Look at Table"
acceleration_scale_factor="1.0"
controller_action_server="/joint_trajectory_controller/follow_joint_trajectory"
keep_orientation="false"
keep_orientation_tolerance="0.05"
link_padding="0.01"
seed="0"
velocity_scale_factor="1.0"
/>
</Control>
</BehaviorTree>
Expand Down
3 changes: 2 additions & 1 deletion src/lab_sim/objectives/close_gripper.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<root BTCPP_format="4" main_tree_to_execute="Close Gripper">
<BehaviorTree
ID="Close Gripper"
_description="Close the gripper"
_favorite="true"
_favorite="false"
>
<Control ID="Sequence" name="root">
<Action
Expand Down
42 changes: 42 additions & 0 deletions src/lab_sim/objectives/errorcheckvectorsize.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8" ?>
<root BTCPP_format="4" main_tree_to_execute="ErrorCheckVectorSize">
<!--//////////-->
<BehaviorTree ID="ErrorCheckVectorSize">
<Control ID="Sequence">
<Action
ID="GetSizeOfVector"
vector_in="{vector}"
vector_size="{vector_size}"
/>
<Decorator
ID="Precondition"
else="SUCCESS"
if="vector_size!=expected_vector_size"
name="Error Check "
>
<Control ID="Sequence">
<Action
ID="LogMessage"
log_level="error"
message="'Vector size is wrong'"
/>
<Action ID="AlwaysFailure" />
</Control>
</Decorator>
</Control>
</BehaviorTree>
<TreeNodesModel>
<SubTree ID="ErrorCheckVectorSize">
<MetadataFields>
<Metadata runnable="false" />
<Metadata subcategory="Error Checking" />
</MetadataFields>
<inout_port name="expected_vector_size" default="1" type="int">
The size the vector should be
</inout_port>
<inout_port name="vector" default="{vector}">
The input vector that is to be checked for size.
</inout_port>
</SubTree>
</TreeNodesModel>
</root>
3 changes: 3 additions & 0 deletions src/lab_sim/objectives/example_file.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1) A robot may not injure a human being or, through inaction, allow a human being to come to harm;
2) A robot must obey orders from a human, except when they conflict with the First Law; and
3) A robot must protect its own existence, provided it doesn't conflict with the First or Second Law.
2 changes: 1 addition & 1 deletion src/lab_sim/objectives/grasp_pose_using_yaml.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<BehaviorTree
ID="Grasp Pose Using Yaml"
_description="Reads a YAML file for grasp pose offset and picks up an object that has an AprilTag marker."
_favorite="true"
_favorite="false"
>
<Control ID="Sequence" name="TopLevelSequence">
<SubTree ID="Open Gripper" />
Expand Down
3 changes: 2 additions & 1 deletion src/lab_sim/objectives/joint_diagnostic.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<root BTCPP_format="4" main_tree_to_execute="Joint Diagnostic">
<!--//////////-->
<BehaviorTree
ID="Joint Diagnostic"
_description="Example of cycling through the min and max limits of a single joint, for hardware testing"
_favorite="true"
_favorite="false"
>
<Control ID="Sequence" name="TopLevelSequence">
<!--Setup by moving home-->
Expand Down
4 changes: 2 additions & 2 deletions src/lab_sim/objectives/load_and_execute_joint_trajectory.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<root BTCPP_format="4" main_tree_to_execute="Load and Execute Joint Trajectory">
<!--//////////-->
<BehaviorTree
ID="Load and Execute Joint Trajectory"
_description="Load a trajectory that was saved as a YAML file"
_favorite="true"
_favorite="false"
>
<Control ID="Sequence" name="TopLevelSequence">
<!--Make sure to move the robot to the same starting position as the saved trajectory starts, otherwise the joint_trajectory_controller will use joint interpolation to align the robot with the path-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<root BTCPP_format="4" main_tree_to_execute="ML Segment Image from Text Prompt">
<root BTCPP_format="4" main_tree_to_execute="ML Segment Image">
<!--//////////-->
<BehaviorTree
ID="ML Segment Image from Text Prompt"
_description="Run an ML model to find all objects and visualize the masks with bounding boxes."
ID="ML Segment Image"
_description="Run an ML model to find all objects and visualize the masks with bounding boxes, from a text prompt."
_favorite="true"
>
<Control ID="Sequence">
Expand All @@ -27,7 +27,7 @@
</Control>
</BehaviorTree>
<TreeNodesModel>
<SubTree ID="ML Segment Image from Text Prompt">
<SubTree ID="ML Segment Image">
<MetadataFields>
<Metadata runnable="true" />
<Metadata subcategory="Application - ML (GPU Recommended)" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<root
BTCPP_format="4"
main_tree_to_execute="ML Segment Point Cloud from Text Prompt"
>
<root BTCPP_format="4" main_tree_to_execute="ML Segment Point Cloud">
<!--//////////-->
<BehaviorTree
ID="ML Segment Point Cloud from Text Prompt"
_description="Captures a point cloud and segments out all possible objects."
ID="ML Segment Point Cloud"
_description="Captures a point cloud and segments out all possible objects from a text prompt"
_favorite="true"
>
<Control ID="Sequence">
Expand All @@ -32,7 +29,7 @@
</Control>
</BehaviorTree>
<TreeNodesModel>
<SubTree ID="ML Segment Point Cloud from Text Prompt">
<SubTree ID="ML Segment Point Cloud">
<MetadataFields>
<Metadata runnable="true" />
<Metadata subcategory="Application - ML (GPU Recommended)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<BehaviorTree
ID="ML Segment Point Cloud from Clicked Point"
_description="Captures a point cloud and requests the user to click on three objects in the image to be segmented. The point cloud is then filtered to only include the selected objects."
_favorite="true"
_favorite="false"
>
<Control ID="Sequence">
<SubTree
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<root BTCPP_format="4" main_tree_to_execute="ML Grasp Object from Text Prompt">
<root BTCPP_format="4" main_tree_to_execute="Pick 1 Pill Bottle">
<!--//////////-->
<BehaviorTree
ID="ML Grasp Object from Text Prompt"
ID="Pick 1 Pill Bottle"
_description="Captures and segments objects from a point cloud based on a text prompt. Then grasps the first object returned from the segmentation."
_favorite="true"
>
Expand Down Expand Up @@ -74,6 +74,7 @@
controller_names="joint_trajectory_controller;robotiq_gripper_controller"
task="{mtc_task}"
trajectory_monitoring="false"
timeout="-1.000000"
/>
<Action ID="SetupMTCCurrentState" task="{mtc_task}" />
<Action
Expand Down Expand Up @@ -124,7 +125,7 @@
</Control>
</BehaviorTree>
<TreeNodesModel>
<SubTree ID="ML Grasp Object from Text Prompt">
<SubTree ID="Pick 1 Pill Bottle">
<MetadataFields>
<Metadata runnable="true" />
<Metadata subcategory="Application - ML (GPU Recommended)" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<root
BTCPP_format="4"
main_tree_to_execute="ML Auto Grasp Object from Text Prompt"
>
<root BTCPP_format="4" main_tree_to_execute="Pick All Pill Bottles">
<!--//////////-->
<BehaviorTree
ID="ML Auto Grasp Object from Text Prompt"
_description="Uses ML models to identify and grasp plan to pick up objects."
ID="Pick All Pill Bottles"
_description="Uses ML models to repeatedly identify and grasp plan to pick up objects."
_favorite="true"
>
<Control ID="Sequence" name="TopLevelSequence">
Expand Down Expand Up @@ -113,7 +110,7 @@
</Control>
</BehaviorTree>
<TreeNodesModel>
<SubTree ID="ML Auto Grasp Object from Text Prompt">
<SubTree ID="Pick All Pill Bottles">
<MetadataFields>
<Metadata runnable="true" />
<Metadata subcategory="Application - ML (GPU Recommended)" />
Expand Down
3 changes: 2 additions & 1 deletion src/lab_sim/objectives/playback_square_trajectory.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<root BTCPP_format="4" main_tree_to_execute="Playback Square Trajectory">
<!--//////////-->
<BehaviorTree
ID="Playback Square Trajectory"
_description="Loads and plays a JointTrajectory of the end-effector moving in a square trajectory."
_favorite="true"
_favorite="false"
>
<Control ID="Sequence" name="TopLevelSequence">
<Action
Expand Down
4 changes: 2 additions & 2 deletions src/lab_sim/objectives/push_button_with_a_trajectory.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<root BTCPP_format="4" main_tree_to_execute="Push Button With a Trajectory">
<!--//////////-->
<BehaviorTree
ID="Push Button With a Trajectory"
_description="An example for how to use the JTAC to execute a trajectory with compliance."
_favorite="true"
_favorite="false"
>
<Control ID="Sequence" name="TopLevelSequence">
<SubTree ID="Close Gripper" _collapsed="true" />
Expand Down
Loading
Loading