Subscribing to a text file
hello everyone. I want to know if i could subscribe to a data stored in a text file. My data is in the form
0.97542241 1.22256888
1.66565685 1.25254882
1.22222658 1.26589587
There is a tab space between each row entry, two entries in a row and multiple in column. Something like that. I am running a program which is giving me these readings. I am storing them in a text file. Now i want to use this but i am unable to do so. I know about publisher/subscriber but i am unable to directly publish this data, so i thought of going other way around, now i am storing this data in a text file and i want to read that file use this in the form a message. Any idea how can i do that. I am using python for coding and ros kinetic with ubuntu 16.04.
Is the other program not something you can modify, or are you having trouble getting the publisher setup and working properly?
It's not impossible to do what you ask, but it would be a last resort if there wasn't a tidier way of doing it.
I can modify but the the other is in python 3.6 and kinetic uses 2.7. I tried to modify the code but unable to do so, so i thought of coming up with this thing. there were certain libraries and chunks of code which were hectic to transform. so, i decide to go with this approach
It is actually possible to build a version of Kinetic that supports Python
3.x
.See my answer to #q237613. It is somewhat involved, but would make it possible to write a regular publisher and use ROS 'normally' for this.
Seeing your other questions: if you're still using a Raspberry Pi, there is a good chance you're building ROS from source anyway, so building it for a different version of Python should not be such a big change.