Moved around files into sub directories, Fixed form submission call function so that it does not refresh page on enter key

This commit is contained in:
GLEN TURNER (8GT6)
2015-05-21 11:15:53 -04:00
parent 478dc57d67
commit 28a4481bba
12 changed files with 71 additions and 2582 deletions

View File

@@ -1,163 +0,0 @@
cmake_minimum_required(VERSION 2.8.3)
project(asctecpelican_gui)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
)
## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)
## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()
################################################
## Declare ROS messages, services and actions ##
################################################
## To declare and build messages, services or actions from within this
## package, follow these steps:
## * Let MSG_DEP_SET be the set of packages whose message types you use in
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
## * In the file package.xml:
## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET
## * If MSG_DEP_SET isn't empty the following dependencies might have been
## pulled in transitively but can be declared for certainty nonetheless:
## * add a build_depend tag for "message_generation"
## * add a run_depend tag for "message_runtime"
## * In this file (CMakeLists.txt):
## * add "message_generation" and every package in MSG_DEP_SET to
## find_package(catkin REQUIRED COMPONENTS ...)
## * add "message_runtime" and every package in MSG_DEP_SET to
## catkin_package(CATKIN_DEPENDS ...)
## * uncomment the add_*_files sections below as needed
## and list every .msg/.srv/.action file to be processed
## * uncomment the generate_messages entry below
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
## Generate messages in the 'msg' folder
# add_message_files(
# FILES
# Message1.msg
# Message2.msg
# )
## Generate services in the 'srv' folder
# add_service_files(
# FILES
# Service1.srv
# Service2.srv
# )
## Generate actions in the 'action' folder
# add_action_files(
# FILES
# Action1.action
# Action2.action
# )
## Generate added messages and services with any dependencies listed here
# generate_messages(
# DEPENDENCIES
# std_msgs
# )
###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if you package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES asctecpelican_gui
# CATKIN_DEPENDS roscpp rospy std_msgs
# DEPENDS system_lib
)
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(
${catkin_INCLUDE_DIRS}
)
## Declare a cpp library
# add_library(asctecpelican_gui
# src/${PROJECT_NAME}/asctecpelican_gui.cpp
# )
## Declare a cpp executable
# add_executable(asctecpelican_gui_node src/asctecpelican_gui_node.cpp)
## Add cmake target dependencies of the executable/library
## as an example, message headers may need to be generated before nodes
# add_dependencies(asctecpelican_gui_node asctecpelican_gui_generate_messages_cpp)
## Specify libraries to link a library or executable target against
# target_link_libraries(asctecpelican_gui_node
# ${catkin_LIBRARIES}
# )
#############
## Install ##
#############
# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# install(PROGRAMS
# scripts/my_python_script
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )
## Mark executables and/or libraries for installation
# install(TARGETS asctecpelican_gui asctecpelican_gui_node
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )
## Mark cpp header files for installation
# install(DIRECTORY include/${PROJECT_NAME}/
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
# FILES_MATCHING PATTERN "*.h"
# PATTERN ".svn" EXCLUDE
# )
## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
# # myfile1
# # myfile2
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )
#############
## Testing ##
#############
## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_asctecpelican_gui.cpp)
# if(TARGET ${PROJECT_NAME}-test)
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()
## Add folders to be run by python nosetests
# catkin_add_nosetests(test)

View File

@@ -1,18 +1,27 @@
## Asctec Pelican GUI ##
#Getting server up and running#
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 the rosbridge\_suite that is used to linke the websocket and ROS: http://wiki.ros.org/rosbridge_suite
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
# 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
# TODO
By using ROSBridge, this GUI will attempt to display relevnt informaiton over the web for any device.
By using ROSBridge, this GUI will attempt to display relevant information over the web for any device.
TODO:
1. Display Battery Voltage
2. Display Network Information
1. Display camera image
1. Move connection information to a new tab

5
bootstrap.min.css vendored

File diff suppressed because one or more lines are too long

