How to write to a text file in python in a ROS node?
I need to record a topic message called "message" only when a "message sent" button is pressed. I have made a separate node for GUI that has "message sent" button. I also wrote the "message" topic to a text file when "message sent" button was activated. The program works fine when this node is run separately, it also writes the message to the designated text file. But when I run this node along with other nodes by including it in a launch file, the text file does not seem to be created. Is there any specific reason for this to happen? How can this problem be solved?