Skip to content

Commit 6c073b6

Browse files
committed
Small documentation update
1 parent fb32627 commit 6c073b6

6 files changed

Lines changed: 30 additions & 31 deletions

File tree

.github/workflows/build_dependencies.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
push:
44
paths:
55
- 'build_deps.sh'
6+
- '.github/workflows/build_dependencies.yml'
67
jobs:
78
build-ros2:
89
runs-on: macos-latest
@@ -16,7 +17,7 @@ jobs:
1617
with:
1718
cmake-version: '3.23.x'
1819
- run: ./build_deps.sh ${{ matrix.platformArch }}
19-
- run: tar czf deps_${{ matrix.platformArch }}.tar.xz deps_${{ matrix.platformArch }}/
20+
- run: tar cJf deps_${{ matrix.platformArch }}.tar.xz deps_${{ matrix.platformArch }}/
2021
- uses: actions/upload-artifact@v3
2122
with:
2223
name: deps_${{ matrix.platformArch }}

.github/workflows/main_macos.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
push:
44
paths:
55
- 'build_ros2_macos.sh'
6+
- '.github/workflows/main_macos.yml'
67
jobs:
78
build-ros2:
89
runs-on: macos-latest
@@ -19,8 +20,8 @@ jobs:
1920
cache: 'pip'
2021
- run: pip3 install -r requirements.txt
2122
- run: ./build_ros2_macos.sh
22-
- run: tar cJf ros2.tar.xz ros2/
23+
- run: tar cJf ros2_macOS.tar.xz ros2_macOS/
2324
- uses: actions/upload-artifact@v3
2425
with:
25-
name: ros2
26-
path: ros2.tar.xz
26+
name: ros2_macOS
27+
path: ros2_macOS.tar.xz

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ros2
88
ros2_ws/
99
deps*/
1010
host_deps/
11+
*.tar.xz
1112

1213
# Finder
1314
.DS_Store

README.md

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22

33
Build ROS2 stack for iOS software development.
44

