Distributing ROS2 executables
I am running ROS2 Foxy on Windows 10.
I can colcon build my C++ source code just fine, and my nodes/components run just fine on the PC they were build on. There is also a build/Release directory, with executable files, binaries and libraries (dll and lib). When I run double-click it, it does the same as "ros2 run package node".
However, when I try to transfer this directory to another PC, with ROS2 at the same location and same config, running it always fails.
So I guess my question is, how to properly distribute/bundle standalone node executable files, without giving out the source code, with as little files as possible?
Thank you for your help, it is very much appreciated.
Did you source ROS2 on another PC (
call C:\dev\ros2_foxy\local_setup.bat
)?I am not familiar with Windows, but on Linux, it is enough to source ROS2 and to run the executable. It doesn't matter where the ROS2 installation is. However, libraries must be present on another PC.
@lukicdarkoo thank you very much for your answer. Indeed, that was my thought at first, so I was surprised when it didn't quite work.
Turns out that it was an issue with privileges and env variables, I sourced my ros2 distribution from an elevated user cmd, but the env variables weren't the same on two accounts. The issue is now resolved.