0
$\begingroup$

Rosanswers logo

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

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Fixed it, turns out that you can't just expect one type of connection to imply that the other connections are working. In this case, just bcz services worked, I though actions would also work, and also topics. Turns out I wasn't able to echo remotely the data I published locally, and there was a missing entry in /etc/hosts causing the issue. I guess both computers need this file to be filled up. When I was able to publish to a remote topic, actions also worked.

I guess this is because internally ros actions clients will publish to a goal topic on the server, even when you just do action_client.send_goal(). So if something as basic a topic wouldn't work, no way actions would work.


Originally posted by turtlesnbacon with karma: 16 on 2021-08-02

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.