This is on two machines both running ROS Noetic on Ubuntu20.04, done with rospy
I have a remote machine, which is running roscore. It will run a node which starts an action server. Here is how I start it, within the constructor of the node. So if I run the node, it will start.
self.actionServer = actionlib.SimpleActionServer('ids_1_video_capture', ids_1_video_captureAction,
self.execute_action, False)
self.actionServer.start()
Below are the topics the server generates on the remote machine, after running the node.
/ids_1_video_capture/cancel
/ids_1_video_capture/feedback
/ids_1_video_capture/goal
/ids_1_video_capture/result
/ids_1_video_capture/status
/rosout
/rosout_agg
My local machine is configured to connect to the remote machine, with ROS_MASTER_URI and ROS_HOSTNAME, as I can see the same topics, shown below
/ids_1_video_capture/cancel
/ids_1_video_capture/feedback
/ids_1_video_capture/goal
/ids_1_video_capture/result
/ids_1_video_capture/status
/rosout
/rosout_agg
And here is the code for connecting the server from the local machine, as a client
client = actionlib.SimpleActionClient('ids_1_video_capture', ids_1_video_captureAction)
if not client.wait_for_server(rospy.Duration(30)):
raise rospy.ROSException('Could not connect to action server...')
However the local machine times out when waiting for the server. This same exact code will work fine if I run it on the remote machine (so client + server on the same machine works fine). When I do this, can echo the data on the local computer from the topics that the remote computer publishes on.
I'm confident that I have my network set up correctly as I had no issues with calling a service on the remote computer from the local computer (using rospy.wait_for_service), so I thought I could follow the same logic for actionlib but I guess not ?
In the worst case, I can just use a service to create client on the remote computer (since it works there), but this is not ideal.
Any help is appreciated ! thanks
Originally posted by turtlesnbacon on ROS Answers with karma: 16 on 2021-07-29
Post score: 0