Skip to content

Commit

Permalink
Initial commit (with only bringup).
Browse files Browse the repository at this point in the history
  • Loading branch information
maxpolzin committed Feb 4, 2024
0 parents commit b56594c
Show file tree
Hide file tree
Showing 12 changed files with 154 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: ci

on:
push:
branches:
- 'main'

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:iron
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
ARG ROS_DISTRO=iron

FROM ros:${ROS_DISTRO}-ros-core

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
python3-colcon-common-extensions \
ros-${ROS_DISTRO}-tf2-msgs \
ros-${ROS_DISTRO}-rosapi-msgs \
ros-${ROS_DISTRO}-geometry-msgs \
ros-${ROS_DISTRO}-sensor-msgs \
ros-${ROS_DISTRO}-rosbridge-msgs \
ros-${ROS_DISTRO}-ros2-control \
ros-${ROS_DISTRO}-demo-nodes-cpp \
ros-${ROS_DISTRO}-demo-nodes-py \
&& rm -rf /var/lib/apt/lists/*

COPY ros_entrypoint.sh .

WORKDIR /colcon_ws
COPY helix_bringup src/helix_bringup

RUN . /opt/ros/${ROS_DISTRO}/setup.sh && colcon build --symlink-install --event-handlers console_direct+

RUN echo 'alias build="colcon build --symlink-install --event-handlers console_direct+"' >> ~/.bashrc
RUN echo 'source /opt/ros/iron/setup.bash; source /colcon_ws/install/setup.bash; ros2 launch helix_bringup helix_bringup.launch.py' >> /run.sh && chmod +x /run.sh
RUN echo 'alias run="su - ros /run.sh"' >> /etc/bash.bashrc
5 changes: 5 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

REPOSITORY_NAME="$(basename "$(dirname -- "$( readlink -f -- "$0"; )")")"

docker build --progress=plain -t ghcr.io/helix-robotics-ag/${REPOSITORY_NAME}:iron .
2 changes: 2 additions & 0 deletions helix_bringup/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__
.pyc
Empty file.
21 changes: 21 additions & 0 deletions helix_bringup/launch/helix_bringup.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from launch import LaunchDescription
from launch_ros.actions import Node

def generate_launch_description():

ld = LaunchDescription()

talker_node = Node(
package="demo_nodes_cpp",
executable="talker",
)

listener_node = Node(
package="demo_nodes_py",
executable="listener"
)

ld.add_action(talker_node)
ld.add_action(listener_node)

return ld
15 changes: 15 additions & 0 deletions helix_bringup/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>helix_bringup</name>
<version>0.0.1</version>
<description>The helix_brinup package</description>
<maintainer email="[email protected]">max</maintainer>
<license>proprietary</license>

<exec_depend>ros2launch</exec_depend>

<export>
<build_type>ament_python</build_type>
</export>
</package>
Empty file.
4 changes: 4 additions & 0 deletions helix_bringup/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[develop]
script_dir=$base/lib/helix_bringup
[install]
install_scripts=$base/lib/helix_bringup
23 changes: 23 additions & 0 deletions helix_bringup/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import os
from glob import glob
from setuptools import setup

package_name = 'helix_bringup'

setup(
name=package_name,
version='0.0.1',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['package.xml']),
(os.path.join('share', package_name, 'launch'), glob(os.path.join('launch', '*launch.[pxy][yma]*'))),
],
install_requires=['setuptools'],
zip_safe=True,
maintainer='max',
maintainer_email='[email protected]',
description='Helix Soft Robot Manipulator',
license='Helix Robotics AG',
)
9 changes: 9 additions & 0 deletions ros_entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -e

id -u ros &>/dev/null || adduser --quiet --disabled-password --gecos '' --uid ${UID:=1000} --uid ${GID:=1000} ros

source /opt/ros/${ROS_DISTRO}/setup.bash
source /colcon_ws/install/setup.bash

exec "$@"
13 changes: 13 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

REPOSITORY_NAME="$(basename "$(dirname -- "$( readlink -f -- "$0"; )")")"

docker run -it --rm \
--network=host \
--ipc=host \
--pid=host \
--env UID=$(id -u) \
--env GID=$(id -g) \
--privileged \
--volume ./helix_bringup:/colcon_ws/src/helix_bringup \
ghcr.io/helix-robotics-ag/${REPOSITORY_NAME}:iron

0 comments on commit b56594c

Please sign in to comment.