Skip to content

Commit

Permalink
Applied necessary changes to docs and docker files for Jazzy (#270)
Browse files Browse the repository at this point in the history
* Applied necessary changes to docs and docker files for Jazzy

Signed-off-by: JesusSilvaUtrera <[email protected]>

* Changed back the year of the docker files

Signed-off-by: JesusSilvaUtrera <[email protected]>

---------

Signed-off-by: JesusSilvaUtrera <[email protected]>
  • Loading branch information
JesusSilvaUtrera authored Sep 18, 2024
1 parent cc40fa5 commit b317717
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Please remove the appropriate section.
For example, if this is a new feature, remove all sections except for the "New feature" section
If this is your first time opening a PR, be sure to check the contribution guide:
https://github.com/Ekumen-OS/andino/blob/humble/CONTRIBUTING.md
https://github.com/Ekumen-OS/andino/blob/jazzy/CONTRIBUTING.md
-->

# 🦟 Bug fix
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ name: colcon build & test
on:
push:
branches:
- humble
- jazzy
pull_request:
branches:
- humble
- jazzy
workflow_dispatch:

env:
ROS_DISTRO: humble
ROS_DISTRO: jazzy

# Cancel previously running PR jobs
concurrency:
Expand All @@ -22,7 +22,7 @@ jobs:
name: Compile and test
runs-on: ubuntu-latest
container:
image: ubuntu:22.04
image: ubuntu:24.04
steps:
- uses: actions/checkout@v3
- uses: ros-tooling/[email protected]
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

</div>

[**UNSTABLE BRANCH**]

Andino is a fully open-source diff drive robot designed for educational purposes and low-cost applications.
It is fully integrated with ROS 2 and it is a great base platform to improve skills over the robotics field.
With its open-source design, anyone can modify and customize the robot to suit their specific needs.
Expand Down Expand Up @@ -55,16 +57,16 @@ Visit [`andino_hardware`](./andino_hardware/) for assembly instructions.

### Platforms

- ROS 2: Humble Hawksbill
- ROS 2: Jazzy Jalisco
- OS:
- Ubuntu 22.04 Jammy Jellyfish
- Ubuntu Mate 22.04 (On real robot (e.g: Raspberry Pi 4B))
- Ubuntu 24.04 Noble Numbat
- Ubuntu Server 24.04.1 (WIP) (On real robot (e.g: Raspberry Pi 4B))

### Build from Source

#### Dependencies

1. Install [ROS 2](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html)
1. Install [ROS 2](https://docs.ros.org/en/jazzy/Installation/Ubuntu-Install-Debs.html)
2. Install [colcon](https://colcon.readthedocs.io/en/released/user/installation.html)

#### colcon workspace
Expand Down
15 changes: 5 additions & 10 deletions andino_hardware/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ For uploading the microcontroller firmware please refer to [`andino_firmware`](.

The SBC used in this project is a Raspberry Pi 4b so the guidelines here will refer particularly to this family of on-board computers, however extending its use to other families is possible as well.

### Operative System
### Operative System [WIP]

Ubuntu Mate 22.04 ARM64 is the recommended operative system for this project. This OS provides good capabilities for a educational platform as well as good performance.
Ubuntu Server 24.04.1 is the recommended operative system for this project if you want to use the `jazzy` distro, since Ubuntu Mate 24 is not yet released.

For installing this OS in the Raspberry:
1. Download the image from here: [ubuntu mate download](https://ubuntu-mate.org/download/arm64/)
1. Download the image from here: [download Ubuntu 24 for Raspberry](https://ubuntu.com/download/raspberry-pi)


2. Install OS to a microSD card using [Raspberry Pi Imager](https://www.raspberrypi.com/software/).
Expand Down Expand Up @@ -182,13 +182,6 @@ Configure it properly:
sudo usermod -a -G plugdev $USER
```
Note you will need a reboot after this to be effective.
2. Remove `brltty` from the system
```
sudo apt remove brltty
```
In Ubuntu 22.04 seems to be an issue with some chip drivers and the `brltty` daemon. To avoid this conflict we remove `brltty` as suggested. See [this stackoverflow post](https://stackoverflow.com/questions/70123431/why-would-ch341-uart-is-disconnected-from-ttyusb) for further information.



#### Raspberry Camera Module V2

Expand Down Expand Up @@ -359,6 +352,8 @@ export ROS_DISTRO=humble
```
And then proceed to install the workspace dependencies:
```
sudo apt install python3-rosdep
sudo rosdep init
rosdep install --from-paths src -i -y -r
```
Note that option `-r` has been added. For ARM based processors, there are missing packages, e.g. those related to simulation. We would not try to run the simulation in the compute platform of andino, however for convenience it is added here.
Expand Down
34 changes: 19 additions & 15 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
FROM osrf/ros:humble-desktop-full
FROM osrf/ros:jazzy-desktop-full

# Arguments for building
ARG USERID
ARG USER
ARG USER=ubuntu

# Setup environment
ENV TERM linux
ENV DEBIAN_FRONTEND noninteractive
ENV TERM=linux
ENV DEBIAN_FRONTEND=noninteractive
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections

# Copy requirement files and install dependencies
Expand All @@ -15,32 +14,37 @@ RUN apt-get update && apt-get install --no-install-recommends -y $(cat requireme
RUN rm requirements.txt

# Create a user with passwordless sudo
RUN adduser --uid $USERID --gecos "ekumen developer" --disabled-password $USER
RUN adduser $USER sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN echo "export QT_X11_NO_MITSHM=1" >> /home/$USER/.bashrc
USER $USER

# Install fixuid and configure it
RUN curl -SsL https://github.com/boxboat/fixuid/releases/download/v0.6.0/fixuid-0.6.0-linux-amd64.tar.gz | tar -C /usr/local/bin -xzf - && \
chown root:root /usr/local/bin/fixuid && \
chmod 4755 /usr/local/bin/fixuid && \
mkdir -p /etc/fixuid && \
printf "user: $USER\ngroup: $USER\n" > /etc/fixuid/config.yml

# Adds USER to dialout and plugdev group.
# This is needed to access the serial ports, for further references check
# the libserial documentation.
RUN sudo usermod -a -G dialout $USER
RUN sudo usermod -a -G plugdev $USER

USER $USER

# Creates the src folder of the workspace.
RUN mkdir -p /home/$USER/ws/src

# Adds to bashrc the ros humble overlay sourcing.
RUN echo "source /opt/ros/humble/setup.bash" >> /home/$USER/.bashrc
# Adds colcon autocomplete
RUN echo "source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash" >> /home/$USER/.bashrc
# Adds gazebo sourcing.
RUN echo "source /usr/share/gazebo/setup.bash" >> /home/$USER/.bashrc
# Adds to bashrc the ros jazzy overlay sourcing.
RUN echo "source /opt/ros/jazzy/setup.bash" >> /home/$USER/.bashrc

# Updates
RUN sudo apt upgrade -y && sudo apt update && rosdep update
RUN sudo apt update && sudo apt upgrade -y && rosdep update

# Defines a workspace folder.
WORKDIR /home/$USER/ws

# Use fixuid as the entrypoint in quiet mode
ENTRYPOINT ["fixuid", "-q"]

CMD ["/bin/bash"]
6 changes: 3 additions & 3 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ For NVIDIA GPU support, `nvidia-container-toolkit` should be installed. *Skip th

#### Building image and running container

- Build the docker image whose default name is `ros2_humble_andino`:
- Build the docker image whose default name is `ros2_jazzy_andino`:

```sh
./docker/build.sh
Expand All @@ -29,7 +29,7 @@ You can also try to set a specific image name:
./docker/build.sh -i my_fancy_image_name
```

- Run a docker container from `ros2_humble_andino` called `ros2_humble_andino_container`:
- Run a docker container from `ros2_jazzy_andino` called `ros2_jazzy_andino_container`:

```sh
./docker/run.sh
Expand All @@ -50,7 +50,7 @@ You can also try to set specific image and container names:
- Inside the container, install dependencies via `rosdep`:

```sh
rosdep install -i -y --rosdistro humble --from-paths src
rosdep install -i -y --rosdistro jazzy --from-paths src
```

Note that the repository is mounted into a workspace. That is convenient if you
Expand Down
12 changes: 5 additions & 7 deletions docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ set -e
function show_help() {
echo $'\nUsage:\t build.sh [OPTIONS] \n
Options:\n
\t-i --image_name\t\t Name of the image to be built (default ros2_humble_andino).\n
\t-i --image_name\t\t Name of the image to be built (default ros2_jazzy_andino).\n
Example:\n
\tbuild.sh --image_name custom_image_name\n'
}

echo "Building the docker image for ros2 humble andino development."
echo "Building the docker image for ros2 jazzy andino development."

SCRIPT_FOLDER_PATH="$(cd "$(dirname "$0")"; pwd)"
CONTEXT_FOLDER_PATH="$(cd "$(dirname "$0")"; cd .. ; pwd)"
Expand All @@ -57,15 +57,13 @@ while [[ "$#" -gt 0 ]]; do
done

# Update the arguments to default values if needed.
OS_VERSION="focal"
IMAGE_NAME=${IMAGE_NAME:-ros2_humble_andino}
OS_VERSION="noble"
IMAGE_NAME=${IMAGE_NAME:-ros2_jazzy_andino}
DOCKERFILE_PATH=$SCRIPT_FOLDER_PATH/Dockerfile

USERID=$(id -u)
USER=$(whoami)
USER=ubuntu

sudo docker build -t $IMAGE_NAME \
--file $DOCKERFILE_PATH \
--build-arg USERID=$USERID \
--build-arg USER=$USER \
$CONTEXT_FOLDER_PATH
1 change: 1 addition & 0 deletions docker/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ python3-setuptools
software-properties-common
sudo
tmux
wget
xterm
19 changes: 9 additions & 10 deletions docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ set +e
function show_help() {
echo $'\nUsage:\t run.sh [OPTIONS] \n
Options:\n
\t-i --image_name\t\t Name of the image to be run (default ros2_humble_andino).\n
\t-c --container_name\t Name of the container(default ros2_humble_andino_container).\n
\t-i --image_name\t\t Name of the image to be run (default ros2_jazzy_andino).\n
\t-c --container_name\t Name of the container(default ros2_jazzy_andino_container).\n
\t--use_nvidia\t\t Use nvidia runtime.\n
Examples:\n
\trun.sh\n
Expand Down Expand Up @@ -79,22 +79,20 @@ done

# Update the arguments to default values if needed.

IMAGE_NAME=${IMAGE_NAME:-ros2_humble_andino}
CONTAINER_NAME=${CONTAINER_NAME:-ros2_humble_andino_container}
IMAGE_NAME=${IMAGE_NAME:-ros2_jazzy_andino}
CONTAINER_NAME=${CONTAINER_NAME:-ros2_jazzy_andino_container}

USER=ubuntu

SSH_PATH=/home/$USER/.ssh
WORKSPACE_SRC_CONTAINER=/home/$(whoami)/ws/src/$REPOSITORY_FOLDER_NAME
WORKSPACE_ROOT_CONTAINER=/home/$(whoami)/ws
WORKSPACE_SRC_CONTAINER=/home/$USER/ws/src/$REPOSITORY_FOLDER_NAME
WORKSPACE_ROOT_CONTAINER=/home/$USER/ws
SSH_AUTH_SOCK_USER=$SSH_AUTH_SOCK

# Create cache folders to store colcon build files
mkdir -p ${REPOSITORY_FOLDER_PATH}/.build
mkdir -p ${REPOSITORY_FOLDER_PATH}/.install

# Transfer the ownership to the user
chown -R "$USER" ${REPOSITORY_FOLDER_PATH}/.build
chown -R "$USER" ${REPOSITORY_FOLDER_PATH}/.install

# Check if name container is already taken.
if sudo -g docker docker container ls -a | grep "${CONTAINER_NAME}$" -c &> /dev/null; then
printf "Error: Docker container called $CONTAINER_NAME is already opened. \
Expand All @@ -113,6 +111,7 @@ sudo docker run --privileged --net=host -it $NVIDIA_FLAGS \
-v ${REPOSITORY_FOLDER_PATH}/.build:$WORKSPACE_ROOT_CONTAINER/build:rw \
-v ${REPOSITORY_FOLDER_PATH}/.install:$WORKSPACE_ROOT_CONTAINER/install:rw \
-v $SSH_PATH:$SSH_PATH \
-u 1000:1000 \
--name $CONTAINER_NAME $IMAGE_NAME
xhost -

Expand Down

0 comments on commit b317717

Please sign in to comment.