Integration of ROS Into a Seperate System
I have a system running ROS kinetic, specifically for asynchronous data collection. I also have a system running the computationally heavy post-processing of the collected data, which I have designed to be a multi-threaded process. I wish to have the user interact with the two systems separately, be means of a web browser interface. Being able to choose between the data collection subsystem, and the post-processing subsystem.
My primary approach was to use a python micro-framework (such as flask) to launch a python web server, and then use the python roslaunch API to interface with the ROS framework. However, as others have noted, I ran into the typical error message:
ValueError: signal only works in main thread
which is clearly caused by calling the roslaunch API from a sub thread, due to the call being made from a web server.
This leaves me wondering as to whether I am forced to integrate my entire system into the ROS framework, and use the ROSBridge Suite to handle user based interaction. A process which I am unsure about due to the synchronous nature of my processing suite.
Consequently, this has left me looking for another method to integrate ROS into non-ROS based architectures, and figured I would reach out to the community for support. Alternatively, are my concerns about the integration of a multi-threaded processing suite into ROS unwarranted? Will the industrialization of an entire ROS based architecture prove to be a difficult task?
Note: I understand this question could be viewed as open-ended, if that is the case, if you could point me towards a more design-oriented platform it would be greatly appreciated.
can you expand a little on this part? I'm not sure I follow how a "web user interface" is used when integrating two systems.
Unless you are making the human do the integration by acting as a coordinator of both?
Also: I'm not sure what its current status is, but perhaps pyros-dev/pyros is something you can use. I believe the author ( @asmodehn ) has been working to do exactly what you describe in your post.
this, together with your question about the Python
roslaunch
API sounds like you are essentially looking for a way to launch two (or more) different launch files using a web server?Yes, effectively. I wish to be able to control the context and lifeline of a series of ROS nodes for data collection. Then, under a different use case, use a post-processing algorithm from a web application, or in more generalized terms, a web user interface.
Taking this a bit further, it might pay to look at how to integrate coordination of your ROS applications with a container orchestration framework. That could make deployment as well as startup/shutdown easier. Docker comes to mind, but there are more.
It would decouple starting & stopping your ..
.. application from actually interacting with it.
I'm not sure I understand how you want to integrate your "multi-threaded [data] process[ing]" application with ROS, or why. If you wanted to do that in order to be able to control it from ROS, perhaps
rosbridge
is not such a bad idea.But ..
.. orchestrating things would be a separate responsibility (and be implemented using different technology) from everything else.
Not saying this is a solution, but perhaps something to consider.