Call ROS inside a Docker container
Hi,
I have a docker container running with a python program. I want to publish a string to a ROS topic when the program is called. It looks something like this
#!/usr/bin/env python
import rospy from std_msgs.msg import
String
def handler():
rospy.init_node("tts_publisher", anonymous=True)
pub = rospy.Publisher('string_tts', String,
queue_size=10)
tts_text = "Program called"
msg_to_publish = String()
msg_to_publish.data = tts_text
rospy.sleep(3)
pub.publish(msg_to_publish)
ROS is installed on my (host) machine, so the Docker doesn't now ROS and can't publish from within the program. The program needs to be in this Docker container, since it gets called from another docker container.
How can this be done conceputally?
Thank you very much for any help!