7
bootstrap.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -2,27 +2,33 @@
<html>
<head>
<meta charset="utf-8" />
<script type="text/javascript" src="eventemitter2.min.js"></script>
<script type="text/javascript" src="roslib.min.js"></script>
<!--
Link to included files. These are typically done by fetching from the web.
Because this needs to run without an internet conection, the files were saved
locally
-->
<script type="text/javascript" src="include/eventemitter2.min.js"></script>
<script type="text/javascript" src="include/roslib.min.js"></script>
<!-- <link rel="stylesheet" href="bootstrap.min.css">
<script src="jquery.min.js"></script>
<script src="bootstrap.min.js"></script> -->
<!-- Bootstrap is a beatuful and usefull library of GUIs. Docs can be found here: http://getbootstrap.com/
Tutorials can be found here: http://www.w3schools.com/bootstrap/default.asp
-->
<link rel="stylesheet" href="include/bootstrap.min.css">
<script src="include/jquery.min.js"></script>
<script src="include/bootstrap.min.js"></script>
<script src="include/roslib.js"></script>
<audio id="audio" src="audio/beep-04.mp3" autostart="false" ></audio>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="bootstrap.min.css">
<script src="jquery.min.js"></script>
<script src="bootstrap.min.js"></script>
<script src="roslib.js"></script>
<audio id="audio" src="beep-04.mp3" autostart="false" ></audio>
<script type="text/javascript">
var ros = new ROSLIB.Ros();
ros.connectionName = 'ws://192.168.1.102:9090';
ros.connectionName = 'ws://192.168.1.103:9090';
// ros.connectionName = 'ws://localhost:9090';
@@ -32,7 +38,6 @@
document.getElementById("ConnectionIPInput").value = ros.connectionName;
document.getElementById("ConnectionIPLabel").innerHTML = 'No connection';
document.getElementById("ConnectionButton").className = "btn btn-warning"
console.log(error);
});
@@ -51,13 +56,24 @@
// Create a connection to the rosbridge WebSocket server.
ros.connect(ros.connectionName);
function attemptConnection()
// attept to connect to the ros master from the IP given orgrab it from the form
ros.attemptConnection = function(ipAddress)
{
ros.connectionName = document.getElementById("ConnectionIPInput").value;
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',
@@ -100,16 +116,19 @@
{
document.getElementById("VoltageDisplay").className = "progress-bar progress-bar-success"
}
}
};
function updateUpTime(time)
{
document.getElementById("UpTime").innerHTML = time
}
};
window.setInterval(function(){
// ShowTime();
}, 100);
function validateForm()
{
ros.attemptConnection();
return false;
};
</script>
</head>
@@ -123,18 +142,17 @@
<div class="panel panel-default">
<div class="panel-body">
<form>
<div id="ConnectionIPForm" class="form-group has-warning has-feedback" align="center">
<form class="form-inline" role="form" onsubmit="return validateForm()">
<div id="ConnectionIPForm" class="form-group has-warning" align="center">
<label id="ConnectionIPLabel" class="col-sm-3 control-label" for="inputWarning">Connection warning</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="ConnectionIPInput" value="No IP Address yet">
<input type="text" class="form-control" id="ConnectionIPInput" value="No IP Address yet"/>
<script type="text/javascript">
document.getElementById("ConnectionIPInput").value = ros.connectionName;
//document.getElementById("ConnectionIPInput").value = ros.connectionName;
</script>
<!-- <span class="glyphicon glyphicon-remove form-control-feedback"></span> -->
</div>
<div class="col-sm-1">
<button id="ConnectionButton" type="button" class="btn btn-warning" onclick=attemptConnection()>Connect</button>
<button id="ConnectionButton" type="button" class="btn btn-warning" onclick="ros.attemptConnection()">Connect</button>
</div>
</div>
</form>
@@ -148,25 +166,26 @@
</div>
<div class="panel-body">
<label class="col-sm-2"> Battery Voltage: </label>
<div class="progress">
<div id="VoltageDisplay" class="progress-bar progress-bar-striped active" role="progressbar"
aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width:100%" >
No data recieved yet.
<div class="row">
<label class="col-sm-2"> Battery Voltage: </label>
<div class="progress">
<div id="VoltageDisplay" class="progress-bar progress-bar-striped active" role="progressbar"
aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width:100%" >
No data recieved yet.
</div>
</div>
</div>
<label class="col-sm-2"> Up Time: </label>
<div class="col-sm-1" id="UpTime" align="left">
N/A
</div>
<div>
seconds
<div class="row">
<label class="col-sm-2"> Up Time (s): </label>
<div class="col-sm-1" id="UpTime">
N/A
</div>
</div>
</div>
</div>
</div>
</body>
</html>

4
jquery.min.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -1,56 +0,0 @@
<?xml version="1.0"?>
<package>
<name>asctecpelican_gui</name>
<version>0.0.0</version>
<description>The asctecpelican_gui package</description>
<!-- One maintainer tag required, multiple allowed, one person per tag -->
<!-- Example: -->
<!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
<maintainer email="glenturner@todo.todo">glenturner</maintainer>
<!-- One license tag required, multiple allowed, one license per tag -->
<!-- Commonly used license strings: -->
<!-- BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
<license>TODO</license>
<!-- Url tags are optional, but mutiple are allowed, one per tag -->
<!-- Optional attribute type can be: website, bugtracker, or repository -->
<!-- Example: -->
<!-- <url type="website">http://wiki.ros.org/asctecpelican_gui</url> -->
<!-- Author tags are optional, mutiple are allowed, one per tag -->
<!-- Authors do not have to be maintianers, but could be -->
<!-- Example: -->
<!-- <author email="jane.doe@example.com">Jane Doe</author> -->
<!-- The *_depend tags are used to specify dependencies -->
<!-- Dependencies can be catkin packages or system dependencies -->
<!-- Examples: -->
<!-- Use build_depend for packages you need at compile time: -->
<!-- <build_depend>message_generation</build_depend> -->
<!-- Use buildtool_depend for build tool packages: -->
<!-- <buildtool_depend>catkin</buildtool_depend> -->
<!-- Use run_depend for packages you need at runtime: -->
<!-- <run_depend>message_runtime</run_depend> -->
<!-- Use test_depend for packages you need only for testing: -->
<!-- <test_depend>gtest</test_depend> -->
<buildtool_depend>catkin</buildtool_depend>
<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<build_depend>std_msgs</build_depend>
<run_depend>roscpp</run_depend>
<run_depend>rospy</run_depend>
<run_depend>std_msgs</run_depend>
<!-- The export tag contains other, unspecified, tags -->
<export>
<!-- Other tools can request additional information be placed here -->
</export>
</package>

2302
roslib.js

File diff suppressed because it is too large Load Diff

1
roslib.min.js vendored

File diff suppressed because one or more lines are too long