Subscribe to Rostopic from flask app

asked 2019-08-03 22:32:49 -0600

Ajith gravatar image

updated 2019-08-04 16:59:09 -0600

jayess gravatar image


I have Ros melodic installed in Ubuntu 18.04. I have a sample rosbag which have some rostopics. I have an existing flask app in which I need to subscribe to these topics and get the response as message objects and pass that to catkin package for further processing.

What I have done thus far is that in the flask app I used subprocess to trigger a listener script which subscribes to the topics. But the subprocess is not returning the message object.

p = subprocess.check_output(["./"])

When I run the listener in python shell , it executes correctly.

What I like to have is on calling the flask app, the listener script is executed and message object is returned back to flask app. Any suggestions will be much appreciated. Thanks.

edit retag flag offensive close merge delete