Skip to content

Commit

Permalink
adding dockefile image with mycobot280 and auto push into registry ac…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
francescodelduchetto committed Jan 22, 2025
1 parent 4e8f9af commit c261d72
Show file tree
Hide file tree
Showing 93 changed files with 70 additions and 4,838 deletions.
8 changes: 6 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "lcas-ros2-teaching-humble",
"name": "lcas-ros2-rbt1001-humble",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "lcas.lincoln.ac.uk/lcas/devcontainer/ros2-teaching:2324-devel",
"image": "lcas.lincoln.ac.uk/lcas/devcontainer/ros2-teaching-rbt1001:latest",
// "build": {
// "dockerfile": "Dockerfile",
// "context": "."
// },
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/desktop-lite:1": {}
Expand Down
26 changes: 2 additions & 24 deletions .devcontainer/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ add_source_bashrc () {
set -e

export WORKSPACE="`pwd`"
sudo chown -R lcas /home/lcas/ws
sudo chown -R lcas /workspaces
sudo chown -R lcas /home/lcas/ws || true
sudo chown -R lcas /workspaces || true

source /opt/ros/lcas/install/setup.bash
sudo apt update


rosdep --rosdistro=humble update


Expand All @@ -29,28 +27,8 @@ rosdep --rosdistro=humble update
# colcon build


cd /home/lcas/ws/src
git clone -b ros2 https://github.com/PickNikRobotics/bio_ik.git
git clone -b humble https://github.com/ros-planning/moveit2_tutorials.git
git clone -b humble https://github.com/ros-planning/moveit_task_constructor.git
git clone -b humble https://github.com/ros-planning/moveit_resources.git
git clone https://github.com/PickNikRobotics/ros2_robotiq_gripper.git
git clone -b ros2 https://github.com/tylerjw/serial.git
# vcs import < moveit2_tutorials/moveit2_tutorials.repos

# instal moveit
sudo apt install ros-humble-moveit -y
# sudo apt install ros-humble-moveit-resources -y
sudo apt install ros-humble-pick-ik -y
# sudo apt install python3-pykdl

cd /home/lcas/ws

rosdep install -r --from-paths . --ignore-src --rosdistro $ROS_DISTRO -y

colcon build
add_source_bashrc "/opt/ros/lcas/install/setup.bash"
add_source_bashrc "/home/lcas/ws/install/setup.bash"
echo "function rebuild { cd /home/lcas/ws; colcon build; source install/setup.bash; cd -; }" >> ~/.bashrc
source /home/lcas/ws/install/setup.bash

20 changes: 20 additions & 0 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM lcas.lincoln.ac.uk/lcas/devcontainer/ros2-teaching:2324-devel

# Install additional ROS 2 packages
RUN DEBIAN_FRONTEND=noninteractive apt update && \
apt install -y \
python3-argcomplete \
python3-colcon-common-extensions \
ros-humble-joint-state-publisher-gui \
ros-humble-moveit

RUN DEBIAN_FRONTEND=noninteractive pip install pymycobot --upgrade

# Install mycobot_ros2
RUN . /opt/ros/humble/setup.sh && \
cd /opt/ros/lcas/src/ && \
git clone --depth 1 https://github.com/elephantrobotics/mycobot_ros2.git && \
cd .. && colcon build && \
rm -rf /opt/ros/lcas/src/ /opt/ros/lcas/build/ /opt/ros/lcas/log/

WORKDIR /home/lcas/ws
42 changes: 42 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Docker Image CI

on:
workflow_dispatch:
push:
branches: [ "main" ]
paths: ['.docker/Dockerfile']

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Docker Login LCAS
# You may pin to the exact commit or the version.
# uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
uses: docker/login-action@v3
with:
# Server address of Docker registry. If not set then will default to Docker Hub
registry: lcas.lincoln.ac.uk
# Username used to log against the Docker registry
username: ${{ secrets.LCAS_REGISTRY_PUSHER }}
# Password or personal access token used to log against the Docker registry
password: ${{ secrets.LCAS_REGISTRY_TOKEN }}
- name: Get PR labels
id: pr-labels
uses: joerick/[email protected]
- name: Debug echo
run: echo "github.head_ref is ${{ github.head_ref }}, steps.pr-labels.outputs.labels is ${{ steps.pr-labels.outputs.labels }} ${{ contains(steps.pr-labels.outputs.labels, ' docker-build ') }}, github.event.label.name is ${{ github.event.label.name }} and github.event_name is ${{ github.event_name }}"
- name: Build and push humble
if: ${{ github.event_name != 'pull_request' }}
uses: docker/build-push-action@v2
with:
context: .
file: ./.docker/Dockerfile
platforms: linux/amd64
push: true
tags: lcas.lincoln.ac.uk/lcas/devcontainer/ros2-teaching-rbt1001:latest
build-args: |
UID=1001
GID=1001
11 changes: 0 additions & 11 deletions src/fanuc_cr7ia_moveit_config/.setup_assistant

This file was deleted.

18 changes: 0 additions & 18 deletions src/fanuc_cr7ia_moveit_config/CHANGELOG.rst

This file was deleted.

13 changes: 0 additions & 13 deletions src/fanuc_cr7ia_moveit_config/CMakeLists.txt

This file was deleted.

6 changes: 0 additions & 6 deletions src/fanuc_cr7ia_moveit_config/config/controllers.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions src/fanuc_cr7ia_moveit_config/config/fake_controllers.yaml

This file was deleted.

43 changes: 0 additions & 43 deletions src/fanuc_cr7ia_moveit_config/config/fanuc_cr7ia.srdf

This file was deleted.

34 changes: 0 additions & 34 deletions src/fanuc_cr7ia_moveit_config/config/joint_limits.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions src/fanuc_cr7ia_moveit_config/config/kinematics.yaml

This file was deleted.

70 changes: 0 additions & 70 deletions src/fanuc_cr7ia_moveit_config/config/ompl_planning.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions src/fanuc_cr7ia_moveit_config/launch/default_warehouse_db.launch

This file was deleted.

Loading

0 comments on commit c261d72

Please sign in to comment.