How does a ROS node import/export data?
I'm using a Neural Network NN to control a UR5 robot arm. I'm struggling to understand how to exchange information between my ROS network and my neural network. Suppose I'm using ur_modern_driver to read joint_states from the robot, how do I export that data so my NN can use it as an input? Likewise, how do I get a ros node to subscribe to data from the output of my NN which will be the 6d joint commands that need to be plugged into ur_modern_driver/urscript?
I suspect I will need to write my own pubsub node which will interface between ur_modern_driver and my NN but I just can't tell what I should tell the node to pub or sub to. How can a node read/write from/to an external source such as a python script that's being executed, especially when that source is constantly changing? Do I need to edit my script to write the NN output to a specific location, maybe a com port? Can a ros node then listen to that port for incoming data? and vice-versa, for writing to the NN's input?
FYI, I'm not experienced with writing my own ROS nodes or even programming so please be simple. Many thanks.
why are you use your NN from out of ros you can write python in ros?
My NN is part of Garage/rllab from Berkeley and has its own deps. if I were to try and recreate it inside ros I know it will not work because I don't fully understand how all the different parts of Garage/rllab communicate. Therefore, it seemed more sensible to have ros read and write to Garge/rllab
rllab used to have ros utils but these have been removed in the newer 'Garage' version. Also, I could never get the original rllab to compile.