I have a web backend written in Python—call it backend
—that I would like to function as a ROS 2 node. That backend has its own dependencies on Python versions and libraries, its own virtualenv (it's managed by Poetry), and I don't see it as a possibility to change it into a ROS 2 package built using colcon
and thus, unless I misunderstand something, switch it to whatever versions of Python packages the ROS 2 installation happens to mandate.
Now, nevertheless, I'd need that backend to effectively function as a ROS 2 node, publishing a topic and subscribing a topic.
My current plan is to make a separate ROS 2 package, call it backend_helper
, with an executable that backend
executes and communicates with, probably via standard input and output, using something simple like JSON.
This does seem a bit involved for what I want to do. Are there other solutions? Has someone done something like this?
I know rosbridge
exists; in addition to not running currently on jazzy without changes, a full JSON serialization of the ROS protocol seems like an overkill and a liability for my simple use case, unless maybe it was very mature and had a good Python client library.