This repository contains a prebuilt ROS2 Humble workspace for the soda-sim-ros2 plugin.
It also includes extra ROS packages:
Usually you will not have to rebuild this package, but if this is necessary, then below are the steps on how to build this.
Note
It is very important that the chosen path is short, due to the short default Windows path limits (260 characters). Even enabling the "Long Path" policy does not help to solve all the problems. Therefore, In any case, the compilation should be done along the shortest path, for example C:\ros2
Note
You should remove the FastDDS libraries if you have them installed.
- Perfom all step from Original Manuale till to Install additional DDS implementations (optional). OpenCV, RQt dependencies, and QT5 installation steps can be skipped.
- Remove rosidl_python, rclpy, and rosidl_runtime_py:
RMDIR /S /Q src\ros2\rosidl_python src\ros2\rclpy src\ros2\rosidl_runtime_py
- Clone additional repos to src/soda folder:
git clone -b ros2 https://github.com/ros-drivers/ackermann_msgs.git git clone https://github.com/soda-auto/ros-ue-wrapper.git git clone https://github.com/soda-auto/ros-soda-msgs.git
- Open x64 Native Tools Command Prompt for VS 2022 and build ROS2:
colcon build ^ --install-base <PATH_TO_THIS_REPO>/Source/ROSHumble/Win64 ^ --merge-install ^ --event-handlers console_direct+ ^ --packages-up-to rclcpp rclcpp_action geometry_msgs sensor_msgs tf2_msgs rosgraph_msgs statistics_msgs nav_msgs ackermann_msgs soda_msgs ros2_ue_wrapper ros2_ue_wrapper_common_msgs ^ --cmake-args "-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCOMPILE_TOOLS=OFF -DBENCHMARK_ENABLE_TESTING=OFF"
- Copy all .dll from C:/Program Files/OpenSSL-Win64/bin/ to <PATH_TO_THIS_REPO>/Source/ROSHumble/Win64/bin/
- Copy C:/ProgramData/chocolatey/lib/tinyxml2/lib/tinyxml2.dll to <PATH_TO_THIS_REPO>/Source/ROSHumble/Win64/bin/
Note
Rebuild only SODA packages:
colcon build ^
--install-base <PATH_TO_THIS_REPO>/Source/ROSHumble/Win64 ^
--merge-install ^
--event-handlers console_direct+ ^
--packages-select soda_msgs ros2_ue_wrapper ^
--cmake-args "-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCOMPILE_TOOLS=OFF -DBENCHMARK_ENABLE_TESTING=OFF"
Tested on Ubuntu 22.04 only.
- Install UnrealEngine
$ export UE_ENGINE=<PATH_TO_UE>/Engine
$ cd <REPO_ROOT>/ros2-build-scripts/
- Perfom all step from Original Manuale till to Install additional DDS implementations (optional). OpenCV, RQt dependencies, and QT5 installation steps can be skipped.
- Clone additional repos to src/soda folder:
git clone -b ros2 https://github.com/ros-drivers/ackermann_msgs.git git clone https://github.com/soda-auto/ros-ue-wrapper.git git clone https://github.com/soda-auto/ros-soda-msgs.git
- Build ROS2:
$ ./vcpkg-linux.sh $ ./vcpkg-native-linux.sh $ ./BuildForLinux.sh
Note
For rebuild only soda packages use RebuildSodaPackages.sh script
Note
In ROS2 Humble during the build process, an error may occur in the ./src/eProsima/Fast-DDS/thirdparty/filewatch/FileWatch.hpp file with error conversion of std::chrono::nanoseconds.
To fix it replace ... += std::chrono::nanoseconds(...)
to ... += std::chrono::duration_cast<typename std::chrono::system_clock::duration>(std::chrono::nanoseconds(...))
where the error occurs.
TODO: make a patch
Note
We were unable to build two libraries (foonathan-memory, benchmar) via Unreal Toolchain, so we built them using Ubuntu 22's native gcc compiler.
It builds via vcpkg-native-linux.sh
TODO: This is a crutch, it needs to be fixed
Note
TODO: try to build ROS2 for Linux from Windows