Skip to content

Commit

Permalink
Initial Jazzy implementation (#15)
Browse files Browse the repository at this point in the history
* Initial migration to Jazzy. Not all packages exist as binaries yet

* Add a note about firmware compatibility to the readme

* Add exception handling to the file i/o so the node doesn't just crash if we're missing a file

* Add proper escape characters to title backslashes

* Add improved exception handling to the wifi settings parser

* Update CI

* Properly escape all `\` characters in stylized titles, add translation & link to generator page in comments

* Add copyright & contribution notices, fix up code formatting, import ordering. Disable linting for some specific lines where appropriate

* Add XML namespaces & version to cyclone DDS config

* Omit XML linting (for now); it's consistently timing out and failing

* Class newline

* Add exception handling to the file preview

* Apply formatting to exception text

* Add an option to force the Create3 settings to be reapplied, even if we haven't changed anything else. Always apply the _do_not_use namespace, as we're universally using the republisher now

* Remove superfluous concatenation

* Fix trailing newlines

* Enable testing packages for CI

* Write the value of the enum to the bash file, use a regex to match existing items in the file

* Disable checks on two lines with long format strings

* Add exception handling for install & uninstall

* Add an error prompt to show errors during installation

* Handle KeyErrors separately

* Add newline to end of file

* Fix indentation

* `''.format` -> `f''`

* Update the default system file, print the keys instead of the enums

* Remove uses of `.value` when printing enums, just add a `__str__` function to the relevant classes
  • Loading branch information
civerachb-cpr authored Sep 25, 2024
1 parent 8055a59 commit 0105584
Show file tree
Hide file tree
Showing 20 changed files with 574 additions and 299 deletions.
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/1-bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ body:
- Select One
- Galactic
- Humble
- Jazzy
validations:
required: true
- type: dropdown
Expand All @@ -52,6 +53,7 @@ body:
- Select One
- Ubuntu 20.04
- Ubuntu 22.04
- Ubuntu 24.04
- Other Linux
- Windows / MAC
validations:
Expand Down
19 changes: 14 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,20 @@ name: turtlebot4_setup_ci
on: [push, pull_request]

jobs:
turtlebot4_humble_ci:
name: Humble
runs-on: ubuntu-22.04
turtlebot4_jazzy_ci:
name: Jazzy
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2.3.4
- uses: ros-tooling/setup-ros@v0.3
- uses: ros-tooling/setup-ros@v0.7
with:
required-ros-distributions: humble
required-ros-distributions: jazzy
use-ros2-testing: true
- uses: ros-tooling/action-ros-ci@v0.3
id: action_ros_ci_step
with:
target-ros2-distro: jazzy
import-token: ${{ secrets.GITHUB_TOKEN }}
skip-tests: false
package-name:
turtlebot4_setup
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ install(
DESTINATION lib/${PROJECT_NAME}
)

# disable XML linting; it consistently times out
# TODO (civerachb-cpr) -- figure out why it's timing out and re-enable
# hypothesis: it's related to the additional XML files in etc/turtlebot4
list(APPEND AMENT_LINT_AUTO_EXCLUDE
ament_cmake_xmllint
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
Expand Down
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Contributing to TurtleBot4 Setup

Any contribution that you make to this repository will
be under the Apache 2 License, as dictated by that
[license](http://www.apache.org/licenses/LICENSE-2.0.html):

~~~
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
~~~
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Setup scripts and tools for the TurtleBot 4 Raspberry Pi.

Visit the [TurtleBot 4 User Manual](https://turtlebot.github.io/turtlebot4-user-manual/software/turtlebot4_setup.html) for more details.

Make sure your Create® 3 is updated to the `I.*.*` firmware; older versions of the firmware are not compatible with ROS 2 Jazzy.

# Create an image manually

Follow these instructions if you wish to create a Turtlebot4 image manually.
Expand All @@ -12,14 +14,14 @@ Follow these instructions if you wish to create a Turtlebot4 image manually.

First install the [Raspberry Pi Imager](https://www.raspberrypi.com/software/).

- Insert your SD card into your PC and run the Raspberry Pi Imager. Follow the instructions and install Ubuntu 22.04 Server (64-bit) onto the SD card.
- Ensure your Raspberry Pi 4 is not powered before inserting the flashed SD card.
- Insert your SD card into your PC and run the Raspberry Pi Imager. Follow the instructions and install Ubuntu 24.04 Server (64-bit) onto the SD card.
- Ensure your Raspberry Pi 4 is not powered before inserting the flashed SD card.
- You can set up the Raspberry Pi by either connecting it to your network via Ethernet or by using a keyboard and HDMI monitor via a micro HDMI cable.

### Ethernet Setup

- Connect the Raspberry Pi to your Network with an Ethernet cable.
- Boot the Raspberry Pi.
- Boot the Raspberry Pi.
- Find the Raspberry Pi's IP using your router's portal.
- SSH into the Raspberry Pi using the IP address.
```bash
Expand Down Expand Up @@ -62,7 +64,7 @@ ssh ubuntu@xxx.xxx.xxx.xxx
## Download and run the setup script

```
wget -qO - https://raw.githubusercontent.com/turtlebot/turtlebot4_setup/humble/scripts/turtlebot4_setup.sh | bash
wget -qO - https://raw.githubusercontent.com/turtlebot/turtlebot4_setup/jazzy/scripts/turtlebot4_setup.sh | bash
```

The script will automatically install ROS 2 Humble, TurtleBot 4 packages, and other important apt packages. It will also configure the RPi4 to work in a TurtleBot 4. Once complete, the RPi4 should be rebooted with `sudo reboot`. Then, run `turtlebot4-setup` to configure the robot with the setup tool.
The script will automatically install ROS 2 Jazzy, TurtleBot 4 packages, and other important apt packages. It will also configure the RPi4 to work in a TurtleBot 4. Once complete, the RPi4 should be rebooted with `sudo reboot`. Then, run `turtlebot4-setup` to configure the robot with the setup tool.
6 changes: 6 additions & 0 deletions etc/rc.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# Give ourselves some swap to deal with RAM issues
if [ -f /swapfile ]; then
swapon /swapfile
fi
6 changes: 5 additions & 1 deletion etc/turtlebot4/cyclonedds_rpi.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<CycloneDDS>
<?xml version="1.0" encoding="utf-8"?>
<CycloneDDS
xmlns="https://cdds.io/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://cdds.io/config https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/master/etc/cyclonedds.xsd">
<Domain>
<General>
<Interfaces>
Expand Down
2 changes: 1 addition & 1 deletion etc/turtlebot4/discovery.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
source /opt/ros/humble/setup.bash
source /opt/ros/jazzy/setup.bash
fastdds discovery -i 0 -p 11811
4 changes: 2 additions & 2 deletions etc/turtlebot4/fastdds_rpi.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<dds>
<?xml version="1.0" encoding="UTF-8"?>
<dds xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">
<profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">
<participant profile_name="turtlebot4_default_profile" is_default_profile="true">
<rtps/>
Expand Down
4 changes: 2 additions & 2 deletions etc/turtlebot4/setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export ROS_DOMAIN_ID=0
export ROS_DISCOVERY_SERVER=
export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
export TURTLEBOT4_DIAGNOSTICS=1
export WORKSPACE_SETUP=/opt/ros/humble/setup.bash
export WORKSPACE_SETUP=/opt/ros/jazzy/setup.bash
export ROS_SUPER_CLIENT=False

source $WORKSPACE_SETUP
source $WORKSPACE_SETUP
7 changes: 4 additions & 3 deletions etc/turtlebot4/system
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
MODEL:standard
VERSION:1.0.0
ROS:Humble
MODEL:lite
VERSION:2.0.0
ROS:Jazzy
HOSTNAME:ubuntu
2 changes: 1 addition & 1 deletion scripts/create_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Help()
{
echo "Create 3 update script for robots running H.1.0 or higher"
echo "Create 3 update script for robots running I.*.*"
echo
echo "usage: bash create_update.sh /path/to/image.swu [-h]"
echo "options:"
Expand Down
8 changes: 6 additions & 2 deletions scripts/humble.sh → scripts/jazzy.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
#!/usr/bin/env bash
sudo apt update && sudo apt install curl gnupg lsb-release -y

# Add ROS sources
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null

# Install the packages
sudo apt update
sudo apt install -y \
ros-humble-ros-base \
ros-jazzy-ros-base \
build-essential \
cmake \
git \
wget \
ros-dev-tools \
socat \
network-manager \
chrony
chrony
14 changes: 7 additions & 7 deletions scripts/turtlebot4_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@ echo "Setting up Turtlebot4";

sudo apt update && sudo apt upgrade

wget -qO - https://raw.githubusercontent.com/turtlebot/turtlebot4_setup/humble/scripts/humble.sh | bash
wget -qO - https://raw.githubusercontent.com/turtlebot/turtlebot4_setup/jazzy/scripts/jazzy.sh | bash

sudo apt update && sudo apt upgrade

sudo apt install -y ros-humble-ros-base \
ros-humble-turtlebot4-setup \
ros-humble-turtlebot4-robot \
ros-humble-irobot-create-control \
ros-humble-turtlebot4-navigation \
sudo apt install -y ros-jazzy-ros-base \
ros-jazzy-turtlebot4-setup \
ros-jazzy-turtlebot4-robot \
ros-jazzy-irobot-create-control \
ros-jazzy-turtlebot4-navigation \
ros-dev-tools \
socat \
network-manager \
chrony

sudo rm /etc/netplan/50-cloud-init.yaml

git clone https://github.com/turtlebot/turtlebot4_setup.git -b humble && \
git clone https://github.com/turtlebot/turtlebot4_setup.git -b jazzy && \
sudo mv turtlebot4_setup/boot/firmware/* /boot/firmware && rm turtlebot4_setup/ -rf

echo "export ROBOT_SETUP=/etc/turtlebot4/setup.bash" | sudo tee -a ~/.bashrc
Expand Down
4 changes: 2 additions & 2 deletions turtlebot4_discovery/configure_discovery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ do
# Prompt the user to offer the ability to correct the last server info or add additional servers
while [ 1 ]
do
read -p "Re-enter the last server (r), add another server (a), or done (d): " option
read -p "Re-enter the last server (r), add another server (a), or done (d): " option
if [[ $option =~ ^[r,R].* ]];
then
echo "Removing last server entry, re-enter the correct server information"
Expand Down Expand Up @@ -173,7 +173,7 @@ sudo mkdir -p /etc/turtlebot4_discovery/

# Create setup.bash file
setup_file_temp="/tmp/turtlebot4_discovery_setup.bash"
echo "source /opt/ros/humble/setup.bash" > $setup_file_temp
echo "source /opt/ros/jazzy/setup.bash" > $setup_file_temp
echo "export RMW_IMPLEMENTATION=rmw_fastrtps_cpp" >> $setup_file_temp
echo "[ -t 0 ] && export ROS_SUPER_CLIENT=True || export ROS_SUPER_CLIENT=False" >> $setup_file_temp

Expand Down
Loading

0 comments on commit 0105584

Please sign in to comment.