removed files
This commit is contained in:
85
README.md~
85
README.md~
@@ -1,85 +0,0 @@
|
||||
# Asctec Pelican GUI
|
||||
|
||||
The purpose of this project is an example of how to write a web page that can be accessed by any device on the same network as the host computer by accessing the IP of that host computer.
|
||||
|
||||
Here are the following requirements:
|
||||
1. A roscore running
|
||||
2. The IP of the machine running ROS
|
||||
4. Permissions be changed on the working directory
|
||||
3. apache2 up and running
|
||||
|
||||
### Quick Start Guide
|
||||
|
||||
To connect to a remote computer, connect to the remote master by replaceing the appropriate IP addresses as shown here:
|
||||
|
||||
sudo route add 192.168.2.1 gw 192.168.0.103
|
||||
export ROS_MASTER_URI=http://192.168.0.103:11311
|
||||
export ROS_IP=192.168.0.101
|
||||
|
||||
Then run the bash file in the working directory.
|
||||
|
||||
bash bashLaunchFile.bash
|
||||
|
||||
## ROS Core
|
||||
If you are either using a remote rosmaster or a local one, make sure on the computer that you are going to use to host the webpage can access and echo topics that you wish to display on the webpage.
|
||||
|
||||
## The IP of the machine running ROS
|
||||
This is required when connecting using the rosbridge
|
||||
|
||||
## Folder Permissions
|
||||
This was a big problem for me. If you ever get errors on the page that permissions where denied, navigate to the directory above the working directory, right click on the directory that you are working in, change the permissions for all folders and sub folders so that everyone can access it.
|
||||
|
||||
## apache2 up and running
|
||||
apache2 is used to host the webpage on your computer.
|
||||
|
||||
Google can help you find the install instructions which are straight forward.
|
||||
|
||||
The only next trick is to change the host directory to the working directory.
|
||||
|
||||
1.check where is configuration. Generally, apache2 configuration file is located in /etc/apache2/ folder.
|
||||
|
||||
_vi /etc/apache2/apache2.conf_
|
||||
in that file, you can find out the location of "DocumentRoot" config
|
||||
|
||||
Include sites-enabled/
|
||||
that indicates your configration file is in "/etc/apache2/sites-enabled/".
|
||||
|
||||
2.Edit DocumentRoot config
|
||||
|
||||
vi /etc/apache2/sites-enabled/000-default
|
||||
In that file, you can find the "DocumentRoot" like below
|
||||
|
||||
DocumentRoot /home/glenturner/catkin\_ws/src/asctec\_pelican\_gui
|
||||
|
||||
And, modify that as you want.
|
||||
|
||||
4.Change in apa.conf file to include:
|
||||
|
||||
<Directory /home/glenturner/catkin_ws/src/asctec_pelican_gui>
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
3.Restart apache.
|
||||
|
||||
service apache2 restart
|
||||
|
||||
## Getting server up and running#
|
||||
|
||||
Here the rosbridge\_suite that is used to link the websocket and ROS: http://wiki.ros.org/rosbridge_suite.
|
||||
|
||||
Basic ROS functionality of rosbridge: http://wiki.ros.org/roslibjs/Tutorials/BasicRosFunctionality
|
||||
|
||||
the launch command: roslaunch rosbridge_server rosbridge_websocket.launch
|
||||
|
||||
# TODO
|
||||
|
||||
|
||||
By using ROSBridge, this GUI will attempt to display relevant information over the web for any device.
|
||||
|
||||
TODO:
|
||||
1. Display Network Information
|
||||
1. Display camera image
|
||||
1. Move connection information to a new tab
|
||||
1. Check why on iPad the default IP address doesn't load
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
#! /bin/bash
|
||||
|
||||
echo Opening Web Browser
|
||||
IP_ADDR=$(hostname -I)
|
||||
|
||||
echo $IP_ADDR
|
||||
x-www-browser $IP_ADDR
|
||||
|
||||
echo Launching ROSBridge
|
||||
roslaunch rosbridge_server rosbridge_websocket.launch
|
||||
|
||||
5
include/bootstrap.min.css
vendored
5
include/bootstrap.min.css
vendored
File diff suppressed because one or more lines are too long
7
include/bootstrap.min.js
vendored
7
include/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
1
include/eventemitter2.min.js
vendored
1
include/eventemitter2.min.js
vendored
File diff suppressed because one or more lines are too long
4
include/jquery.min.js
vendored
4
include/jquery.min.js
vendored
File diff suppressed because one or more lines are too long
2302
include/roslib.js
2302
include/roslib.js
File diff suppressed because it is too large
Load Diff
1
include/roslib.min.js
vendored
1
include/roslib.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,55 +0,0 @@
|
||||
var ros = new ROSLIB.Ros();
|
||||
|
||||
ros.connectionName = 'ws://192.168.1.102:9090';
|
||||
// ros.connectionName = 'ws://localhost:9090';
|
||||
// If there is an error on the backend, an 'error' emit will be emitted.
|
||||
ros.on('error', function(error) {
|
||||
document.getElementById("ConnectionIPForm").className = "form-group has-warning has-feedback";
|
||||
document.getElementById("ConnectionIPInput").value = ros.connectionName;
|
||||
document.getElementById("ConnectionIPLabel").innerHTML = 'No connection';
|
||||
document.getElementById("ConnectionButton").className = "btn btn-warning"
|
||||
console.log(error);
|
||||
});
|
||||
// Find out exactly when we made a connection.
|
||||
ros.on('connection', function() {
|
||||
console.log('Connection made!');
|
||||
document.getElementById("ConnectionIPForm").className = "form-group has-success has-feedback";
|
||||
document.getElementById("ConnectionIPInput").value = ros.connectionName;
|
||||
document.getElementById("ConnectionIPLabel").innerHTML = 'Connection made at:';
|
||||
document.getElementById("ConnectionButton").className = "btn btn-success"
|
||||
});
|
||||
|
||||
ros.on('close', function() {
|
||||
console.log('Connection closed.');
|
||||
});
|
||||
// Create a connection to the rosbridge WebSocket server.
|
||||
ros.connect(ros.connectionName);
|
||||
|
||||
|
||||
// attept to connect to the ros master from the IP given orgrab it from the form
|
||||
ros.attemptConnection = function(ipAddress)
|
||||
{
|
||||
if( typeof ipAddress !== "undefined")
|
||||
{
|
||||
ros.connectionName = ipAddress;
|
||||
}
|
||||
else
|
||||
{
|
||||
ros.connectionName = document.getElementById("ConnectionIPInput").value
|
||||
}
|
||||
console.log('Connection = ' + ros.connectionName);
|
||||
ros.connect(ros.connectionName);
|
||||
}
|
||||
|
||||
|
||||
// LISTENER ///
|
||||
var voltageListener = new ROSLIB.Topic({
|
||||
ros : ros,
|
||||
name : '/asctec/LL_STATUS',
|
||||
messageType : '/asctec_msgs/LLStatus'
|
||||
});
|
||||
|
||||
voltageListener.subscribe(function(message) {
|
||||
updateVoltage(message.battery_voltage_1/1000);
|
||||
updateUpTime(message.up_time)
|
||||
});
|
||||
@@ -1,44 +0,0 @@
|
||||
function updateVoltage(voltage)
|
||||
{
|
||||
|
||||
var voltage_min = 9.5;
|
||||
var voltage_max = 12.5;
|
||||
var voltage_range = voltage_max - voltage_min;
|
||||
|
||||
var voltage_percentage = (voltage - voltage_min) / voltage_range * 100;
|
||||
|
||||
var voltage_string = "";
|
||||
voltage_string = voltage_string.concat(voltage_percentage);
|
||||
voltage_string = voltage_string.substring(0,4);
|
||||
voltage_string = voltage_string.concat('%');
|
||||
|
||||
document.getElementById("VoltageDisplay").style.width = voltage_string;
|
||||
document.getElementById("VoltageDisplay").innerHTML = voltage_string;
|
||||
|
||||
if (voltage_percentage < 50 && voltage_percentage > 25 ) {
|
||||
document.getElementById("VoltageDisplay").className = "progress-bar progress-bar-warning"
|
||||
}
|
||||
else if ( voltage_percentage <= 25)
|
||||
{
|
||||
document.getElementById("VoltageDisplay").className = "progress-bar progress-bar-danger"
|
||||
var sound = document.getElementById("audio");
|
||||
sound.play()
|
||||
console.log("Pay Sound")
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("VoltageDisplay").className = "progress-bar progress-bar-success"
|
||||
}
|
||||
};
|
||||
|
||||
function updateUpTime(time)
|
||||
{
|
||||
document.getElementById("UpTime").innerHTML = time
|
||||
};
|
||||
|
||||
|
||||
function validateForm()
|
||||
{
|
||||
ros.attemptConnection();
|
||||
return false;
|
||||
};
|
||||
Reference in New Issue
Block a user