Web Interface

From Rsewiki
Revision as of 07:49, 30 January 2020 by S163903 (talk | contribs) (→‎roslibjs)

// TODO mention browser console

roslibjs

Installing rosbridge

This library makes it possible to use ros commands with javascript over a chosen port. The first two lines goes to the source in the catkin workspace and creates a package for ros:

cd ~/flexbot_ws/src
catkin_create_pkg robot_gui_bridge rosbridge_server

Next we install the rosbridge package

apt-get install ros-melodic-rosbridge-server 

Now we create the launch file directory and the file used for launch

mkdir ~/flexbot_ws/src/robot_gui_bridge/launch
touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch

Now at last we write the the necessary launch commands into the file and source it so we can use it from any directory om this terminal:

echo '<launch> <include file="$(find rosbridge_server)/launch/rosbridge_websocket.launch"/></launch>' >> ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch
source ~/flexbot_ws/devel/setup.bash

To test if it works run and look for errors:

roslaunch robot_gui_bridge websocket.launch

Setting up the connection

Web Interface - Interface for ROS and browser

test