How to establish subscription/publication communication within C++ code?
To establish communication (simple listen/talk) between two machines, I simply use
export ROS_HOSTNAME=ip1
export ROS_MASTER_URI=http://ip2:11311
rosrun ...
However, if I want machine1 to communicate with machine2 without explicitly tell machine1, but rather I use a machine3 to tell machine1 the ip address of machine2 to make the connection. How should I achieve this through c++? Is there any code that's equivalent to the commands above?
Thanks!