-
Notifications
You must be signed in to change notification settings - Fork 10
ROS 1 and ROS 2
This project has been tested on ROS Melodic, Noetic, and ROS 2 Eloquent. This section will deal with the instructions for the ROS side of the project. The RosBridgelibrary used on the ROS side is part of rosbridge_suite. We used a WebSocket to create a connection with Unity. The exchange of information happens over this connection, including all the video feeds and the parameters.
-
Install ROSBridge suite on your Linux machine.
$ sudo apt-get install ros-<rosdistro>-rosbridge-suite
-
Source your ROS distro and run the WebSocket launch file.
$ source /opt/ros/<rosdistro>/setup.bash $ roslaunch rosbridge_server rosbridge_websocket.launch
This will also run 'roscore.'
-
Check the host IP address in a new terminal using -
$ hostname -I
Note: If you are running Unity and ROS on the same system, the IP address would be 'ws://localhost:9090'
-
Open a new terminal and source your ros distro. Then make a workspace with a package inside having rospy as a dependency and run the script in the 'ROS' folder of this repository.
The rosbridge_suite currently does not support ROS 2 officially. But there is a pull request (https://github.com/RobotWebTools/rosbridge_suite/pull/493) to the repository for ROS 2 support. We use the contents of that pull request to set up the rosbridge connection for ROS 2.
-
Clone the rosbridge_suite repository to your system.
$ git clone https://github.com/RobotWebTools/rosbridge_suite.git
-
Shift to the latest commit of the ROS 2 support pull request using GitHub CLI.
$ gh pr checkout 493
-
Build the library on your system and source your ROS 2 distro.
$ source /opt/ros/eloquent/setup.sh $ cd rosbridge_suite $ ./rosbridge_suite$ colcon build
-
Source the setup.bash of the rosbridge library.
$ ./rosbridge_suite $ source install/setup.bash -
Run the WebSocket script.
$. /rosbridge_suite $ ros2 run rosbridge_server rosbridge_websocket