<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://rsewiki.electro.dtu.dk/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=S163903</id>
	<title>Rsewiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://rsewiki.electro.dtu.dk/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=S163903"/>
	<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Special:Contributions/S163903"/>
	<updated>2026-04-26T22:35:56Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4524</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4524"/>
		<updated>2020-02-06T16:19:35Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Structure of the web-interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] added (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] added (For connecting ROS to the local network)&lt;br /&gt;
* [[Web_Interface#mission_package|syntax_pkg]] Made (Checks mission for syntax errors when committing)&lt;br /&gt;
* [[Web_Interface#syntax_package|mission_pkg]] Made (Handles mission files)&lt;br /&gt;
&lt;br /&gt;
= Location of important files=&lt;br /&gt;
Every package can be found in the following directory:&lt;br /&gt;
 ~/flexbot_ws/src/&lt;br /&gt;
&lt;br /&gt;
The cmds and relative path for the mission file can be found in:&lt;br /&gt;
 ~/flexbot_ws/src/include/&lt;br /&gt;
&lt;br /&gt;
Homepage and script related things can be found in:&lt;br /&gt;
 ~/flexbot_ws/robot/&lt;br /&gt;
&lt;br /&gt;
The homepage folder has a softlink to the desired place, so adding new page content will also make it appear on the homepage. &lt;br /&gt;
&lt;br /&gt;
The script &#039;&#039;autoStartRobot.sh&#039;&#039; has a link to the directory where every script starts after connecting to the network. Keep in mind that you cannot use the same environment variables since it runs in root (Can&#039;t ~). Extra measurements to ensure it doesn&#039;t start multiple times has been taken. If more launch files should be added please do so by changing one of these files&lt;br /&gt;
 ~/flexbot_ws/src/base_node_ros/full.launch #This one is preferred&lt;br /&gt;
 ~/flexbot_ws/robot/robot.sh&lt;br /&gt;
&lt;br /&gt;
inside the following directors are the logs, the aaa and aab are the terminal output for the automatic startup script.&lt;br /&gt;
 ~/flexbot_ws/logs/&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
&lt;br /&gt;
If for some reason the robot doesn&#039;t work, one could login to the robot and run the killrobot scrip&lt;br /&gt;
 ~/flexbot_ws/robot/./killrobot.sh&lt;br /&gt;
followd by the script &lt;br /&gt;
 ~/flexbot_ws/robot/./robot.sh&lt;br /&gt;
&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently there is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
Right now there is 3 commands, but none of them has any functionality yet. The first one is mov, which takes one values, the next is stop which takes zero values and the last is turn which takes two values.&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
&lt;br /&gt;
The general structure of the web-interface can be seen in the picture below. The orange box is the robot server, green is the ROS server (Packages written in C++), Purple is the client (Laptop), Red is the homepage files. Most of the the blocks on the server communicate through ROS topics or actions, but some use Mavlink. In the Client side everything is done with HTML, CSS and JavaScript.&lt;br /&gt;
&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
=== Adding Commands ===&lt;br /&gt;
To add a command to the syntax checking simply go to   &lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and add the command to the vector called &#039;&#039;cmds&#039;&#039;. It has 2 values a name of the command and how many attributes it has. After adding it simply compile the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
=== Adding commands ===&lt;br /&gt;
To add a command to the mission go into the source of the mission package and add the command-check to the main while loop in the callback function and add a corresponding function. Remember to add this command to the syntax too inside cmds.h.&lt;br /&gt;
&lt;br /&gt;
=== TODO ===&lt;br /&gt;
Add actual functionality to each command in the mission package&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4523</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4523"/>
		<updated>2020-02-06T16:16:06Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Structure of the web-interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] added (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] added (For connecting ROS to the local network)&lt;br /&gt;
* [[Web_Interface#mission_package|syntax_pkg]] Made (Checks mission for syntax errors when committing)&lt;br /&gt;
* [[Web_Interface#syntax_package|mission_pkg]] Made (Handles mission files)&lt;br /&gt;
&lt;br /&gt;
= Location of important files=&lt;br /&gt;
Every package can be found in the following directory:&lt;br /&gt;
 ~/flexbot_ws/src/&lt;br /&gt;
&lt;br /&gt;
The cmds and relative path for the mission file can be found in:&lt;br /&gt;
 ~/flexbot_ws/src/include/&lt;br /&gt;
&lt;br /&gt;
Homepage and script related things can be found in:&lt;br /&gt;
 ~/flexbot_ws/robot/&lt;br /&gt;
&lt;br /&gt;
The homepage folder has a softlink to the desired place, so adding new page content will also make it appear on the homepage. &lt;br /&gt;
&lt;br /&gt;
The script &#039;&#039;autoStartRobot.sh&#039;&#039; has a link to the directory where every script starts after connecting to the network. Keep in mind that you cannot use the same environment variables since it runs in root (Can&#039;t ~). Extra measurements to ensure it doesn&#039;t start multiple times has been taken. If more launch files should be added please do so by changing one of these files&lt;br /&gt;
 ~/flexbot_ws/src/base_node_ros/full.launch #This one is preferred&lt;br /&gt;
 ~/flexbot_ws/robot/robot.sh&lt;br /&gt;
&lt;br /&gt;
inside the following directors are the logs, the aaa and aab are the terminal output for the automatic startup script.&lt;br /&gt;
 ~/flexbot_ws/logs/&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
&lt;br /&gt;
If for some reason the robot doesn&#039;t work, one could login to the robot and run the killrobot scrip&lt;br /&gt;
 ~/flexbot_ws/robot/./killrobot.sh&lt;br /&gt;
followd by the script &lt;br /&gt;
 ~/flexbot_ws/robot/./robot.sh&lt;br /&gt;
&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently there is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
Right now there is 3 commands, but none of them has any functionality yet. The first one is mov, which takes one values, the next is stop which takes zero values and the last is turn which takes two values.&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
&lt;br /&gt;
The general structure of the web-interface can be seen in the picture below. The orange box is the server,  &lt;br /&gt;
&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
=== Adding Commands ===&lt;br /&gt;
To add a command to the syntax checking simply go to   &lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and add the command to the vector called &#039;&#039;cmds&#039;&#039;. It has 2 values a name of the command and how many attributes it has. After adding it simply compile the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
=== Adding commands ===&lt;br /&gt;
To add a command to the mission go into the source of the mission package and add the command-check to the main while loop in the callback function and add a corresponding function. Remember to add this command to the syntax too inside cmds.h.&lt;br /&gt;
&lt;br /&gt;
=== TODO ===&lt;br /&gt;
Add actual functionality to each command in the mission package&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4522</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4522"/>
		<updated>2020-02-06T16:15:45Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Tabs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] added (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] added (For connecting ROS to the local network)&lt;br /&gt;
* [[Web_Interface#mission_package|syntax_pkg]] Made (Checks mission for syntax errors when committing)&lt;br /&gt;
* [[Web_Interface#syntax_package|mission_pkg]] Made (Handles mission files)&lt;br /&gt;
&lt;br /&gt;
= Location of important files=&lt;br /&gt;
Every package can be found in the following directory:&lt;br /&gt;
 ~/flexbot_ws/src/&lt;br /&gt;
&lt;br /&gt;
The cmds and relative path for the mission file can be found in:&lt;br /&gt;
 ~/flexbot_ws/src/include/&lt;br /&gt;
&lt;br /&gt;
Homepage and script related things can be found in:&lt;br /&gt;
 ~/flexbot_ws/robot/&lt;br /&gt;
&lt;br /&gt;
The homepage folder has a softlink to the desired place, so adding new page content will also make it appear on the homepage. &lt;br /&gt;
&lt;br /&gt;
The script &#039;&#039;autoStartRobot.sh&#039;&#039; has a link to the directory where every script starts after connecting to the network. Keep in mind that you cannot use the same environment variables since it runs in root (Can&#039;t ~). Extra measurements to ensure it doesn&#039;t start multiple times has been taken. If more launch files should be added please do so by changing one of these files&lt;br /&gt;
 ~/flexbot_ws/src/base_node_ros/full.launch #This one is preferred&lt;br /&gt;
 ~/flexbot_ws/robot/robot.sh&lt;br /&gt;
&lt;br /&gt;
inside the following directors are the logs, the aaa and aab are the terminal output for the automatic startup script.&lt;br /&gt;
 ~/flexbot_ws/logs/&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
&lt;br /&gt;
If for some reason the robot doesn&#039;t work, one could login to the robot and run the killrobot scrip&lt;br /&gt;
 ~/flexbot_ws/robot/./killrobot.sh&lt;br /&gt;
followd by the script &lt;br /&gt;
 ~/flexbot_ws/robot/./robot.sh&lt;br /&gt;
&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently there is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
Right now there is 3 commands, but none of them has any functionality yet. The first one is mov, which takes one values, the next is stop which takes zero values and the last is turn which takes two values.&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
&lt;br /&gt;
The general structure of the web-interface can be seen in the picture below&lt;br /&gt;
&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
=== Adding Commands ===&lt;br /&gt;
To add a command to the syntax checking simply go to   &lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and add the command to the vector called &#039;&#039;cmds&#039;&#039;. It has 2 values a name of the command and how many attributes it has. After adding it simply compile the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
=== Adding commands ===&lt;br /&gt;
To add a command to the mission go into the source of the mission package and add the command-check to the main while loop in the callback function and add a corresponding function. Remember to add this command to the syntax too inside cmds.h.&lt;br /&gt;
&lt;br /&gt;
=== TODO ===&lt;br /&gt;
Add actual functionality to each command in the mission package&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4521</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4521"/>
		<updated>2020-02-06T16:15:10Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* TODO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] added (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] added (For connecting ROS to the local network)&lt;br /&gt;
* [[Web_Interface#mission_package|syntax_pkg]] Made (Checks mission for syntax errors when committing)&lt;br /&gt;
* [[Web_Interface#syntax_package|mission_pkg]] Made (Handles mission files)&lt;br /&gt;
&lt;br /&gt;
= Location of important files=&lt;br /&gt;
Every package can be found in the following directory:&lt;br /&gt;
 ~/flexbot_ws/src/&lt;br /&gt;
&lt;br /&gt;
The cmds and relative path for the mission file can be found in:&lt;br /&gt;
 ~/flexbot_ws/src/include/&lt;br /&gt;
&lt;br /&gt;
Homepage and script related things can be found in:&lt;br /&gt;
 ~/flexbot_ws/robot/&lt;br /&gt;
&lt;br /&gt;
The homepage folder has a softlink to the desired place, so adding new page content will also make it appear on the homepage. &lt;br /&gt;
&lt;br /&gt;
The script &#039;&#039;autoStartRobot.sh&#039;&#039; has a link to the directory where every script starts after connecting to the network. Keep in mind that you cannot use the same environment variables since it runs in root (Can&#039;t ~). Extra measurements to ensure it doesn&#039;t start multiple times has been taken. If more launch files should be added please do so by changing one of these files&lt;br /&gt;
 ~/flexbot_ws/src/base_node_ros/full.launch #This one is preferred&lt;br /&gt;
 ~/flexbot_ws/robot/robot.sh&lt;br /&gt;
&lt;br /&gt;
inside the following directors are the logs, the aaa and aab are the terminal output for the automatic startup script.&lt;br /&gt;
 ~/flexbot_ws/logs/&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
&lt;br /&gt;
If for some reason the robot doesn&#039;t work, one could login to the robot and run the killrobot scrip&lt;br /&gt;
 ~/flexbot_ws/robot/./killrobot.sh&lt;br /&gt;
followd by the script &lt;br /&gt;
 ~/flexbot_ws/robot/./robot.sh&lt;br /&gt;
&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently here is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
Right now there is 3 commands, but none of them has any functionality yet. The first one is mov, which takes one values, the next is stop which takes zero values and the last is turn which takes two values.&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
&lt;br /&gt;
The general structure of the web-interface can be seen in the picture below&lt;br /&gt;
&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
=== Adding Commands ===&lt;br /&gt;
To add a command to the syntax checking simply go to   &lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and add the command to the vector called &#039;&#039;cmds&#039;&#039;. It has 2 values a name of the command and how many attributes it has. After adding it simply compile the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
=== Adding commands ===&lt;br /&gt;
To add a command to the mission go into the source of the mission package and add the command-check to the main while loop in the callback function and add a corresponding function. Remember to add this command to the syntax too inside cmds.h.&lt;br /&gt;
&lt;br /&gt;
=== TODO ===&lt;br /&gt;
Add actual functionality to each command in the mission package&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4520</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4520"/>
		<updated>2020-02-06T16:14:52Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Location of important files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things! (location of homepage script and so forth&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] added (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] added (For connecting ROS to the local network)&lt;br /&gt;
* [[Web_Interface#mission_package|syntax_pkg]] Made (Checks mission for syntax errors when committing)&lt;br /&gt;
* [[Web_Interface#syntax_package|mission_pkg]] Made (Handles mission files)&lt;br /&gt;
&lt;br /&gt;
= Location of important files=&lt;br /&gt;
Every package can be found in the following directory:&lt;br /&gt;
 ~/flexbot_ws/src/&lt;br /&gt;
&lt;br /&gt;
The cmds and relative path for the mission file can be found in:&lt;br /&gt;
 ~/flexbot_ws/src/include/&lt;br /&gt;
&lt;br /&gt;
Homepage and script related things can be found in:&lt;br /&gt;
 ~/flexbot_ws/robot/&lt;br /&gt;
&lt;br /&gt;
The homepage folder has a softlink to the desired place, so adding new page content will also make it appear on the homepage. &lt;br /&gt;
&lt;br /&gt;
The script &#039;&#039;autoStartRobot.sh&#039;&#039; has a link to the directory where every script starts after connecting to the network. Keep in mind that you cannot use the same environment variables since it runs in root (Can&#039;t ~). Extra measurements to ensure it doesn&#039;t start multiple times has been taken. If more launch files should be added please do so by changing one of these files&lt;br /&gt;
 ~/flexbot_ws/src/base_node_ros/full.launch #This one is preferred&lt;br /&gt;
 ~/flexbot_ws/robot/robot.sh&lt;br /&gt;
&lt;br /&gt;
inside the following directors are the logs, the aaa and aab are the terminal output for the automatic startup script.&lt;br /&gt;
 ~/flexbot_ws/logs/&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
&lt;br /&gt;
If for some reason the robot doesn&#039;t work, one could login to the robot and run the killrobot scrip&lt;br /&gt;
 ~/flexbot_ws/robot/./killrobot.sh&lt;br /&gt;
followd by the script &lt;br /&gt;
 ~/flexbot_ws/robot/./robot.sh&lt;br /&gt;
&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently here is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
Right now there is 3 commands, but none of them has any functionality yet. The first one is mov, which takes one values, the next is stop which takes zero values and the last is turn which takes two values.&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
&lt;br /&gt;
The general structure of the web-interface can be seen in the picture below&lt;br /&gt;
&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
=== Adding Commands ===&lt;br /&gt;
To add a command to the syntax checking simply go to   &lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and add the command to the vector called &#039;&#039;cmds&#039;&#039;. It has 2 values a name of the command and how many attributes it has. After adding it simply compile the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
=== Adding commands ===&lt;br /&gt;
To add a command to the mission go into the source of the mission package and add the command-check to the main while loop in the callback function and add a corresponding function. Remember to add this command to the syntax too inside cmds.h.&lt;br /&gt;
&lt;br /&gt;
=== TODO ===&lt;br /&gt;
Add actual functionality to each command in the mission package&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4519</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4519"/>
		<updated>2020-02-06T16:12:34Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Location of important files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things! (location of homepage script and so forth&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] added (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] added (For connecting ROS to the local network)&lt;br /&gt;
* [[Web_Interface#mission_package|syntax_pkg]] Made (Checks mission for syntax errors when committing)&lt;br /&gt;
* [[Web_Interface#syntax_package|mission_pkg]] Made (Handles mission files)&lt;br /&gt;
&lt;br /&gt;
= Location of important files=&lt;br /&gt;
Every package can be found in the following directory:&lt;br /&gt;
 ~/flexbot_ws/src/&lt;br /&gt;
&lt;br /&gt;
The cmds and relative path for the mission file can be found in:&lt;br /&gt;
 ~/flexbot_ws/src/include/&lt;br /&gt;
&lt;br /&gt;
Homepage and script related things can be found in:&lt;br /&gt;
 ~/flexbot_ws/robot/&lt;br /&gt;
&lt;br /&gt;
The homepage folder has a softlink to the desired place, so adding new page content will also make it appear on the homepage. &lt;br /&gt;
&lt;br /&gt;
The script &#039;&#039;autoStartRobot.sh&#039;&#039; has a link to the directory where every script starts after connecting to the network. Extra measurements to ensure it doesn&#039;t start multiple times has been taken. If more launch files should be added please do so by changing one of these files&lt;br /&gt;
 ~/flexbot_ws/src/base_node_ros/full.launch #This one is preferred&lt;br /&gt;
 ~/flexbot_ws/robot/robot.sh&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
&lt;br /&gt;
If for some reason the robot doesn&#039;t work, one could login to the robot and run the killrobot scrip&lt;br /&gt;
 ~/flexbot_ws/robot/./killrobot.sh&lt;br /&gt;
followd by the script &lt;br /&gt;
 ~/flexbot_ws/robot/./robot.sh&lt;br /&gt;
&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently here is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
Right now there is 3 commands, but none of them has any functionality yet. The first one is mov, which takes one values, the next is stop which takes zero values and the last is turn which takes two values.&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
&lt;br /&gt;
The general structure of the web-interface can be seen in the picture below&lt;br /&gt;
&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
=== Adding Commands ===&lt;br /&gt;
To add a command to the syntax checking simply go to   &lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and add the command to the vector called &#039;&#039;cmds&#039;&#039;. It has 2 values a name of the command and how many attributes it has. After adding it simply compile the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
=== Adding commands ===&lt;br /&gt;
To add a command to the mission go into the source of the mission package and add the command-check to the main while loop in the callback function and add a corresponding function. Remember to add this command to the syntax too inside cmds.h.&lt;br /&gt;
&lt;br /&gt;
=== TODO ===&lt;br /&gt;
Add actual functionality to each command in the mission package&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4518</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4518"/>
		<updated>2020-02-06T16:07:35Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Packages added/made for ROS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things! (location of homepage script and so forth&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] added (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] added (For connecting ROS to the local network)&lt;br /&gt;
* [[Web_Interface#mission_package|syntax_pkg]] Made (Checks mission for syntax errors when committing)&lt;br /&gt;
* [[Web_Interface#syntax_package|mission_pkg]] Made (Handles mission files)&lt;br /&gt;
&lt;br /&gt;
= Location of important files=&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
&lt;br /&gt;
If for some reason the robot doesn&#039;t work, one could login to the robot and run the killrobot scrip&lt;br /&gt;
 ~/flexbot_ws/robot/./killrobot.sh&lt;br /&gt;
followd by the script &lt;br /&gt;
 ~/flexbot_ws/robot/./robot.sh&lt;br /&gt;
&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently here is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
Right now there is 3 commands, but none of them has any functionality yet. The first one is mov, which takes one values, the next is stop which takes zero values and the last is turn which takes two values.&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
&lt;br /&gt;
The general structure of the web-interface can be seen in the picture below&lt;br /&gt;
&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
=== Adding Commands ===&lt;br /&gt;
To add a command to the syntax checking simply go to   &lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and add the command to the vector called &#039;&#039;cmds&#039;&#039;. It has 2 values a name of the command and how many attributes it has. After adding it simply compile the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
=== Adding commands ===&lt;br /&gt;
To add a command to the mission go into the source of the mission package and add the command-check to the main while loop in the callback function and add a corresponding function. Remember to add this command to the syntax too inside cmds.h.&lt;br /&gt;
&lt;br /&gt;
=== TODO ===&lt;br /&gt;
Add actual functionality to each command in the mission package&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4517</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4517"/>
		<updated>2020-02-06T16:07:07Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* TODO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things! (location of homepage script and so forth&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] added (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] added (For connecting ROS to the local network)&lt;br /&gt;
* [[Web_Interface#mission_package|syntax_pkg]] Made (Checks mission for syntax errors when committing)&lt;br /&gt;
* [[Web_Interface#syntax_package|mission_pkg]] Made (Handles mission files)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
&lt;br /&gt;
If for some reason the robot doesn&#039;t work, one could login to the robot and run the killrobot scrip&lt;br /&gt;
 ~/flexbot_ws/robot/./killrobot.sh&lt;br /&gt;
followd by the script &lt;br /&gt;
 ~/flexbot_ws/robot/./robot.sh&lt;br /&gt;
&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently here is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
Right now there is 3 commands, but none of them has any functionality yet. The first one is mov, which takes one values, the next is stop which takes zero values and the last is turn which takes two values.&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
&lt;br /&gt;
The general structure of the web-interface can be seen in the picture below&lt;br /&gt;
&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
=== Adding Commands ===&lt;br /&gt;
To add a command to the syntax checking simply go to   &lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and add the command to the vector called &#039;&#039;cmds&#039;&#039;. It has 2 values a name of the command and how many attributes it has. After adding it simply compile the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
=== Adding commands ===&lt;br /&gt;
To add a command to the mission go into the source of the mission package and add the command-check to the main while loop in the callback function and add a corresponding function. Remember to add this command to the syntax too inside cmds.h.&lt;br /&gt;
&lt;br /&gt;
=== TODO ===&lt;br /&gt;
Add actual functionality to each command in the mission package&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4516</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4516"/>
		<updated>2020-02-06T16:06:44Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Usage of web-interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] added (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] added (For connecting ROS to the local network)&lt;br /&gt;
* [[Web_Interface#mission_package|syntax_pkg]] Made (Checks mission for syntax errors when committing)&lt;br /&gt;
* [[Web_Interface#syntax_package|mission_pkg]] Made (Handles mission files)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
&lt;br /&gt;
If for some reason the robot doesn&#039;t work, one could login to the robot and run the killrobot scrip&lt;br /&gt;
 ~/flexbot_ws/robot/./killrobot.sh&lt;br /&gt;
followd by the script &lt;br /&gt;
 ~/flexbot_ws/robot/./robot.sh&lt;br /&gt;
&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently here is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
Right now there is 3 commands, but none of them has any functionality yet. The first one is mov, which takes one values, the next is stop which takes zero values and the last is turn which takes two values.&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
&lt;br /&gt;
The general structure of the web-interface can be seen in the picture below&lt;br /&gt;
&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
=== Adding Commands ===&lt;br /&gt;
To add a command to the syntax checking simply go to   &lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and add the command to the vector called &#039;&#039;cmds&#039;&#039;. It has 2 values a name of the command and how many attributes it has. After adding it simply compile the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
=== Adding commands ===&lt;br /&gt;
To add a command to the mission go into the source of the mission package and add the command-check to the main while loop in the callback function and add a corresponding function. Remember to add this command to the syntax too inside cmds.h.&lt;br /&gt;
&lt;br /&gt;
=== TODO ===&lt;br /&gt;
Add actual functionality to each command in the mission package&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4515</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4515"/>
		<updated>2020-02-06T16:04:27Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* TODO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] added (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] added (For connecting ROS to the local network)&lt;br /&gt;
* [[Web_Interface#mission_package|syntax_pkg]] Made (Checks mission for syntax errors when committing)&lt;br /&gt;
* [[Web_Interface#syntax_package|mission_pkg]] Made (Handles mission files)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently here is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
Right now there is 3 commands, but none of them has any functionality yet. The first one is mov, which takes one values, the next is stop which takes zero values and the last is turn which takes two values.&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
&lt;br /&gt;
The general structure of the web-interface can be seen in the picture below&lt;br /&gt;
&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
=== Adding Commands ===&lt;br /&gt;
To add a command to the syntax checking simply go to   &lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and add the command to the vector called &#039;&#039;cmds&#039;&#039;. It has 2 values a name of the command and how many attributes it has. After adding it simply compile the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
=== Adding commands ===&lt;br /&gt;
To add a command to the mission go into the source of the mission package and add the command-check to the main while loop in the callback function and add a corresponding function. Remember to add this command to the syntax too inside cmds.h.&lt;br /&gt;
&lt;br /&gt;
=== TODO ===&lt;br /&gt;
Add actual functionality to each command in the mission package&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4514</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4514"/>
		<updated>2020-02-06T16:04:18Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* TODO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] added (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] added (For connecting ROS to the local network)&lt;br /&gt;
* [[Web_Interface#mission_package|syntax_pkg]] Made (Checks mission for syntax errors when committing)&lt;br /&gt;
* [[Web_Interface#syntax_package|mission_pkg]] Made (Handles mission files)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently here is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
Right now there is 3 commands, but none of them has any functionality yet. The first one is mov, which takes one values, the next is stop which takes zero values and the last is turn which takes two values.&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
&lt;br /&gt;
The general structure of the web-interface can be seen in the picture below&lt;br /&gt;
&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
=== Adding Commands ===&lt;br /&gt;
To add a command to the syntax checking simply go to   &lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and add the command to the vector called &#039;&#039;cmds&#039;&#039;. It has 2 values a name of the command and how many attributes it has. After adding it simply compile the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
=== Adding commands ===&lt;br /&gt;
To add a command to the mission go into the source of the mission package and add the command-check to the main while loop in the callback function and add a corresponding function. Remember to add this command to the syntax too inside cmds.h.&lt;br /&gt;
&lt;br /&gt;
=== TODO ===&lt;br /&gt;
Add actual functionality to each command in the mission package&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4513</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4513"/>
		<updated>2020-02-06T16:04:01Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Adding commands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] added (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] added (For connecting ROS to the local network)&lt;br /&gt;
* [[Web_Interface#mission_package|syntax_pkg]] Made (Checks mission for syntax errors when committing)&lt;br /&gt;
* [[Web_Interface#syntax_package|mission_pkg]] Made (Handles mission files)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently here is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
Right now there is 3 commands, but none of them has any functionality yet. The first one is mov, which takes one values, the next is stop which takes zero values and the last is turn which takes two values.&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
&lt;br /&gt;
The general structure of the web-interface can be seen in the picture below&lt;br /&gt;
&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
=== Adding Commands ===&lt;br /&gt;
To add a command to the syntax checking simply go to   &lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and add the command to the vector called &#039;&#039;cmds&#039;&#039;. It has 2 values a name of the command and how many attributes it has. After adding it simply compile the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
=== Adding commands ===&lt;br /&gt;
To add a command to the mission go into the source of the mission package and add the command-check to the main while loop in the callback function and add a corresponding function. Remember to add this command to the syntax too inside cmds.h.&lt;br /&gt;
&lt;br /&gt;
=== TODO ===&lt;br /&gt;
Add actual functionality to each command&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4512</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4512"/>
		<updated>2020-02-06T16:01:05Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Adding Commands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] added (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] added (For connecting ROS to the local network)&lt;br /&gt;
* [[Web_Interface#mission_package|syntax_pkg]] Made (Checks mission for syntax errors when committing)&lt;br /&gt;
* [[Web_Interface#syntax_package|mission_pkg]] Made (Handles mission files)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently here is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
Right now there is 3 commands, but none of them has any functionality yet. The first one is mov, which takes one values, the next is stop which takes zero values and the last is turn which takes two values.&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
&lt;br /&gt;
The general structure of the web-interface can be seen in the picture below&lt;br /&gt;
&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
=== Adding Commands ===&lt;br /&gt;
To add a command to the syntax checking simply go to   &lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and add the command to the vector called &#039;&#039;cmds&#039;&#039;. It has 2 values a name of the command and how many attributes it has. After adding it simply compile the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
=== Adding commands ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== TODO ===&lt;br /&gt;
Add actual functionality to each command&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4511</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4511"/>
		<updated>2020-02-06T16:00:34Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* mission package */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] added (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] added (For connecting ROS to the local network)&lt;br /&gt;
* [[Web_Interface#mission_package|syntax_pkg]] Made (Checks mission for syntax errors when committing)&lt;br /&gt;
* [[Web_Interface#syntax_package|mission_pkg]] Made (Handles mission files)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently here is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
Right now there is 3 commands, but none of them has any functionality yet. The first one is mov, which takes one values, the next is stop which takes zero values and the last is turn which takes two values.&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
&lt;br /&gt;
The general structure of the web-interface can be seen in the picture below&lt;br /&gt;
&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
=== Adding Commands ===&lt;br /&gt;
To add a command simply go into   &lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and add the command to the vector called &#039;&#039;cmds&#039;&#039;. It has 2 values a name of the command and how many attributes it has. After adding it simply compile the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
=== Adding commands ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== TODO ===&lt;br /&gt;
Add actual functionality to each command&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4510</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4510"/>
		<updated>2020-02-06T15:59:18Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Structure of the web-interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] added (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] added (For connecting ROS to the local network)&lt;br /&gt;
* [[Web_Interface#mission_package|syntax_pkg]] Made (Checks mission for syntax errors when committing)&lt;br /&gt;
* [[Web_Interface#syntax_package|mission_pkg]] Made (Handles mission files)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently here is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
Right now there is 3 commands, but none of them has any functionality yet. The first one is mov, which takes one values, the next is stop which takes zero values and the last is turn which takes two values.&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
&lt;br /&gt;
The general structure of the web-interface can be seen in the picture below&lt;br /&gt;
&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
=== Adding Commands ===&lt;br /&gt;
To add a command simply go into   &lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and add the command to the vector called &#039;&#039;cmds&#039;&#039;. It has 2 values a name of the command and how many attributes it has. After adding it simply compile the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
=== Adding commands ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== TODO ===&lt;br /&gt;
Add actual functionality to each command&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4509</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4509"/>
		<updated>2020-02-06T15:55:27Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Mission commands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] added (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] added (For connecting ROS to the local network)&lt;br /&gt;
* [[Web_Interface#mission_package|syntax_pkg]] Made (Checks mission for syntax errors when committing)&lt;br /&gt;
* [[Web_Interface#syntax_package|mission_pkg]] Made (Handles mission files)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently here is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
Right now there is 3 commands, but none of them has any functionality yet. The first one is mov, which takes one values, the next is stop which takes zero values and the last is turn which takes two values.&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
=== Adding Commands ===&lt;br /&gt;
To add a command simply go into   &lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and add the command to the vector called &#039;&#039;cmds&#039;&#039;. It has 2 values a name of the command and how many attributes it has. After adding it simply compile the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
=== Adding commands ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== TODO ===&lt;br /&gt;
Add actual functionality to each command&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4508</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4508"/>
		<updated>2020-02-06T15:53:50Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Adding Commands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] added (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] added (For connecting ROS to the local network)&lt;br /&gt;
* [[Web_Interface#mission_package|syntax_pkg]] Made (Checks mission for syntax errors when committing)&lt;br /&gt;
* [[Web_Interface#syntax_package|mission_pkg]] Made (Handles mission files)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently here is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
=== Adding Commands ===&lt;br /&gt;
To add a command simply go into   &lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and add the command to the vector called &#039;&#039;cmds&#039;&#039;. It has 2 values a name of the command and how many attributes it has. After adding it simply compile the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
=== Adding commands ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== TODO ===&lt;br /&gt;
Add actual functionality to each command&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4507</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4507"/>
		<updated>2020-02-06T15:53:20Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* TODO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] added (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] added (For connecting ROS to the local network)&lt;br /&gt;
* [[Web_Interface#mission_package|syntax_pkg]] Made (Checks mission for syntax errors when committing)&lt;br /&gt;
* [[Web_Interface#syntax_package|mission_pkg]] Made (Handles mission files)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently here is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
=== Adding Commands ===&lt;br /&gt;
To add a command simply go into   &lt;br /&gt;
 ~\flexbot_ws\src\include\cmds.h&lt;br /&gt;
and add the command to the vector called &#039;&#039;cmds&#039;&#039;. It has 2 values a name of the command and how many attributes it has. After adding it simply compile the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
=== Adding commands ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== TODO ===&lt;br /&gt;
Add actual functionality to each command&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4498</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4498"/>
		<updated>2020-02-05T08:40:39Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* TODO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] added (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] added (For connecting ROS to the local network)&lt;br /&gt;
* [[Web_Interface#mission_package|syntax_pkg]] Made (Checks mission for syntax errors when committing)&lt;br /&gt;
* [[Web_Interface#syntax_package|mission_pkg]] Made (Handles mission files)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently here is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
=== Adding Commands ===&lt;br /&gt;
To add a command simply go into   &lt;br /&gt;
 ~\flexbot_ws\src\include\cmds.h&lt;br /&gt;
and add the command to the vector called &#039;&#039;cmds&#039;&#039;. It has 2 values a name of the command and how many attributes it has. After adding it simply compile the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
=== Adding commands ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== TODO ===&lt;br /&gt;
Add actual functionality to each command&lt;br /&gt;
&lt;br /&gt;
=TODO= &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;br /&gt;
realative path in cmds.h&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4497</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4497"/>
		<updated>2020-02-05T08:40:27Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Adding commands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] added (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] added (For connecting ROS to the local network)&lt;br /&gt;
* [[Web_Interface#mission_package|syntax_pkg]] Made (Checks mission for syntax errors when committing)&lt;br /&gt;
* [[Web_Interface#syntax_package|mission_pkg]] Made (Handles mission files)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently here is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
=== Adding Commands ===&lt;br /&gt;
To add a command simply go into   &lt;br /&gt;
 ~\flexbot_ws\src\include\cmds.h&lt;br /&gt;
and add the command to the vector called &#039;&#039;cmds&#039;&#039;. It has 2 values a name of the command and how many attributes it has. After adding it simply compile the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
=== Adding commands ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== TODO ===&lt;br /&gt;
Add actual functionality to each command&lt;br /&gt;
&lt;br /&gt;
===TODO=== &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;br /&gt;
realative path in cmds.h&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4496</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4496"/>
		<updated>2020-02-05T08:39:45Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Packages added/made for ROS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] added (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] added (For connecting ROS to the local network)&lt;br /&gt;
* [[Web_Interface#mission_package|syntax_pkg]] Made (Checks mission for syntax errors when committing)&lt;br /&gt;
* [[Web_Interface#syntax_package|mission_pkg]] Made (Handles mission files)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently here is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
=== Adding Commands ===&lt;br /&gt;
To add a command simply go into   &lt;br /&gt;
 ~\flexbot_ws\src\include\cmds.h&lt;br /&gt;
and add the command to the vector called &#039;&#039;cmds&#039;&#039;. It has 2 values a name of the command and how many attributes it has. After adding it simply compile the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
=== Adding commands ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===TODO=== &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;br /&gt;
realative path in cmds.h&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4495</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4495"/>
		<updated>2020-02-05T08:39:19Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Packages added/made for ROS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] (For connecting ROS to the local network)&lt;br /&gt;
* [[Web_Interface#mission_package|syntax_pkg]](Checks mission for syntax errors when committing)&lt;br /&gt;
* [[Web_Interface#syntax_package|mission_pkg]](Handles mission files)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently here is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
=== Adding Commands ===&lt;br /&gt;
To add a command simply go into   &lt;br /&gt;
 ~\flexbot_ws\src\include\cmds.h&lt;br /&gt;
and add the command to the vector called &#039;&#039;cmds&#039;&#039;. It has 2 values a name of the command and how many attributes it has. After adding it simply compile the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
=== Adding commands ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===TODO=== &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;br /&gt;
realative path in cmds.h&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4494</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4494"/>
		<updated>2020-02-05T08:39:05Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Packages added/made for ROS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] (For connecting ROS to the local network)&lt;br /&gt;
* [[Web_Interface#syntax_package|mission_pkg]](Handles mission files)&lt;br /&gt;
* [[Web_Interface#mission_package|syntax_pkg]](Checks mission for syntax errors when committing)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently here is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
=== Adding Commands ===&lt;br /&gt;
To add a command simply go into   &lt;br /&gt;
 ~\flexbot_ws\src\include\cmds.h&lt;br /&gt;
and add the command to the vector called &#039;&#039;cmds&#039;&#039;. It has 2 values a name of the command and how many attributes it has. After adding it simply compile the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
=== Adding commands ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===TODO=== &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;br /&gt;
realative path in cmds.h&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4493</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4493"/>
		<updated>2020-02-05T08:36:34Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* mission package */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] (For connecting ROS to the local network)&lt;br /&gt;
* mission_pkg (Handles mission files)&lt;br /&gt;
* syntax_pkg (Checks mission for syntax errors when committing)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently here is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
=== Adding Commands ===&lt;br /&gt;
To add a command simply go into   &lt;br /&gt;
 ~\flexbot_ws\src\include\cmds.h&lt;br /&gt;
and add the command to the vector called &#039;&#039;cmds&#039;&#039;. It has 2 values a name of the command and how many attributes it has. After adding it simply compile the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
=== Adding commands ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===TODO=== &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;br /&gt;
realative path in cmds.h&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4492</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4492"/>
		<updated>2020-02-05T08:36:12Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* syntax package */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] (For connecting ROS to the local network)&lt;br /&gt;
* mission_pkg (Handles mission files)&lt;br /&gt;
* syntax_pkg (Checks mission for syntax errors when committing)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently here is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
=== Adding Commands ===&lt;br /&gt;
To add a command simply go into   &lt;br /&gt;
 ~\flexbot_ws\src\include\cmds.h&lt;br /&gt;
and add the command to the vector called &#039;&#039;cmds&#039;&#039;. It has 2 values a name of the command and how many attributes it has. After adding it simply compile the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
===TODO=== &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;br /&gt;
realative path in cmds.h&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4491</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4491"/>
		<updated>2020-02-05T08:34:16Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* TODO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] (For connecting ROS to the local network)&lt;br /&gt;
* mission_pkg (Handles mission files)&lt;br /&gt;
* syntax_pkg (Checks mission for syntax errors when committing)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently here is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
===TODO=== &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;br /&gt;
realative path in cmds.h&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4490</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4490"/>
		<updated>2020-02-05T08:32:30Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Specific Actions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] (For connecting ROS to the local network)&lt;br /&gt;
* mission_pkg (Handles mission files)&lt;br /&gt;
* syntax_pkg (Checks mission for syntax errors when committing)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which says that it is moving 5 units and the command is from line 1.&lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently here is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
===TODO=== &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4489</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4489"/>
		<updated>2020-02-05T08:27:19Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Tabs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] (For connecting ROS to the local network)&lt;br /&gt;
* mission_pkg (Handles mission files)&lt;br /&gt;
* syntax_pkg (Checks mission for syntax errors when committing)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which in this case says at line 1 it has the command to move 5. &lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
Currently here is 3 tabs: &lt;br /&gt;
&lt;br /&gt;
1. The first tab, the &amp;quot;legs&amp;quot; tab, is a table with legs and IMU data&lt;br /&gt;
&lt;br /&gt;
2. The second tab, the &amp;quot;Camera&amp;quot; tab, is a tab with 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The third tab, the &amp;quot;Mission&amp;quot; tab, holds the mission text area where a new mission can be written and submitted. It can also retrieve the current mission.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
===TODO=== &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4488</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4488"/>
		<updated>2020-02-05T08:25:01Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Side bar */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] (For connecting ROS to the local network)&lt;br /&gt;
* mission_pkg (Handles mission files)&lt;br /&gt;
* syntax_pkg (Checks mission for syntax errors when committing)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
== Side bar ==&lt;br /&gt;
=== ROS Status ===&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
=== General Status ===&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
=== Specific Actions===&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which in this case says at line 1 it has the command to move 5. &lt;br /&gt;
&lt;br /&gt;
=== Start/Stop button ===&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
1. The &amp;quot;legs&amp;quot; tab is a table with the status of each leg.&lt;br /&gt;
&lt;br /&gt;
2. The &amp;quot;Cameras&amp;quot; tab is 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The &amp;quot;Mission&amp;quot; tab holds the mission text area where a new mission can be written and submitted or the current mission can be extracted.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
===TODO=== &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4487</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4487"/>
		<updated>2020-02-05T08:23:44Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Usage of web-interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] (For connecting ROS to the local network)&lt;br /&gt;
* mission_pkg (Handles mission files)&lt;br /&gt;
* syntax_pkg (Checks mission for syntax errors when committing)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
== Side bar ==&lt;br /&gt;
&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which in this case says at line 1 it has the command to move 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
1. The &amp;quot;legs&amp;quot; tab is a table with the status of each leg.&lt;br /&gt;
&lt;br /&gt;
2. The &amp;quot;Cameras&amp;quot; tab is 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The &amp;quot;Mission&amp;quot; tab holds the mission text area where a new mission can be written and submitted or the current mission can be extracted.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
===TODO=== &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4486</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4486"/>
		<updated>2020-02-05T08:23:38Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Side bar */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] (For connecting ROS to the local network)&lt;br /&gt;
* mission_pkg (Handles mission files)&lt;br /&gt;
* syntax_pkg (Checks mission for syntax errors when committing)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
== Side bar ==&lt;br /&gt;
&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which in this case says at line 1 it has the command to move 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
1. The &amp;quot;legs&amp;quot; tab is a table with the status of each leg.&lt;br /&gt;
&lt;br /&gt;
2. The &amp;quot;Cameras&amp;quot; tab is 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The &amp;quot;Mission&amp;quot; tab holds the mission text area where a new mission can be written and submitted or the current mission can be extracted.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
===TODO=== &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4485</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4485"/>
		<updated>2020-02-05T08:23:15Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Tabs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] (For connecting ROS to the local network)&lt;br /&gt;
* mission_pkg (Handles mission files)&lt;br /&gt;
* syntax_pkg (Checks mission for syntax errors when committing)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
== Side bar ==&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
 &lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which in this case says at line 1 it has the command to move 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
1. The &amp;quot;legs&amp;quot; tab is a table with the status of each leg.&lt;br /&gt;
&lt;br /&gt;
2. The &amp;quot;Cameras&amp;quot; tab is 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3. The &amp;quot;Mission&amp;quot; tab holds the mission text area where a new mission can be written and submitted or the current mission can be extracted.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
===TODO=== &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4484</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4484"/>
		<updated>2020-02-05T08:23:10Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Tabs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] (For connecting ROS to the local network)&lt;br /&gt;
* mission_pkg (Handles mission files)&lt;br /&gt;
* syntax_pkg (Checks mission for syntax errors when committing)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
== Side bar ==&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
 &lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which in this case says at line 1 it has the command to move 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
1. The &amp;quot;legs&amp;quot; tab is a table with the status of each leg.&lt;br /&gt;
&lt;br /&gt;
2. The &amp;quot;Cameras&amp;quot; tab is 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
3.The &amp;quot;Mission&amp;quot; tab holds the mission text area where a new mission can be written and submitted or the current mission can be extracted.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
===TODO=== &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4483</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4483"/>
		<updated>2020-02-05T08:22:57Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Usage of web-interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] (For connecting ROS to the local network)&lt;br /&gt;
* mission_pkg (Handles mission files)&lt;br /&gt;
* syntax_pkg (Checks mission for syntax errors when committing)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
== Side bar ==&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
 &lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which in this case says at line 1 it has the command to move 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tabs ==&lt;br /&gt;
 1. The &amp;quot;legs&amp;quot; tab is a table with the status of each leg.&lt;br /&gt;
&lt;br /&gt;
 2. The &amp;quot;Cameras&amp;quot; tab is 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
 3.The &amp;quot;Mission&amp;quot; tab holds the mission text area where a new mission can be written and submitted or the current mission can be extracted.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
===TODO=== &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4482</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4482"/>
		<updated>2020-02-05T08:21:46Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* realsens camera */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] (For connecting ROS to the local network)&lt;br /&gt;
* mission_pkg (Handles mission files)&lt;br /&gt;
* syntax_pkg (Checks mission for syntax errors when committing)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
 &lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which in this case says at line 1 it has the command to move 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;legs&amp;quot; tab is a table with the status of each leg.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Cameras&amp;quot; tab is 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Mission&amp;quot; tab holds the mission text area where a new mission can be written and submitted or the current mission can be extracted.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsense camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
===TODO=== &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4481</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4481"/>
		<updated>2020-02-05T08:21:01Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] (For connecting ROS to the local network)&lt;br /&gt;
* mission_pkg (Handles mission files)&lt;br /&gt;
* syntax_pkg (Checks mission for syntax errors when committing)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
 &lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which in this case says at line 1 it has the command to move 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;legs&amp;quot; tab is a table with the status of each leg.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Cameras&amp;quot; tab is 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Mission&amp;quot; tab holds the mission text area where a new mission can be written and submitted or the current mission can be extracted.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsens camera==&lt;br /&gt;
===Installing rosrealses===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
===TODO=== &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4480</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4480"/>
		<updated>2020-02-05T08:20:42Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* ROS realsens camera installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] (For connecting ROS to the local network)&lt;br /&gt;
* mission_pkg (Handles mission files)&lt;br /&gt;
* syntax_pkg (Checks mission for syntax errors when committing)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
 &lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which in this case says at line 1 it has the command to move 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;legs&amp;quot; tab is a table with the status of each leg.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Cameras&amp;quot; tab is 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Mission&amp;quot; tab holds the mission text area where a new mission can be written and submitted or the current mission can be extracted.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsens camera==&lt;br /&gt;
===  installation ===&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
===TODO=== &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4479</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4479"/>
		<updated>2020-02-05T08:20:06Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* realsens camera installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] (For connecting ROS to the local network)&lt;br /&gt;
* mission_pkg (Handles mission files)&lt;br /&gt;
* syntax_pkg (Checks mission for syntax errors when committing)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
 &lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which in this case says at line 1 it has the command to move 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;legs&amp;quot; tab is a table with the status of each leg.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Cameras&amp;quot; tab is 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Mission&amp;quot; tab holds the mission text area where a new mission can be written and submitted or the current mission can be extracted.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==ROS realsens camera installation==&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
===TODO=== &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4478</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4478"/>
		<updated>2020-02-05T08:19:58Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* realsens camera */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] (For connecting ROS to the local network)&lt;br /&gt;
* mission_pkg (Handles mission files)&lt;br /&gt;
* syntax_pkg (Checks mission for syntax errors when committing)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
 &lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which in this case says at line 1 it has the command to move 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;legs&amp;quot; tab is a table with the status of each leg.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Cameras&amp;quot; tab is 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Mission&amp;quot; tab holds the mission text area where a new mission can be written and submitted or the current mission can be extracted.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsens camera installation==&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
===TODO=== &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4477</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4477"/>
		<updated>2020-02-05T08:19:04Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* TODO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] (For connecting ROS to the local network)&lt;br /&gt;
* mission_pkg (Handles mission files)&lt;br /&gt;
* syntax_pkg (Checks mission for syntax errors when committing)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
 &lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which in this case says at line 1 it has the command to move 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;legs&amp;quot; tab is a table with the status of each leg.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Cameras&amp;quot; tab is 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Mission&amp;quot; tab holds the mission text area where a new mission can be written and submitted or the current mission can be extracted.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsens camera==&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
===TODO=== &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4476</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4476"/>
		<updated>2020-02-05T08:17:32Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Usage of web-interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
Change launch lauch file name for camera. &lt;br /&gt;
&lt;br /&gt;
Put in image for basic structure of the web interface.&lt;br /&gt;
&lt;br /&gt;
make hard links to html relevant files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] (For connecting ROS to the local network)&lt;br /&gt;
* mission_pkg (Handles mission files)&lt;br /&gt;
* syntax_pkg (Checks mission for syntax errors when committing)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
 &lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which in this case says at line 1 it has the command to move 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to the idle state when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. The buttons looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;legs&amp;quot; tab is a table with the status of each leg.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Cameras&amp;quot; tab is 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Mission&amp;quot; tab holds the mission text area where a new mission can be written and submitted or the current mission can be extracted.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsens camera==&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
===TODO=== &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=File:Button2.png&amp;diff=4475</id>
		<title>File:Button2.png</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=File:Button2.png&amp;diff=4475"/>
		<updated>2020-02-05T08:16:42Z</updated>

		<summary type="html">&lt;p&gt;S163903: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=File:Button1.png&amp;diff=4474</id>
		<title>File:Button1.png</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=File:Button1.png&amp;diff=4474"/>
		<updated>2020-02-05T08:16:34Z</updated>

		<summary type="html">&lt;p&gt;S163903: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4473</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4473"/>
		<updated>2020-02-05T08:14:42Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Usage of web-interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
Change launch lauch file name for camera. &lt;br /&gt;
&lt;br /&gt;
Put in image for basic structure of the web interface.&lt;br /&gt;
&lt;br /&gt;
make hard links to html relevant files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] (For connecting ROS to the local network)&lt;br /&gt;
* mission_pkg (Handles mission files)&lt;br /&gt;
* syntax_pkg (Checks mission for syntax errors when committing)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
The third panel is the more in depth detail of what the robot is doing currently. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
which in this case says at line 1 it has the command to move 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to idle when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. &lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;legs&amp;quot; tab is a table with the status of each leg.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Cameras&amp;quot; tab is 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Mission&amp;quot; tab holds the mission text area where a new mission can be written and submitted or the current mission can be extracted.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsens camera==&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
===TODO=== &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=File:Doing.png&amp;diff=4472</id>
		<title>File:Doing.png</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=File:Doing.png&amp;diff=4472"/>
		<updated>2020-02-05T08:13:42Z</updated>

		<summary type="html">&lt;p&gt;S163903: S163903 uploaded a new version of &amp;amp;quot;File:Doing.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;What the robot is doing currently, related to the feedback from mission&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=File:Doing.png&amp;diff=4471</id>
		<title>File:Doing.png</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=File:Doing.png&amp;diff=4471"/>
		<updated>2020-02-05T08:12:31Z</updated>

		<summary type="html">&lt;p&gt;S163903: What the robot is doing currently, related to the feedback from mission&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;What the robot is doing currently, related to the feedback from mission&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=File:Missionstatus.png&amp;diff=4470</id>
		<title>File:Missionstatus.png</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=File:Missionstatus.png&amp;diff=4470"/>
		<updated>2020-02-05T08:11:37Z</updated>

		<summary type="html">&lt;p&gt;S163903: Mission status&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mission status&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4469</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4469"/>
		<updated>2020-02-05T08:10:51Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Usage of web-interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
Change launch lauch file name for camera. &lt;br /&gt;
&lt;br /&gt;
Put in image for basic structure of the web interface.&lt;br /&gt;
&lt;br /&gt;
make hard links to html relevant files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] (For connecting ROS to the local network)&lt;br /&gt;
* mission_pkg (Handles mission files)&lt;br /&gt;
* syntax_pkg (Checks mission for syntax errors when committing)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It has 3 states, Checking, Closed and Connected. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next panel is the mission status and looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
The third panel is more in depth detail of what the robot is doing currently.&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
For example could this be &lt;br /&gt;
 &amp;quot;1: mov 2&amp;quot; &lt;br /&gt;
which says at line 1 it says move 2 . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to idle when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. &lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;legs&amp;quot; tab is a table with the status of each leg.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Cameras&amp;quot; tab is 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Mission&amp;quot; tab holds the mission text area where a new mission can be written and submitted or the current mission can be extracted.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsens camera==&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
===TODO=== &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4468</id>
		<title>Web Interface</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Web_Interface&amp;diff=4468"/>
		<updated>2020-02-05T08:09:52Z</updated>

		<summary type="html">&lt;p&gt;S163903: /* Usage of web-interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TODO == &lt;br /&gt;
Explain where to change things!&lt;br /&gt;
&lt;br /&gt;
just like struct for mission commmands&lt;br /&gt;
mission textfile position (cmds.h)&lt;br /&gt;
&lt;br /&gt;
maybe highlight cmds.h &lt;br /&gt;
explain the file strcuture and the communication structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
Change launch lauch file name for camera. &lt;br /&gt;
&lt;br /&gt;
Put in image for basic structure of the web interface.&lt;br /&gt;
&lt;br /&gt;
make hard links to html relevant files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Packages added/made for ROS =&lt;br /&gt;
* [[Web_Interface#realsense|realsense]] (For visual data as ROS topics)&lt;br /&gt;
* [[Web_Interface#roslibjs|rosbridge]] (For connecting ROS to the local network)&lt;br /&gt;
* mission_pkg (Handles mission files)&lt;br /&gt;
* syntax_pkg (Checks mission for syntax errors when committing)&lt;br /&gt;
&lt;br /&gt;
= Usage of web-interface=&lt;br /&gt;
Go to the robots ip address in the browser, remember to be on the same network! &lt;br /&gt;
 http://flexbot.local/&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
To the left we have the status panels, the top one is the status of ROS.  &lt;br /&gt;
&lt;br /&gt;
[[File:status.png]]&lt;br /&gt;
&lt;br /&gt;
It says connected if everything is right with ROS. Remember to refresh each time the robot boots or restarts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next panel is the mission status.&lt;br /&gt;
&lt;br /&gt;
[[File:missionstatus.png]]&lt;br /&gt;
&lt;br /&gt;
This indicates what it is currently doing, like receiving mission, checking for syntax and so forth. &lt;br /&gt;
&lt;br /&gt;
The third panel is more in depth detail of what the robot is doing currently.&lt;br /&gt;
&lt;br /&gt;
[[File:doing.png]]&lt;br /&gt;
&lt;br /&gt;
For example could this be &lt;br /&gt;
 &amp;quot;1: mov 2&amp;quot; &lt;br /&gt;
which says at line 1 it says move 2 . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The last element in the side panel is the start and stop bottom, it will automatically go back to idle when the mission is complete, if it is not complete and the stop button is pressed it will cancel the mission. &lt;br /&gt;
&lt;br /&gt;
[[File:button1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:button2.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;legs&amp;quot; tab is a table with the status of each leg.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Cameras&amp;quot; tab is 2 video feeds, one for color and one for depth. Keep in mind that the feed with depth is 16bit gray and thus JavaScript can&#039;t present it correctly so everything greater than 255 is getting rounded down to 255.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Mission&amp;quot; tab holds the mission text area where a new mission can be written and submitted or the current mission can be extracted.&lt;br /&gt;
&lt;br /&gt;
== Mission commands ==&lt;br /&gt;
&lt;br /&gt;
 Mov&lt;br /&gt;
&lt;br /&gt;
 Goto&lt;br /&gt;
&lt;br /&gt;
=Structure of the web-interface=&lt;br /&gt;
[[File:structure.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Packages in depth=&lt;br /&gt;
&lt;br /&gt;
==realsens camera==&lt;br /&gt;
To start of with we run the following command to reconfigure it to ros melodic:&lt;br /&gt;
 sudo apt install ros-melodic-ddynamic-reconfigure&lt;br /&gt;
&lt;br /&gt;
After that we can follow the guide given here, but i&#039;ll write my approach below&lt;br /&gt;
https://github.com/IntelRealSense/realsense-ros#step-3-install-intel-realsense-ros-from-sources&lt;br /&gt;
&lt;br /&gt;
Here the commands used to download and install the ros package can be seen:&lt;br /&gt;
 cd ~/flexbot_ws/src/&lt;br /&gt;
 git clone https://github.com/IntelRealSense/realsense-ros.git&lt;br /&gt;
 cd realsense-ros/&lt;br /&gt;
 git checkout `git tag | sort -V | grep -P &amp;quot;^\d+\.\d+\.\d+&amp;quot; | tail -1`&lt;br /&gt;
 cd ~/flexbot_ws&lt;br /&gt;
&lt;br /&gt;
At last we build and source it using&lt;br /&gt;
 catkin_make&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.sh&lt;br /&gt;
&lt;br /&gt;
To launch it use, remember to source or be in the right directory before launch&lt;br /&gt;
 roslaunch realsense2_camera rs_flexbot.launch&lt;br /&gt;
&lt;br /&gt;
==roslibjs== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing rosbridge===&lt;br /&gt;
This library makes it possible to use ros commands with javascript over a chosen port.&lt;br /&gt;
The first two lines goes to the source in the catkin workspace and creates a package for ros:&lt;br /&gt;
 cd ~/flexbot_ws/src&lt;br /&gt;
 catkin_create_pkg robot_gui_bridge rosbridge_server&lt;br /&gt;
Next we install the rosbridge package&lt;br /&gt;
 apt-get install ros-melodic-rosbridge-server &lt;br /&gt;
Now we create the launch file directory and the file used for launch&lt;br /&gt;
 mkdir ~/flexbot_ws/src/robot_gui_bridge/launch&lt;br /&gt;
 touch ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
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: &lt;br /&gt;
 echo &#039;&amp;lt;launch&amp;gt; &amp;lt;include file=&amp;quot;$(find rosbridge_server)/launch/rosbridge_websocket.launch&amp;quot;/&amp;gt;&amp;lt;/launch&amp;gt;&#039; &amp;gt;&amp;gt; ~/flexbot_ws/src/robot_gui_bridge/launch/websocket.launch&lt;br /&gt;
 source ~/flexbot_ws/devel/setup.bash&lt;br /&gt;
To test if it works run and look for errors:&lt;br /&gt;
 roslaunch robot_gui_bridge websocket.launch&lt;br /&gt;
&lt;br /&gt;
===Setting up the connection===&lt;br /&gt;
First check if the following command gives multiple ip&#039;s if so find a way to extract the correct one: &lt;br /&gt;
 hostname -I &lt;br /&gt;
&lt;br /&gt;
Now to setup the client, which is the computer not on the robot, write the following 3 lines in your &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_HOSTNAME=&#039;hostname -I&#039;&lt;br /&gt;
 export ROS_IP=&amp;quot;hostname -I&amp;quot;&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
Now to setup the server, which is the computer on the robot, write the following 2 lines in the &amp;quot;~/.bashrc&amp;quot; script:&lt;br /&gt;
 # write these inside ~/.bashrc&lt;br /&gt;
 export ROS_IP=flexbot.local&lt;br /&gt;
 export ROS_MASTER_URI=&#039;http://flexbot.local:11311/&#039;&lt;br /&gt;
&lt;br /&gt;
=== finalizing the server ===&lt;br /&gt;
Install apache to be able to access remotely :&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Now insert the desired HTML, CSS and javascript files into &lt;br /&gt;
 /var/www/html/ &lt;br /&gt;
&lt;br /&gt;
At last create a script inside &lt;br /&gt;
 /etc/network/if-up.d/&lt;br /&gt;
Which will be executed when connecting to a network. To ensure it not happening multiple times a flag is set when run the first time. The script can be seen in &lt;br /&gt;
 /etc/network/if-up.d/robotAutoStart.sh&lt;br /&gt;
and has a hardlink file in ~/flexbot_ws to make it easily accessible&lt;br /&gt;
&lt;br /&gt;
== syntax package ==&lt;br /&gt;
Not much to say, the package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/syntax_pkg/&lt;br /&gt;
and it checks for valid syntax in the submitted code. If there is error it returns the error type and where. If successful it saves the code in &lt;br /&gt;
 ~/flexbot_ws/mission.txt&lt;br /&gt;
Furthermore to add new commands simply add the word and how many arguments it takes inside the struct declaration in the file:&lt;br /&gt;
 ~/flexbot_ws/src/include/cmds.h&lt;br /&gt;
and build the code again&lt;br /&gt;
&lt;br /&gt;
== mission package ==&lt;br /&gt;
The package files are located inside&lt;br /&gt;
 ~/flexbot_ws/src/mission_pkg/&lt;br /&gt;
This package hasn&#039;t got any specific use now since it at the moment only reads the mission, runs the corresponding function and returns what line it is running at the moment. It is possible to cancel a mission but not to pause and resume it.&lt;br /&gt;
&lt;br /&gt;
===TODO=== &lt;br /&gt;
Make the defined functions actually do things rather than only giving feedback to the user and implement new commands if desired.&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=File:Status.png&amp;diff=4467</id>
		<title>File:Status.png</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=File:Status.png&amp;diff=4467"/>
		<updated>2020-02-05T08:09:27Z</updated>

		<summary type="html">&lt;p&gt;S163903: Shows the ROS status. Either Connected, Checking or Closed. Restart if closed since it doesn&amp;#039;t auto check&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Shows the ROS status. Either Connected, Checking or Closed. Restart if closed since it doesn&#039;t auto check&lt;/div&gt;</summary>
		<author><name>S163903</name></author>
	</entry>
</feed>