Web Interface: Difference between revisions

From Rsewiki
Line 1: Line 1:
// TODO mention browser console
// TODO mention browser console
==roslibjs==  
==roslibjs==  
This library makes it possible to use ros commands with javascript over a chosen port. Here's a TLDR for all the commands:
===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
  cd ~/flexbot_ws/src
  catkin_create_pkg robot_gui_bridge rosbridge_server
  catkin_create_pkg robot_gui_bridge rosbridge_server
Next we install the rosbridge package
  apt-get install ros-melodic-rosbridge-server  
  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
  mkdir ~/flexbot_ws/src/robot_gui_bridge/launch
  touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.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
  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
  source ~/flexbot_ws/devel/setup.bash
To test if it works run and look for errors:
  roslaunch robot_gui_bridge websocket.launch
  roslaunch robot_gui_bridge websocket.launch


To install this do go to the source folder of the catkin workspace:
===Setting up the connection===
 




[[Web Interface]] - Interface for ROS and browser
[[Web Interface]] - Interface for ROS and browser


== test ==
== test ==

Revision as of 07:49, 30 January 2020

// 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