Ask Your Question
0

rosbridge server respawn

asked 2020-03-04 02:39:20 -0500

luchko gravatar image

Hi,

Using ROS melodic on Debian, with latest rosbridge server.

Rosbridge websocket server launchfile allow us to set retry_startup_delay .

Do you know if, as for roslaunch, there is some respawn parameter, allowing rosbridge to restart automatically if exit code != 0 ?

Thank you !

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2020-03-06 07:56:11 -0500

luchko gravatar image

updated 2020-03-06 07:56:33 -0500

Hi again,

just found a solution !

1 - Don't use installed version of rosbridge_server but copy source folder from robridge_suite/rosbridge_server inside your workspace

2 - Add the respawn attribute to your node (wether or not you are using SSL) in rosbridge_server/launch/rosbridge_websocket.launch by adding the respawn attribute : <node name="rosbridge_websocket" pkg="rosbridge_server" type="rosbridge_websocket" output="log" respawn="true" respawn_delay="1">

3 - Next time you catkin_make , pay attention to the list of packages, you should see ~~ - rosbridge_server at the end of the list

Have a nice day

edit flag offensive delete link more
0

answered 2020-03-04 02:58:45 -0500

gvdhoorn gravatar image

No, that's not how this appears to work.

See here for one instance where that parameter is used:

while not connected and not rospy.is_shutdown():
    try:
        listenWS(factory, context_factory)
        rospy.loginfo('Rosbridge WebSocket server started at {}'.format(uri))
        connected = True
    except CannotListenError as e:
        rospy.logwarn("Unable to start server: " + str(e) +
                      " Retrying in " + str(retry_startup_delay) + "s.")
        rospy.sleep(retry_startup_delay)

As you can see, retry_startup_delay is used to throttle the while loop there, as whenever the "Rosbridge WebSocket server" cannot be started successfully, it skips to a rospy.sleep(..) which will delay for retry_startup_delay before trying to start the server again.

So this is different from respawn in roslaunch's case, as that deals with restarting processes, while retry_startup_delay only delays internal initialisation of a web socket server.

edit flag offensive delete link more

Comments

Thank you! I have to monitor rosbridge through something else. Any hints on that ?

luchko gravatar image luchko  ( 2020-03-04 04:20:54 -0500 )edit

Not right now I'm afraid.

gvdhoorn gravatar image gvdhoorn  ( 2020-03-04 04:22:29 -0500 )edit

Could you please mark the question as answered by ticking the checkmark (✓) to the left of the answer if you feel it has been answered? Thanks.

gvdhoorn gravatar image gvdhoorn  ( 2020-03-04 04:22:31 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2020-03-04 02:39:20 -0500

Seen: 78 times

Last updated: Mar 06