How does one ship an app with a ROS2 subscriber for a non-ROS environment target?
I am interested in building an application that subscribes to ROS2 messages over a network. This app would display message information in either console or GUI mode. The message topics are already known and fixed. The idea is that app is small, super-easy to install, and does not require the end user to be a developer. (i.e. no need to step in the the ROS2 install world).
Certainly I can build this C++ app on humble with the full ROS2 environment. Is there any info on how to package an app with just the ROS2 lib dependencies (rclcpp, etc) for installation on a user computer?
I hope this does not sound to vague, but I don’t see anything about a minimal environment to subscribe to ROS2 messages. Any help pointing me in the right direction is appreciated!
You don't say anything about the target platform (other than "user computer"). I'd suggest to add some information about it (or them), as it's going to affect what techniques could/would work, and which can't or won't.
"easiest" would perhaps be to use static linking. In quotes, as it's unclear whether that would be easy to achieve, given the various plugins a typical ROS 2 node uses (such as the RMW). micro-ROS uses static linking, and I've used it extensively, so I know it can work.
Alternatively: build the binary + all (transitive) dependencies with shared linking, take the
install
space and distribute that as a single archive. After setting up the various search paths correctly (ie:PATH
,LD_LIBRARY_PATH
, etc), things should-just-work (but of course: famous last words).what does small mean exactly? Depending on the dependencies ...(more)
I would perhaps also add whether you really want/need to distribute a native ROS 2 implementation, or whether approaches such as rosbridge, micro-ROS (ie:
rmw_microxrcedds
+ Agent), alternative client libraries, visualisation tools such as foxglove or any other lightweight approaches would be acceptable.The question (and potential answers) becomes rather different, depending on what your actual goal is (to avoid an
xy-problem
).@gvdhoom : Thanks for your input on distributing a ROS app.
* By small, I mean that the libraries (dependencies) added to my application should be no more that a few MB.
* Target platforms (Ubuntu 20.04, 22.04, Windows 10, Windows 11) * RosBridge (at first glance) looks like it could work. I'll give that a shot
Hmm - Maybe ROSBridge won't do. I did find this on the NVidia site: "In order to use the ROS bridge you have to install ROS on your device. For example if you want to use the ROS bridge on Jetson you have to install ROS on Jetson. If you want to use ROS on the desktop you have to install ROS on the desktop. The ROS version you install has to match the operating system of your device." I don't want to have to install ROS on the target - since the end- user will have no clue how to install ROS. And having to bundle that with the app violates my "make is small and easy" requirement.
I would suggest to perhaps update your original post to more clearly state your requirements and your actual goal.
Is this going to be a visualisation tool, a remote control station, a debugging/inspection tool, something else?
re: nvidia site: I don't know which site you've found, but that's not how I work with rosbridge. Rosbridge is started on the ROS device, and the client application opens a websocket. There is no need for ROS on the client in that case. Just a browser.
But again: there are so many possibilities that without you providing a clearer description of the goal it's going to be difficult to really recommend anything.