Skip to content

Commit 5b7ec3f

Browse files
committed
Add some known Python executable script to fix hardcoded path, update documentation
1 parent 0517530 commit 5b7ec3f

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ colcon build --merge-install \
6363
-DBUILD_TESTING=NO \
6464
-DTHIRDPARTY=FORCE \
6565
-DCOMPILE_TOOLS=NO \
66-
-DFORCE_BUILD_VENDOR_PKG=ON \
6766
-DBUILD_MEMORY_TOOLS=OFF \
6867
-DRCL_LOGGING_IMPLEMENTATION=rcl_logging_noop
6968
```
@@ -87,14 +86,12 @@ After my tons of failures, here is what went going on behind the above command:
8786

8887
4. `COMPILE_TOOLS=NO` for `Fast-DDS` to **NOT** compile the fast discovery server executable.
8988

90-
5. `FORCE_BUILD_VENDOR_PKG=ON` is to build and use the `*_vendor` packages such as `libyaml_vendor`, again so that we do not have to install it to the system with Homebrew
89+
5. `BUILD_MEMORY_TOOLS=OFF` is for `foonathan_memory` to disable building `nodesize_db` program
9190

92-
6. `BUILD_MEMORY_TOOLS=OFF` is for `foonathan_memory` to disable building `nodesize_db` program
93-
94-
7. `RCL_LOGGING_IMPLEMENTATION=rcl_logging_noop` is to select the logging backend for `rcl_logging`.
91+
6. `RCL_LOGGING_IMPLEMENTATION=rcl_logging_noop` is to select the logging backend for `rcl_logging`.
9592
Here, I am using `noop` one to avoid one more dependency `spdlog_vendor`.
9693

97-
8. ROS2 depends significantly on dynamic linking. Do NOT add `BUILD_SHARED_LIBS=NO`, contrary to my other project [LLVM](https://github.com/light-tech/LLVM-On-iOS/) where building static libs is needed!
94+
7. ROS2 depends significantly on dynamic linking. Do NOT add `BUILD_SHARED_LIBS=NO`, contrary to my other project [LLVM](https://github.com/light-tech/LLVM-On-iOS/) where building static libs is needed!
9895

9996
## Build ROS2 with graphical tools for macOS
10097

@@ -126,10 +123,12 @@ In that case, you will need to install `x86_64` version of Python.
126123
* If you download the file from a browser, it will be put in quarantine so you need to `xattr -d com.apple.quarantine DOWNLOADED_FILE` before extraction.
127124
* To avoid that, you could open the terminal and do
128125
```shell
129-
curl -OL https://github.com/light-tech/ROS2-On-iOS/releases/download/humble-1.2/deps_macOS.tar.xz \
130-
-O https://github.com/light-tech/ROS2-On-iOS/releases/download/humble-1.2/ros2_macOS.tar.xz \
131-
-O https://github.com/light-tech/ROS2-On-iOS/releases/download/humble-1.2/rviz2_macOS.tar.xz \
132-
-O https://github.com/light-tech/ROS2-On-iOS/releases/download/humble-1.2/moveit2_macOS.tar.xz
126+
baseUrl=https://github.com/light-tech/ROS2-On-iOS/releases/download/humble-1.4
127+
curl -OL $baseUrl/deps_macOS.tar.xz \
128+
-O $baseUrl/base_macOS.tar.xz \
129+
-O $baseUrl/rviz2_macOS.tar.xz \
130+
-O $baseUrl/moveit2_macOS.tar.xz \
131+
-O $baseUrl/tutorials_macOS.tar.xz
133132
```
134133
instead.
135134

build_deps.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ mkdir -p $depsExtractPath
2121
# Location to install dependencies
2222
depsInstallPath=$scriptDir/ros2_$targetPlatform/deps
2323

24-
# Root for Python 3.11 to build Boost, change the match the platform such as
25-
# pythonRoot=/Library/Frameworks/Python.framework/Versions/$pythonVersion/
26-
# if use official Python instead of Homebrew's version on GitHub Action
2724
pythonVersion=3.11
28-
pythonRoot=/Library/Frameworks/Python.framework/Versions/$pythonVersion/ #/usr/local/opt/python@$pythonVersion/Frameworks/Python.framework/Versions/$pythonVersion/
25+
26+
# Python path to build Boost, change the match the platform such as
27+
# pythonRoot=/usr/local/opt/python@$pythonVersion/Frameworks/Python.framework/Versions/$pythonVersion/
28+
# if using Homebrew's Python instead of the official Python.
29+
pythonRoot=/Library/Frameworks/Python.framework/Versions/$pythonVersion/
2930

3031
export PATH=$depsInstallPath/bin:$PATH
3132
export PKG_CONFIG=$depsInstallPath/bin/pkg-config

fix_hardcoded_paths.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ fixHardCodedPythonEnvPath() {
3838

3939
echo "Replacing $hardcodedPythonEnvPath -> $localPythonEnvPath"
4040

41+
# Python scripts
42+
hardcodedFiles+=($(ls $installDir/base/bin))
43+
hardcodedFiles+=($installDir/moveit2/bin/xacro $installDir/moveit2/lib/controller_manager/spawner $installDir/moveit2/lib/controller_manager/unspawner)
44+
4145
for f in "${hardcodedFiles[@]}"; do
4246
confirm "In $f [y/n]? " && sed -i '' "s,$hardcodedPythonEnvPath,$localPythonEnvPath,g" $f
4347
done
@@ -101,5 +105,5 @@ fixXcodeSDKPath
101105

102106
echo ""
103107
echo "REMINDERS"
104-
echo "You also need to fix the python3 path in $installDir/base/bin/ros2."
108+
echo "You sometimes need to fix the python3 path in $installDir/base/bin/ros2."
105109
echo ""

0 commit comments

Comments
 (0)