Simulator: Unable to connect to rosbridge

Created on 8 Oct 2018  路  13Comments  路  Source: lgsvl/simulator

Compiled the project on Ubuntu 16.04. I am able to run free roaming. Using ROS kinetic. I can run rosbridge on localhost:9090
But it seems like the simulator is unable to connect to rosbridge. It shows connecting, but unable to connect to rosbridge

Typing rostopic echo /client_count gives 0
Is it possible to receive or visualize the simulator messages?

All 13 comments

@bhaskarsuper9000 can we get more details, do you see any errors in rosbridge, do you see any clients connected in the bridge, IP address and port numbers, etc.

@andytolst I have updated the description. rosbridge running on its default on port 9090 and doesn't seem to print any error

let's try one more thing: start rosbridge in console, start simulator, select "Free Roaming",
select "DuckieDowntown" as map and "duckiebot-duckietown-ros1" as robot.
You should see something like this:
rosbridge

lgsvl_issue
Allright, I tried it, but I still see connecting. Don't think its a ROS issue, because although I have multiple versions of ROS, I am using kinetic for this one. (sourced the correct one)

I checked the log /home/$user/.config/unity3d/LGE/Duckietown/Player.log

NullReferenceException: Object reference not set to an instance of an object
  at VideoToROS.Update () [0x00000] in <9a5e55b624b8451287983db3d8d64cfd>:0 

(Filename: <9a5e55b624b8451287983db3d8d64cfd> Line: 0)

10/8/2018 12:53:28 PM|Fatal|WebSocket.connect|An exception has occurred while reading an HTTP request/response.
An exception has occurred while attempting to connect.

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)

NullReferenceException: Object reference not set to an instance of an object
  at VideoToROS.Update () [0x00000] in <9a5e55b624b8451287983db3d8d64cfd>:0 

(Filename: <9a5e55b624b8451287983db3d8d64cfd> Line: 0)

NullReferenceException: Object reference not set to an instance of an object
  at VideoToROS.Update () [0x00000] in <9a5e55b624b8451287983db3d8d64cfd>:0 

(Filename: <9a5e55b624b8451287983db3d8d64cfd> Line: 0)

10/8/2018 12:53:28 PM|Fatal|WebSocket.connect|An exception has occurred while reading an HTTP request/response.
An exception has occurred while attempting to connect.

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)

NullReferenceException: Object reference not set to an instance of an object
  at VideoToROS.Update () [0x00000] in <9a5e55b624b8451287983db3d8d64cfd>:0 

(Filename: <9a5e55b624b8451287983db3d8d64cfd> Line: 0)

NullReferenceException: Object reference not set to an instance of an object
  at VideoToROS.Update () [0x00000] in <9a5e55b624b8451287983db3d8d64cfd>:0 

(Filename: <9a5e55b624b8451287983db3d8d64cfd> Line: 0)

Pasted some stuff from the running log. Does this give a clue on whats going on?

@andytolst Okay, we are past this. I got it to connected. It seems I had an issue with rosbridge, it shows connected for now. And I am able to get the data with rostopic echo. Thanks, do you have any suggestion for using a visualizer?

@bhaskarsuper9000 You should be able to visualize most of the messages in Rviz. Are there any specific messages you are having difficulty with?

Thanks @hadiTab and @andytolst, I was able to visualize the lidar and camera messages with rviz. I have some experience with the apollo stack as well. I want to try that next, will close this issue for now.

@bhaskarsuper9000 Could you please help me in fixing the below error:

roslaunch rosbridge_server rosbridge_websocket.launch
RLException: [rosbridge_websocket.launch] is neither a launch file in package [rosbridge_server] nor     is [rosbridge_server] a launch file name
The traceback for the exception was written to the log file

Do I need to install rosbridge separately ?

Thank you,
KK

@kk2491 rosbridge is included as a git submodule in the repository. Make sure you use the --recurse-submodules flag when cloning. It should be located in apollo/ros_pkgs/src/rosbridge_suite.
You will also need to build it in docker to use it, which can be done by running catkin_make from the container after changing directory to apollo/ros_pkgs.

If you have done all of these and you are still running into an issue, it is likely because the catkin_workspace has not been sourced.
I suggest running the rosbridge using the script we have provided in apollo/scripts/rosbridge.sh.

If you wish to manually launch it you can source the setup.bash file in ros_pkgs.

EDIT: I'm assuming you are using Apollo with the simulator. Is that the case?

@kk2491 The above answer is perfect if you are running it with apollo. But in case you are just using a standard ROS repository like indigo or kinetic with Ubuntu, you can also just use
sudo apt-get install ros-kinetic-rosbridge-* to install the rosbridge related packages

@hadiTab Thanks for the details. My initial thought was to try LG simulator without any third party (apollo, autoware), just to see how it looks.

Once that was done, I wanted to see how it works with Apollo.

I will try the steps mentioned and let you know an update.

Thank you,
KK

@bhaskarsuper9000 Thank you for the answer. Currently I am running LG simulator standalone. I have ROS version Lunar installed in my system. Unfortunately I am not able to install rosbridge by running sudo apt-get install ros-kinetic-rosbridge-*.

Seems like it is not supported in Lunar. Has anybody faced this issue?

Thank you,
KK

@kk2491 rosbridge is supported in Lunar. You can install it using:

sudo apt-get install ros-lunar-rosbridge-server

Here's a link to the ros wiki page for rosbrige.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

frontw picture frontw  路  5Comments

fgrzeszc picture fgrzeszc  路  4Comments

yumianhuli2 picture yumianhuli2  路  3Comments

InitialDuan picture InitialDuan  路  5Comments

ntutangyun picture ntutangyun  路  4Comments