5-
**For the impatient**: Instead of building ROS2 from source (see below), you can download [our prebuilt libs](https://github.com/light-tech/ROS2-On-iOS/releases) and extract it to the root of the repo with `tar xzf`.
6-
Then make a symlink `ros2` pointing to the extracted `ros2_iOS_Simulator` where we can find the ROS2 `lib` and `include` headers
5+
**For the impatient**: Instead of building ROS2 from source (see below), you can download [our prebuilt libs](https://github.com/light-tech/ROS2-On-iOS/releases) and extract it.
6+
Then make a symlink `ros2` pointing to the extracted `ros2_$PLATFORM` where we can find the ROS2 `lib` and `include` headers
77
```shell
8-
ln -s ros2_iOS_Simulator ros2
8+
ln -s PATH_TO_EXTRACTED_ros2_$PLATFORM ros2
99
```
10-
You should of course change the symlink target when switching between building for real iPhone, for simulator and for Mac Catalyst.
10+
You should of course change the symlink target when switching between building for real iPhone, simulator and Mac Catalyst.
1111
Now we can run the demo application which ports [the official example](https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Cpp-Publisher-And-Subscriber.html): Run the app on **two** simulator instances, click on *Start publishing* on one and *Start listening* on the other.
1212

1313
![Minimal Publisher/Subscriber Demo](https://user-images.githubusercontent.com/25411167/184833976-2287a315-0dd8-4d0c-82e6-c42bd7a53d66.mov)
1414

15+
_Note_: To run Mac Catalyst app on your macOS machine, you need to sign the app with your development signing certificate.
16+
1517
**Main guides**:
1618

1719
* [Build ROS2 from source on macOS](https://docs.ros.org/en/humble/Installation/Alternatives/macOS-Development-Setup.html)
@@ -22,38 +24,30 @@ Now we can run the demo application which ports [the official example](https://d
2224

2325
We are going to need
2426

25-
* CMake **3.23** until [this](https://github.com/ament/ament_cmake/pull/395) is sorted out
27+
* CMake **3.23** until [this issue](https://github.com/ament/ament_cmake/pull/395) is sorted out
2628
* Python **3.10**
2729
* Xcode + Command Line tools
2830

2931
installed. All subsequent shell commands are to be done at `$REPO_ROOT`.
3032

31-
Also, create a Python virtual environment for ease of working
33+
Also, create a Python virtual environment for ease of package installation
3234

3335
1. Create a new Python virtual environment
3436
```shell
35-
export MY_PYTHON_ENV=usr_local
36-
python3 -m venv $MY_PYTHON_ENV
37+
python3 -m venv my_ros2_python_env
3738
```
38-
Here I use `usr_local` as it is intended to act like `/usr/local/`.
3939

4040
2. Activate the environment
4141
```shell
42-
source $MY_PYTHON_ENV/bin/activate
42+
source my_ros2_python_env/bin/activate
4343
```
4444

4545
3. Install the packages
4646
```shell
4747
python3 -m pip install -r requirements.txt
4848
```
4949

50-
4. Compile `googletest`:
51-
```shell
52-
cd usr_local/lib/python3.10/site-packages/mypyc/external/googletest/make
53-
make
54-
```
55-
56-
If you have other environment management such as Anaconda, remember to deactivate them.
50+
If you have other environment management such as Anaconda, remember to **DEACTIVATE** them.
5751

5852
## Source and workspace preparation
5953

@@ -97,17 +91,19 @@ If you have other environment management such as Anaconda, remember to deactivat
9791
ln -s $REPO_ROOT/src src
9892
```
9993

100-
5. It is good to have multiple workspaces such as
94+
5. During development, it is good to have multiple workspaces such as
95+
10196
- `ament_ws`: move `ament` here, build and `source` it before moving on to
10297
- `base_ws`: add `rcl` and its dependencies and once successful
10398
- `rclcpp_ws`: add other desired packages such as `rclcpp`.
99+
104100
This way, one can minimize the amount of packages to rebuild.
105101

106102
## Build ROS2 core packages for iOS
107103

108104
Before building, we need to change the line `#include <net/if_arp.h>` in `src/eProsima/Fast-DDS/src/cpp/utils/IPFinder.cpp` into `#include <net/ethernet.h>` according to [this](https://stackoverflow.com/questions/10395041/getting-arp-table-on-iphone-ipad) as the original header is only available in the macOS SDK.
109105

110-
We also disable `rcl_logging_spdlog` by
106+
We also disable the package `rcl_logging_spdlog` by
111107
```shell
112108
touch src/ros2/rcl_logging/rcl_logging_spdlog/AMENT_IGNORE
113109
```

build_deps.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function setupPlatform() {
8484

8585
function setCompilerFlags() {
8686
export CFLAGS="-isysroot $SYSROOT -arch $ARCH -I$DEPS_SYSROOT/include/"
87-
export CPPFLAGS="-isysroot $SYSROOT -arch $ARCH -I$DEPS_SYSROOT/include/"
87+
export CXXFLAGS="-isysroot $SYSROOT -arch $ARCH -I$DEPS_SYSROOT/include/"
8888
}
8989

9090
function buildCMake() {
@@ -106,7 +106,7 @@ function configureThenMakeArm() {
106106
make && make install # >/dev/null 2>&1
107107

108108
export -n CFLAGS
109-
export -n CPPFLAGS
109+
export -n CXXFLAGS
110110
}
111111

112112
function configureThenMake() {
@@ -122,7 +122,7 @@ function configureThenMake() {
122122
make && make install #>/dev/null 2>&1
123123

124124
export -n CFLAGS
125-
export -n CPPFLAGS
125+
export -n CXXFLAGS
126126
}
127127

128128
function configureThenMakeNoHost() {
@@ -132,7 +132,7 @@ function configureThenMakeNoHost() {
132132
make && make install #>/dev/null 2>&1
133133

134134
export -n CFLAGS
135-
export -n CPPFLAGS
135+
export -n CXXFLAGS
136136
}
137137

138138
function buildHostTools() {

build_ros2_macos.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ REPO_ROOT=`pwd`
55

66
cd $REPO_ROOT
77
mkdir -p base_ws/src
8-
vcs import base_ws/src < $REPO_ROOT/ros2_min.repos
9-
vcs import base_ws/src < $REPO_ROOT/rviz2.repos
8+
vcs import ros2_ws/src < $REPO_ROOT/ros2_min.repos
9+
vcs import ros2_ws/src < $REPO_ROOT/rviz2.repos
1010

1111
# Ignore rcl_logging_spdlog package
1212
touch base_ws/src/ros2/rcl_logging/rcl_logging_spdlog/AMENT_IGNORE
1313
touch base_ws/src/ros2/orocos_kdl_vendor/python_orocos_kdl_vendor/AMENT_IGNORE
1414

15-
cd base_ws
16-
colcon build --install-base $REPO_ROOT/ros2 --merge-install --cmake-force-configure --cmake-args -DBUILD_TESTING=NO -DTHIRDPARTY=FORCE -DCOMPILE_TOOLS=NO -DFORCE_BUILD_VENDOR_PKG=ON -DBUILD_MEMORY_TOOLS=OFF -DRCL_LOGGING_IMPLEMENTATION=rcl_logging_noop -DCMAKE_PREFIX_PATH=$REPO_ROOT/deps
15+
cd ros2_ws
16+
colcon build --install-base $REPO_ROOT/ros2_macOS --merge-install --cmake-force-configure --cmake-args -DBUILD_TESTING=NO -DTHIRDPARTY=FORCE -DCOMPILE_TOOLS=NO -DFORCE_BUILD_VENDOR_PKG=ON -DBUILD_MEMORY_TOOLS=OFF -DRCL_LOGGING_IMPLEMENTATION=rcl_logging_noop -DCMAKE_PREFIX_PATH=$REPO_ROOT/deps

0 commit comments

Comments
 (0)