Skip to content

Commit

Permalink
ubuntu22.04 support (jsk-ros-pkg#626)
Browse files Browse the repository at this point in the history
* [GA] add github action for jammy using ROS-O

* update

* update

* ubnutu:jammy

* ubnutu-22.04

* [GA] setup ros workspace and catkin build

* [GA] noetic->one

* [GA] python3-wstool

* [GA] sudo apt install python3-wstool

* [spinal] cmake17

* add rosinstall for debian. modified from noetic one

* update rosinstall path

* fix typo

* [motor test] C++17

* [GA] catkin build only aerial_robot and run catkin test

* skip libgeographiclib-dev

* [GA] ignore rosdep install error temporality

* [ROS-O][rosinstall] use C++17 patched mocap_optitrack package (jsk-ros-pkg#13)

* [ROS-O][rosinstall] update external repository path and version (jsk-ros-pkg#15)

* use self released apt repository

* update external repositry version

* remove external repositry from rosinstall because they are released

* remove error ignore flag when rosdep install

* [mocap_optitrack] add mocap_optitrack package to rosinstall

* [ROS-O][GA] build all packages

* [CI] remove the script for EoL ros distribution

* [CI][GA] merge ros one distribution test into .travis.sh

* [ROS-O] crate configure script to install ros-o system for jammy

* [ROS-O] update REAMDE to show the install instruction on Ubuntu22.04

* fix typo in README

* [rosinstall] remove rosinstall for EoL distribution

---------

Co-authored-by: Moju Zhao <[email protected]>
Co-authored-by: Moju Zhao <[email protected]>
  • Loading branch information
3 people committed Jan 27, 2025
1 parent ec16070 commit 04c9e56
Show file tree
Hide file tree
Showing 8 changed files with 124 additions and 77 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ros_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:
fail-fast: false
matrix:
include:
- ROS_DISTRO : kinetic
DOCKER_IMAGE : ubuntu:xenial
- ROS_DISTRO : melodic
DOCKER_IMAGE : ubuntu:bionic
- ROS_DISTRO : noetic
DOCKER_IMAGE : ubuntu:focal
- ROS_DISTRO : one
DOCKER_IMAGE : ubuntu:jammy
steps:
- name: Setup OS
run: |
Expand Down
56 changes: 18 additions & 38 deletions .travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@

set -ex

apt-get update -qq && apt-get install -y -q wget sudo lsb-release gnupg git sed build-essential # for docker
apt-get update -qq && apt-get install -y -q wget sudo lsb-release gnupg git sed build-essential ca-certificates # for docker
echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections

echo "Testing branch $TRAVIS_BRANCH of $REPOSITORY_NAME"
sudo sh -c "echo \"deb ${REPOSITORY} `lsb_release -cs` main\" > /etc/apt/sources.list.d/ros-latest.list"
wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
sudo apt-get update -qq

# Install ROS
if [[ "$ROS_DISTRO" == "noetic" ]]; then
sudo apt-get install -y -q python3-catkin-pkg python3-catkin-tools python3-rosdep python3-wstool python3-rosinstall-generator python3-osrf-pycommon python-is-python3
if [[ "$ROS_DISTRO" == "one" ]]; then
${CI_SOURCE_PATH}/configure.sh
else
sudo apt-get install -y -q python-catkin-pkg python-catkin-tools python-rosdep python-wstool python-rosinstall-generator
sudo sh -c "echo \"deb ${REPOSITORY} `lsb_release -cs` main\" > /etc/apt/sources.list.d/ros-latest.list"
wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
sudo apt-get update -qq

if [[ "$ROS_DISTRO" == "noetic" ]]; then
sudo apt-get install -y -q python3-catkin-pkg python3-catkin-tools python3-rosdep python3-wstool python3-rosinstall-generator python3-osrf-pycommon python-is-python3
else
sudo apt-get install -y -q python-catkin-pkg python-catkin-tools python-rosdep python-wstool python-rosinstall-generator
fi
sudo apt-get install -y -q ros-$ROS_DISTRO-catkin

# Setup for rosdep
sudo rosdep init
rosdep update --include-eol-distros
fi
sudo apt-get install -y -q ros-$ROS_DISTRO-catkin

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

# Setup for rosdep
sudo rosdep init
# use snapshot of rosdep list
# https://github.com/ros/rosdistro/pull/31570#issuecomment-1000497517
if [[ "$ROS_DISTRO" = "kinetic" ]]; then
sudo rm /etc/ros/rosdep/sources.list.d/20-default.list
sudo wget https://gist.githubusercontent.com/cottsay/b27a46e53b8f7453bf9ff637d32ea283/raw/476b3714bb90cfbc6b8b9d068162fc6408fa7f76/30-xenial.list -O /etc/ros/rosdep/sources.list.d/30-xenial.list
fi
rosdep update --include-eol-distros
source /opt/ros/${ROS_DISTRO}/setup.bash

# Install source code
mkdir -p ~/catkin_ws/src
Expand All @@ -39,26 +39,6 @@ wstool merge -t src src/${REPOSITORY_NAME}/aerial_robot_${ROS_DISTRO}.rosinstall
wstool update -t src
rosdep install --from-paths src -y -q -r --ignore-src --rosdistro ${ROS_DISTRO} # -r is indisapensible

if [ ${ROS_DISTRO} = 'kinetic' ]; then
path=~/.gazebo/models/sun
echo "manually download the sun gazebo model to ${path}"
mkdir -p ${path}
wget https://raw.githubusercontent.com/osrf/gazebo_models/master/sun/model-1_2.sdf -P ${path}
wget https://raw.githubusercontent.com/osrf/gazebo_models/master/sun/model-1_3.sdf -P ${path}
wget https://raw.githubusercontent.com/osrf/gazebo_models/master/sun/model-1_4.sdf -P ${path}
wget https://raw.githubusercontent.com/osrf/gazebo_models/master/sun/model.sdf -P ${path}
wget https://raw.githubusercontent.com/osrf/gazebo_models/master/sun/model.config -P ${path}

path=~/.gazebo/models/ground_plane
echo "manually download the ground_plane gazebo model to ${path}"
mkdir -p ${path}
wget https://raw.githubusercontent.com/osrf/gazebo_models/master/ground_plane/model-1_2.sdf -P ${path}
wget https://raw.githubusercontent.com/osrf/gazebo_models/master/ground_plane/model-1_3.sdf -P ${path}
wget https://raw.githubusercontent.com/osrf/gazebo_models/master/ground_plane/model-1_4.sdf -P ${path}
wget https://raw.githubusercontent.com/osrf/gazebo_models/master/ground_plane/model.sdf -P ${path}
wget https://raw.githubusercontent.com/osrf/gazebo_models/master/ground_plane/model.config -P ${path}
fi

# Build
catkin config --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
catkin build -p1 -j1 --no-status
Expand Down
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,40 @@

## Setup

### Ubuntu 18.04, 20.04

#### Install ROS1 from official site
- Melodic: https://wiki.ros.org/melodic/Installation/Ubuntu
- Noetic: https://wiki.ros.org/noetic/Installation/Ubuntu

#### Build

```bash
source /opt/ros/${ROS_DISTRO}/setup.bash # please replace ${ROS_DISTRO} with your specific env variable, e.g., melodic
sudo apt install -y python3-wstool python3-catkin-tools # for melodic, please replace `python3` with `python`
mkdir -p ~/ros/jsk_aerial_robot_ws/src
cd ~/ros/jsk_aerial_robot_ws
sudo rosdep init
rosdep update
wstool init src
wstool set -u -t src jsk_aerial_robot http://github.com/jsk-ros-pkg/jsk_aerial_robot --git
./src/jsk_aerial_robot/configure.sh # for configuration especially for ros-o in jammy
wstool merge -t src src/jsk_aerial_robot/aerial_robot_${ROS_DISTRO}.rosinstall
wstool update -t src
rosdep install -y -r --from-paths src --ignore-src --rosdistro $ROS_DISTRO
catkin build
```

### Ubuntu 22.04 (ROS-O)

```bash
sudo apt install -y python3-wstool
mkdir -p ~/ros/jsk_aerial_robot_ws/src
cd ~/ros/jsk_aerial_robot_ws
wstool init src
wstool set -u -t src jsk_aerial_robot http://github.com/jsk-ros-pkg/jsk_aerial_robot --git
./src/jsk_aerial_robot/configure.sh # for configuration especially for ros-o in jammy
source /opt/ros/one/setup.bash
wstool merge -t src src/jsk_aerial_robot/aerial_robot_${ROS_DISTRO}.rosinstall
wstool update -t src
rosdep install -y -r --from-paths src --ignore-src --rosdistro $ROS_DISTRO
Expand Down
55 changes: 55 additions & 0 deletions aerial_robot_debian.rosinstall
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# aerial robot third party
- git:
local-name: aerial_robot_3rdparty
uri: https://github.com/JSKAerialRobot/aerial_robot_3rdparty.git
version: 4085d3a

# kalman filter
- git:
local-name: kalman_filter
uri: https://github.com/JSKAerialRobot/kalman_filter.git
version: 5c7a410

# the sensor interface
- git:
local-name: sensor_interface
uri: https://github.com/JSKAerialRobot/sensor_interface.git
version: e8286e7

# RTK-GPS (forked)
- git:
local-name: ublox_gps
uri: https://github.com/tongtybj/ublox.git
version: holybro_rtk_m8p

# rosserial (forked)
- git:
local-name: rosserial
uri: https://github.com/tongtybj/rosserial.git
version: rosservice_server

# livox ros driver
# modification for quick build of ROS1 version
- git:
local-name: livox_ros_driver2
uri: https://github.com/tongtybj/livox_ros_driver2.git
version: PR/ros1

# fast lio
# modification for fast odometry based on EKF
- git:
local-name: fast_lio
uri: https://github.com/tongtybj/FAST_LIO
version: PR/odometry

# realsense
#- git:
# local-name: realsense-ros
# uri: https://github.com/tongtybj/realsense-ros.git
# version: multi_realsense_t265

# mocap optitrack
- git:
local-name: mocap_optitrack
uri: https://github.com/sugikazu75/mocap_optitrack.git
version: 50fb60d
35 changes: 0 additions & 35 deletions aerial_robot_kinetic.rosinstall

This file was deleted.

2 changes: 1 addition & 1 deletion aerial_robot_nerve/motor_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.0.2)
project(motor_test)

add_compile_options(-std=c++14)
add_compile_options(-std=c++17)

find_package(catkin REQUIRED COMPONENTS
roscpp
Expand Down
2 changes: 1 addition & 1 deletion aerial_robot_nerve/spinal/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.0.2)
project(spinal)

add_compile_options(-std=c++14)
add_compile_options(-std=c++17)

find_package(catkin REQUIRED COMPONENTS
roscpp
Expand Down
21 changes: 21 additions & 0 deletions configure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

set -e

# Get VERSION_CODENAME from /etc/os-release
DISTRO=$(grep '^VERSION_CODENAME=' /etc/os-release | cut -d'=' -f2)

# Conditional branching based on distro_codename
if [ "$DISTRO" = "jammy" ]; then
echo "This is Ubuntu 22.04 (jammy). Install ROS-O"

sudo apt install -y python3-pip
pip3 install catkin-tools
echo "deb [trusted=yes] https://raw.githubusercontent.com/sugikazu75/ros-o-builder/$DISTRO-one-unstable/repository ./" | sudo tee /etc/apt/sources.list.d/sugikazu75_ros-o-builder.list
sudo apt update
sudo apt install -y python3-rosdep2
echo "yaml https://raw.githubusercontent.com/sugikazu75/ros-o-builder/$DISTRO-one-unstable/repository/local.yaml debian" | sudo tee /etc/ros/rosdep/sources.list.d/1-sugikazu75_ros-o-builder.list
rosdep update
sudo apt install -y ros-one-desktop-full
sudo apt install -y python3-wstool
fi

0 comments on commit 04c9e56

Please sign in to comment.