Skip to content

Commit 3a87590

Browse files
author
Murilo Marinho
committed
Adding devel scripts
1 parent c613771 commit 3a87590

File tree

5 files changed

+180
-11
lines changed

5 files changed

+180
-11
lines changed

.devel/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# MacOS Setup
2+
3+
Because these are system-level packages, `brew install` isn't enough.
4+
5+
- Install docker desktop from
6+
https://www.docker.com/products/docker-desktop/
7+
8+
- Open and login
9+
10+
```commandline
11+
docker buildx build -t sas_deb_builder --platform=linux/amd64 sas_deb_builder
12+
```
13+
14+
15+
## Failed attempts
16+
17+
With brew, I was either unable to login or got the error below. After installing from docker desktop the version
18+
was clearly different so that might have been the issue.
19+
20+
```commandline
21+
Error response from daemon: Get "https://registry-1.docker.io/v2/": rejecting registry-1.docker.io:443 because traffic from evaluating PAC file: getting PAC interpreter: Get "http://wpad/wpad.dat": dial tcp: lookup wpad: no such host
22+
```
23+
24+
```commandline
25+
brew install --cask docker
26+
brew install --cask xquartz
27+
```
28+
29+

.devel/build_ros2.sh

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
#!/bin/bash
2+
# Copyright (c) Murilo M. Marinho (www.murilomarinho.info)
3+
set -e
4+
5+
####################################################################
6+
# Helper functions and parameters
7+
####################################################################
8+
9+
# Change this to define the number of parallel jobs for this builder
10+
export DEB_BUILD_OPTIONS=parallel=4
11+
12+
# ROS2 version
13+
rosv="jazzy"
14+
# Ubuntu version
15+
ubuntuv="noble"
16+
# Architecture
17+
archname="amd64"
18+
19+
PRE_BUILD() {
20+
# Remove the debian folder just in case. In ROS1 and catkin this was an issue
21+
rm -rf debian
22+
# Use the --all just in case, otherwise it returns with an error if there are multiple commits without a changelog
23+
# wow, with the --all it also complains if the package already has a changelog. Nice, thanks a lot
24+
catkin_generate_changelog --all || true
25+
catkin_generate_changelog || true
26+
# If we don't commit the modified CHANGELOG.rst, the catkin_prepare_release doesn't shut up about it
27+
git add CHANGELOG.rst
28+
git commit -a -m "Shut up catkin"
29+
# Apparently this doesn't work for python-only packages, but we not care cause we cmake boyz
30+
catkin_prepare_release --no-push -y --version "$VERSION"
31+
# Automagically create the debian packagking directives
32+
bloom-generate rosdebian --os-name ubuntu --os-version "$ubuntuv" --ros-distro "rosv"
33+
}
34+
35+
BUILD_DEB(){
36+
# Parallel builds
37+
sed -i -e 's/dh $@/dh $@ --parallel/g' debian/rules
38+
# A hack so that shlibdeps does not complain about qpOases not being a ubuntu package. Well, it is being installed purely using CMAKE.
39+
# This might create other problems, but for now we worry about being able build the package at all.
40+
sed -i -e 's/dh_shlibdeps /dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info /g' debian/rules
41+
fakeroot debian/rules binary
42+
}
43+
44+
####################################################################
45+
# Array of packages
46+
####################################################################
47+
pkg_array=(
48+
"sas_core"
49+
"sas_msgs"
50+
"sas_common"
51+
"sas_conversions"
52+
"sas_datalogger"
53+
"sas_robot_driver"
54+
"sas_robot_kinematics"
55+
)
56+
57+
####################################################################
58+
# Create tmp folder
59+
####################################################################
60+
61+
rm -rf tmp_ros2
62+
mkdir tmp_ros2
63+
cd tmp_ros2
64+
65+
####################################################################
66+
# Clone all packages
67+
####################################################################
68+
69+
#Example "git@github.com:SmartArmStack/sas_core.git"
70+
for pkg_name in "${pkg_array[@]}"; do
71+
echo "Cloning ${pkg_name}"
72+
git clone -b "$rosv" git@github.com:SmartArmStack/"$pkg_name".git --recurse-submodules
73+
done
74+
75+
####################################################################
76+
# Define version number
77+
####################################################################
78+
79+
# Remove any leading zeros otherwise the version name will not fit the bloom requirements
80+
# https://unix.stackexchange.com/questions/79371/removing-leading-zeros-from-date-output
81+
VERSION=$(date +"%-y.%-m.%-d%H%M%S")
82+
83+
####################################################################
84+
# Remove current installation
85+
####################################################################
86+
87+
# Remove all related packages. The || true is so that it doesn't annoy us when something wasn't installed to begin with.
88+
sudo apt remove ros-"$rosv"-sas* -y || true
89+
90+
####################################################################
91+
# Build and install incrementally
92+
####################################################################
93+
94+
for pkg_name in "${pkg_array[@]}"; do
95+
echo "Building ${pkg_name}"
96+
cd "$pkg_name"
97+
PRE_BUILD
98+
BUILD_DEB
99+
cd ..
100+
# Install package but replace _ by -. E.g. sas_core becomes sas-core.
101+
# https://stackoverflow.com/questions/3306007/replace-a-string-in-shell-script-using-a-variable
102+
sudo dpkg -i ros-"$rosv"-"${pkg_name//_/-}"_*"$ubuntuv"_"$archname".deb
103+
${var//12345678/$replace}
104+
done

.devel/run_container.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
# Based on juanjqo's https://github.com/Adorno-Lab/docker_recipes/blob/main/run_container.sh
4+
5+
echo "Running container:" $1
6+
# Argument validation check
7+
if [ $# -eq 0 ]; then
8+
echo "Error: No arguments provided."
9+
echo "Example: sh run_container.sh ubuntu_24_dqrobotics"
10+
exit 1
11+
fi
12+
13+
#/opt/X11/bin/xhost +local:root
14+
#xhost +local:root
15+
docker run -it --name=$1 \
16+
--rm --privileged --network=host --env=DISPLAY --platform=linux/amd64 \
17+
$1 /bin/bash

.devel/sas_deb_builder/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# From juanjo's dqrobotics_ros_jazzy
2+
FROM juanjqo/ubuntu_24_dqrobotics
3+
ARG ROS_DOMAIN_ID=1
4+
ENV ROS_DOMAIN_ID=$ROS_DOMAIN_ID
5+
SHELL ["/bin/bash", "-c"]
6+
ENV BASH_ENV="/etc/bash_env"
7+
8+
# INSTALL ROS2 JAZZY
9+
## This script is part of the repository cloned in juanjqo/ubuntu_24_dqrobotics
10+
RUN chmod +x ~/git/docker_recipes/dependencies/install_ros_jazzy.sh
11+
RUN bash -c '~/git/docker_recipes/dependencies/install_ros_jazzy.sh'
12+
13+
# ROS DOMAIN SETUP
14+
RUN echo "export ROS_DOMAIN_ID=$ROS_DOMAIN_ID" >> ~/.bashrc
15+
16+
# SAS-RELATED THINGS
17+
RUN mkdir -p ~/sas_ws/src
18+
RUN cd ~/sas_ws/src
19+
RUN git clone --recurse-submodules -b jazzy https://github.com/SmartArmStack/smart_arm_stack_ROS2.git sas

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
*Research only* packages cannot be used for commercial use.
44

5-
| Package | License | Description |
6-
|--------------------------------------------|---------------|-------------------------------------------------------------------------------------------------------------------------------|
7-
| `sas_core` | LGPL | The part of the library that does not depend on `ROS2`. |
8-
| `sas_common` | LGPL | Generic `ROS2` code used throughout the packages. |
9-
| `sas_msgs` | LGPL | A wrapper for `ROS` messages that were made redundant in `ROS2`. |
10-
| `sas_conversions` | LGPL | Convert `ROS2` messages into `float`, `int`, or `dqrobotics` elements. |
11-
| `sas_robot_driver` | LGPL | `ROS2` nodes and libraries for creating servers and clients for robot configuration-space monitoring and control. |
12-
| `sas_robot_kinematics` | LGPL | `ROS2` nodes and libraries for creating servers and clients for kinematic-level robot task-space monitoring and control. |
13-
| `sas_robot_driver_denso` | LGPL | A `sas_robot_driver` implementation for DensoWave's bCap controlled robots |
14-
| `sas_robot_driver_kuka` | LGPL | A `sas_robot_driver` implementation for Kuka (Sunrise cabinet, FRI) |
15-
| `sas_robot_driver_ur` | LGPL | A `sas_robot_driver` implementation for UR |
5+
| Package | License | Description |
6+
|--------------------------|---------|--------------------------------------------------------------------------------------------------------------------------|
7+
| `sas_core` | LGPL | The part of the library that does not depend on `ROS2`. |
8+
| `sas_common` | LGPL | Generic `ROS2` code used throughout the packages. |
9+
| `sas_msgs` | LGPL | A wrapper for `ROS` messages that were made redundant in `ROS2`. |
10+
| `sas_conversions` | LGPL | Convert `ROS2` messages into `float`, `int`, or `dqrobotics` elements. |
11+
| `sas_robot_driver` | LGPL | `ROS2` nodes and libraries for creating servers and clients for robot configuration-space monitoring and control. |
12+
| `sas_robot_kinematics` | LGPL | `ROS2` nodes and libraries for creating servers and clients for kinematic-level robot task-space monitoring and control. |
13+
| `sas_robot_driver_denso` | LGPL | A `sas_robot_driver` implementation for DensoWave's bCap controlled robots |
14+
| `sas_robot_driver_kuka` | LGPL | A `sas_robot_driver` implementation for Kuka (Sunrise cabinet, FRI) |
15+
| `sas_robot_driver_ur` | LGPL | A `sas_robot_driver` implementation for UR |
1616

1717

1818
# Prerequisites

0 commit comments

Comments
 (0)