osrf / rvizweb

RVizWeb: RViz on the browser
290 stars 59 forks source link

Data not transmitting over network #18

Open MattC11 opened 5 years ago

MattC11 commented 5 years ago

I have everything working locally, but when I try to use a second computer I don't get any of the data transmitted. It loads the webserver correctly just none of the topic data shows up.

Is there some restrictions on this?

jubeira commented 5 years ago

Hi @MattC11, thanks for the report.

Do you see any logs coming from rosbridge_websocket? I've tried this on two different systems and rosbridge is reporting that the connection is being dropped right after connecting:

[INFO] [1548963719.881970]: Client connected.  1 clients 
[INFO] [1548963719.890958]: Client disconnected. 0 clients total.

@chapulina by any chance have you tried anything like this?

chapulina commented 5 years ago

I would observe the same connect -> disconnect issue with https://github.com/osrf/polymer-ros-rviz/issues/20. @MattC11 , mind updating your system and trying with the latest ros-rviz?

MattC11 commented 5 years ago

@jubeira I see the same log error as you. Immediate client disconnection on remote machine.

[INFO] [1549054600.075892]: Rosbridge WebSocket server started on port 9090 [INFO] [1549054603.273210]: Client connected. 1 clients total. [INFO] [1549054603.450931]: [Client 0] Subscribed to /tf2_web_republisher/feedback [INFO] [1549054615.607401]: Client connected. 2 clients total. [INFO] [1549054615.755179]: [Client 1] Subscribed to /tf2_web_republisher/feedback [INFO] [1549054615.797944]: Client disconnected. 1 clients total.

Client 1 is my remote machine which disconnects immediately.

@chapulina I grabbed the newest osrf/polymer-ros-rviz and confirmed that I still see the same problem. Also tried jstnhuang/ros-rviz for curiosity and it also showed the issue.

jubeira commented 5 years ago

Thanks for the reply @MattC11; I'll take a look on Monday.

chapulina commented 5 years ago

@MattC11 , did you take a look at the websocket IP in the UI, under Global options? Does that match your server's IP? And if it doesn't, when you change it to the correct one, do you see the connected -> disconnected cycle again?

MattC11 commented 5 years ago

@chapulina I had not looked at the URL. The Global Options was showing a localhost under Websocket URL. Changed it to the remote address, refreshed and it works now.

chapulina commented 5 years ago

Great! https://github.com/osrf/rvizweb/pull/19 should help you, as it will use the browser's location as the websocket URL by default.

jubeira commented 5 years ago

And if it doesn't, when you change it to the correct one, do you see the connected -> disconnected cycle again?

I'm still seeing this. I tried these two options:

I tried changing different ports but the result is always the same. I'd like to discard whether there's something fishy with my network configuration. @chapulina does this work for you with https://github.com/osrf/polymer-ros-rviz/issues/20 merged, or do you see the same as me?

chapulina commented 5 years ago

@jubeira, I can't reproduce the issue. In situation 1, does the Websocket URL on the UI point to system A or B? Also, after the Conected to websocket server message, do you see an object printed? If so, what URL does it have?

jubeira commented 5 years ago

does the Websocket URL on the UI point to system A or B? Also, after the Conected to websocket server message, do you see an object printed? If so, what URL does it have?

Both the UI and the printed object have A's URL; this doesn't seem to be related with https://github.com/osrf/polymer-ros-rviz/issues/20.

I took a look at the packets in wireshark, and I see something like this (between machine running browser and machine running rvizweb):

I'll dig a bit more, but perhaps this is related to some local networking settings.

jubeira commented 5 years ago

I couldn't find anything useful related to the error code, but I tried with two different systems and it worked fine; this probably means it's something specific to the first two systems I tried this with.

I'd keep this open just in case, but for now I'd say it's low priority.

cahartsell commented 5 years ago

@jubeira I had trouble with the Client connected immediately followed by Client disconnected with the same Code 1009 "message too big" error. According to the answer here, this happens because the max_message_size parameter in the rosbridge_websocket.launch launch file is set to None by default. I added this parameter to the rvizweb.launch file:

Original:

  <!-- Websocket bridge -->
  <include file="$(find rosbridge_server)/launch/rosbridge_websocket.launch">
    <arg name="port" value="$(arg websocket_port)" />
  </include>

Updated:

  <!-- Websocket bridge -->
  <include file="$(find rosbridge_server)/launch/rosbridge_websocket.launch">
    <arg name="port" value="$(arg websocket_port)" />
    <arg name="max_message_size" value="Inf" />
  </include>

This seems to have fixed the websocket error. Unfortunately, I still cannot get the pink box or PR2 examples to work, so you may want to double check that the issue really is fixed.

jubeira commented 5 years ago

Hi @cahartsell,

cahartsell commented 5 years ago

@jubeira I did not try to reproduce the issue with RViz web running on a different host, but I did have the issue when connecting directly from localhost and remotely from a different machine on the same network.

No, I have not seen any other error messages with my setup. I think the browser is successfully communicating with the ROS bridge websocket now since I see messages in the console (eg. I see subscribed to "/visualization_marker" when I add the Markers item in my browser window). I can also see messages being published when I do rostopic echo /visualization_marker, but no objects ever appear in the browser. I considered opening a separate issue on this, but I don't have much useful info to go on. It could be an issue with my ROS configuration and not RViz web itself

jubeira commented 5 years ago

No, I have not seen any other error messages with my setup. I think the browser is successfully communicating with the ROS bridge websocket now since I see messages in the console (eg. I see subscribed to "/visualization_marker" when I add the Markers item in my browser window). I can also see messages being published when I do rostopic echo /visualization_marker, but no objects ever appear in the browser. I considered opening a separate issue on this, but I don't have much useful info to go on. It could be an issue with my ROS configuration and not RViz web itself

I could reproduce this issue as well running rvizweb in a system A and the browser in a system B. rosbridge seems to be subscribing to the topics that provide the information, and I can also see the client (i.e. browser) subscribing to the topics, but no output can be seen in the browser (no error logs as well). It has to be an issue between rosbridge and the browser at some point. I'll dig a bit more and keep you posted.

EDIT: I tried with a different system in the same network (i.e. rvizweb in system C and browser in system B) and everything worked fine. I suspect there's some particular network setting that is causing the issue between the two systems that don't work properly, and it's not necessarily related to rvizweb's code.