Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,38 @@ get a version of pynetworktables that works with Python 2.7:

sudo pip install pynetworktables==2018.2.1

## Ports and other important information
| Type | Description | Number | Our Use |
| :--- | :----: | :----: | ---: |
| Camera Data | For cameras and video | UDP/TCP 1180 | Available |
| Camera Data | For cameras and video | UDP/TCP 1181 | Available |
| Camera Data | For cameras and video | UDP/TCP 1182 | Available |
| Camera Data | For cameras and video | UDP/TCP 1183 | Available |
| Camera Data | For cameras and video | UDP/TCP 1184 | Available |
| Camera Data | For cameras and video | UDP/TCP 1185 | Available |
| Camera Data | For cameras and video | UDP/TCP 1186 | Available |
| Camera Data | For cameras and video | UDP/TCP 1187 | Available |
| Camera Data | For cameras and video | UDP/TCP 1188 | Available |
| Camera Data | For cameras and video | UDP/TCP 1189 | Available |
| Camera Data | For cameras and video | UDP/TCP 1190 | Available |
| SmartDashboard | Unsure if this also includes other networktables tables | TCP 1735 | Can't use |
| DS-Robot Comms | Contains the data from the DS to the robot | UDP 1130 | Can't use |
| Robot to DS | Unsure what this contans | UDP 1140 | Can't use |
| Camera/Web interface | Unsecure web interface connection | HTTP 80 | Available |
| Camera/Web interface | Secure web interface connection | HTTP 443 | Available |
| h.264 Streaming | Real time streaming | UDP/TCP 554 | Available |
| Team Use | Team Use | UDP/TCP 5800 | Available |
| Team Use | Team Use | UDP/TCP 5801 | Available |
| Team Use | Team Use | UDP/TCP 5802 | Available |
| Team Use | Team Use | UDP/TCP 5803 | Available |
| Team Use | Team Use | UDP/TCP 5804 | Available |
| Team Use | Team Use | UDP/TCP 5805 | Available |
| Team Use | Team Use | UDP/TCP 5806 | Available |
| Team Use | Team Use | UDP/TCP 5807 | Available |
| Team Use | Team Use | UDP/TCP 5808 | Available |
| Team Use | Team Use | UDP/TCP 5809 | Available |
| Team Use | Team Use | UDP/TCP 5810 | Available |

## Communicating with the Robot

We do not want to rely on DNS for communications. Therefore, we need to tell
Expand Down
204 changes: 204 additions & 0 deletions hungry_toaster_gui/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
cmake_minimum_required(VERSION 2.8.3)
project(hungry_toaster_gui)

## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)

## 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
rosbridge_server
)

## 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 tag for "message_generation"
## * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET
## * If MSG_DEP_SET isn't empty the following dependency has been pulled in
## but can be declared for certainty nonetheless:
## * add a exec_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 # Or other packages containing msgs
# )

################################################
## Declare ROS dynamic reconfigure parameters ##
################################################

## To declare and build dynamic reconfigure parameters within this
## package, follow these steps:
## * In the file package.xml:
## * add a build_depend and a exec_depend tag for "dynamic_reconfigure"
## * In this file (CMakeLists.txt):
## * add "dynamic_reconfigure" to
## find_package(catkin REQUIRED COMPONENTS ...)
## * uncomment the "generate_dynamic_reconfigure_options" section below
## and list every .cfg file to be processed

## Generate dynamic reconfigure parameters in the 'cfg' folder
# generate_dynamic_reconfigure_options(
# cfg/DynReconf1.cfg
# cfg/DynReconf2.cfg
# )

###################################
## 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 your 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 hungry_toaster_gui
# CATKIN_DEPENDS rosbridge_server
# DEPENDS system_lib
)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
# include
${catkin_INCLUDE_DIRS}
)

## Declare a C++ library
# add_library(${PROJECT_NAME}
# src/${PROJECT_NAME}/hungry_toaster_gui.cpp
# )

## Add cmake target dependencies of the library
## as an example, code may need to be generated before libraries
## either from message generation or dynamic reconfigure
# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

## Declare a C++ executable
## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide
# add_executable(${PROJECT_NAME}_node src/hungry_toaster_gui_node.cpp)

## Rename C++ executable without prefix
## The above recommended prefix causes long target names, the following renames the
## target back to the shorter version for ease of user use
## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")

## Add cmake target dependencies of the executable
## same as for the library above
# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

## Specify libraries to link a library or executable target against
# target_link_libraries(${PROJECT_NAME}_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 for installation
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html
# install(TARGETS ${PROJECT_NAME}_node
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark libraries for installation
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_libraries.html
# install(TARGETS ${PROJECT_NAME}
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# RUNTIME DESTINATION ${CATKIN_GLOBAL_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_hungry_toaster_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)
6 changes: 6 additions & 0 deletions hungry_toaster_gui/gui/InputSim.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
var robotX = Math.round((Math.random()*821-(821/2))*0.316);
var robotY = Math.round((Math.random()*1598-(1598/2))*0.316);
robotX = String("calc(63vw + "+robotX+"px)");
robotY = String("calc(52vh + "+robotY+"px)");

var roboRotate = Math.round(Math.random()*360);
Binary file added hungry_toaster_gui/gui/Map.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions hungry_toaster_gui/gui/gui-the_good_one.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://static.robotwebtools.org/roslibjs/current/roslib.min.js"/>
<script type="text/javascript" src="http://static.robotwebtools.org/roslibjs/current/roslib.min.js"/>
<script type="text/javascript" src="InputSim.js"/>
<script type="text/javascript">var ros = new ROSLIB.Ros({url : 'ws://10.17.21.102:9090'});ros.on('connection', function() {document.getElementById("status").d = "Connected";}); ros.on('error', function(error) {document.getElementById("status").innerHTML = "Error"; }); ros.on('close', function() {document.getElementById("status").innerHTML = "Closed"; }); var robotColur = 1; var butNum = 1; var mapStyle = 1;document.addEventListener('keypress', logKey); function logKey (e){if (e.keyCode == 119){butNum--; }if (e.keyCode == 115){ butNum++;}if(butNum == 4){butNum = 1;}if(butNum == 0){butNum = 3;}if(butNum == 1){if(robotColur==1){document.getElementById("robotImg").style.color="#55FFFF"; }if(robotColur==2){document.getElementById("robotImg").style.color="#FF5555";}document.getElementById("mapButton").style.backgroundColor='#cccc55'; if(mapStyle==2){document.getElementById("desk").innerHTML="Map of the field:<br/> ___________________<br/> _-'' <span class='blue'>'-_-' </span>
<span class='red'> '-_-'</span> ''-_<br/> | |<br/> | |<br/> | |<br/> |--------------------------|<br/> | |<br/> | |<br/> |<span class='blue'>____</span>
<span class='grey'> _</span>
<span class='red'> ___</span>|<br/> | <span class='blue'>|</span>
<span class='grey'> __--'' | </span>
<span class='red'>|</span> |<br/> |'<span class='green'>/</span>
<span class='blue'>\\</span>'<span class='blue'>|</span>
<span class='grey'>_--'' | | </span>
<span class='red'>|</span> |<br/> |_<span class='red'>\\</span>
<span class='yellow'>/</span>_<span class='blue'>|</span>
<span class='grey'>| | |</span>
<span class='red'>|</span> |<br/> | <span class='blue'>|</span>
<span class='grey'>| | | </span>
<span class='red'>|</span> |<br/> | <span class='blue'>|</span>
<span class='grey'> | | |</span>
<span class='red'>|</span>---|<br/> |<span class='blue'> | </span>
<span class='grey'>| | __-%</span>
<span class='red'>|</span>
<span class='green'>(</span>
<span class='red'> )</span>|<br/> | <span class='blue'> | </span>
<span class='grey'> | __--'' </span>
<span class='red'>|</span>'''|<br/> |<span class='blue'>____| </span>
<span class='grey'> %'' </span>
<span class='red'>|___</span>|<br/> | |<br/> | |<br/> |__________________________|<br/> | |<br/> | |<br/> | |<br/> --_ <span class='blue'> /^\\ </span>
<span class='red'> /^\\ </span> _--<br/> ''<span class='blue'>'</span>---<span class='blue'>'</span>------<span class='red'>'</span>---<span class='red'>'</span>'' <br/>";document.getElementById("desk").style.whiteSpace = "pre"; document.getElementById("desk").style.lineHeight = "10px";document.getElementById("robotImg").style.left = "100vw";document.getElementById("robotFrame").style.top=robotY;document.getElementById("robotFrame").style.left=robotX;document.getElementById("robotFrame").style.transform="rotate("+roboRotate+"deg)"} else if(mapStyle==1){document.getElementById("desk").innerHTML="Map of the field:<br/> ___________________<br/> _-'' '-_-' '-_-' ''-_<br/> | |<br/> | |<br/> | |<br/> |--------------------------|<br/> | |<br/> | |<br/> |____ _ ___|<br/> | | __--'' | | |<br/> |'/\\'|_--'' | | | |<br/> |_\\/_|| | | | |<br/> | | | | | | |<br/> | | | | ||---|<br/> | | | | __-%|( )|<br/> | | | __--'' |'''|<br/> |____| %'' |___|<br/> | |<br/> | |<br/> |__________________________|<br/> | |<br/> | |<br/> | |<br/> --_ /^\\ /^\\ _--<br/> '''---'------'---''' <br/>";document.getElementById("desk").style.whiteSpace = "pre";document.getElementById("desk").style.lineHeight = "10px";document.getElementById("robotImg").style.color="#FFFFFF";document.getElementById("robotFrame").style.left=robotX;document.getElementById("robotFrame").style.top=robotY;document.getElementById("robotFrame").style.transform="rotate("+roboRotate+"deg)"}else if(mapStyle==3){document.getElementById("desk").innerHTML="map style 3, PNG"}} else {document.getElementById("mapButton").style.backgroundColor='#0000aa';}if(butNum == 2){document.getElementById("robotImg").style.color="#0000aa";document.getElementById("desk").style.lineHeight='20px';document.getElementById("desk").style.whiteSpace='normal';document.getElementById("mapStyleButton").style.backgroundColor='#cccc55';document.getElementById("desk").innerHTML = "This modifies the style of the map, with the following outputs:<br/>Authentic ASCII - Gives an authentic ASCII style field map, for the true 1980's feel<br/>Colorized ASCII - For those who think there too cool for authentic ASCII, this is a colorized map of the field, but still retains that ASCII feel<br/>Genaric PNG - For those who like the idea of navigating a website using a mouse, this map is a cheap PNG of the field. It may look better, but what is more important, a website that works or a website that functions like the BIOS on a 20 year old computer?<br/>Current Style: <span id='cStyle'/>";if(e.keyCode == 13){mapStyle++;if(mapStyle>=4){mapStyle = 1;}}if(mapStyle == 1){document.getElementById("cStyle").innerHTML = "Authentic ASCII";}if(mapStyle == 2){document.getElementById("cStyle").innerHTML = "Colorized ASCII";}if(mapStyle == 3){document.getElementById("cStyle").innerHTML = "Generic PNG";} } else {document.getElementById("mapStyleButton").style.backgroundColor='#0000aa';}if(butNum == 3){document.getElementById("robotImg").style.color="#0000aa";document.getElementById("robotColor").style.backgroundColor='#cccc55';document.getElementById("desk").style.lineHeight='20px';document.getElementById("desk").style.whiteSpace='normal';} else {document.getElementById("robotColor").style.backgroundColor='#0000aa';}if(butNum==3){document.getElementById("desk").innerHTML = "This modifies the color of the robot, and has two modes. Blue, for the blue alliance and red. You dont need me to tell you what red is for.<br/>Current robot color:<span id='robotC'/>";if(e.keyCode == 13){robotColur++;if(robotColur>=3){robotColur = 1;}}}if(robotColur==1){document.getElementById("robotC").innerHTML = "<span class='blue'>Blue</span>";}if(robotColur==2){document.getElementById("robotC").innerHTML = "<span class='red'>red</span>";}} </script>
<style>@font-face {font-family: 'perfect_dos_vga_437regular';src: url('perfect_dos_vga_437-webfont.woff2') format('woff2'),url('perfect_dos_vga_437-webfont.woff') format('woff');font-weight: normal;font-style: normal;} body {background-color: #0000AA;}h1 {color: #FFFFFF;text-align: center;font-family:'Perfect DOS VGA 437';}leftBox {white-space: pre;color: #FFFFFF;text-align: left;font-family:'Perfect DOS VGA 437';font-size: 20px; padding: 10px;border-width: 4px;border-style:solid;border-color:#FFFFFF;position:absolute;height:83vh;top:10vh;width:calc(50vw - 33px);} rightBox {width: calc(50vw - 53px);left:calc(50vw);height:83vh;position:absolute;top:10vh;color: #FFFFFF;text-align: left;font-family:'Perfect DOS VGA 437';font-size: 20px;overflow-wrap: break-word;line-height: 10px;padding: 10px;border-width: 4px;border-style:solid;border-color:#FFFFFF;}robotFrame {position:absolute;color: #0000aa;text-align: left;font-family:'Perfect DOS VGA 437';font-size: 20px;line-height: 10px;font-weight:900;}.blue {color:#55FFFF;}.red{color:#FF5555;}.yellow{color:#FFFF55;}.green{color:#55FF55;}.grey{color:#AAAAAA;}</style>
</head>
<body>
<h1>ROS Interface Board</h1>
<leftBox>Connection status: <span id="status">Connecting...</span>
<br/>
<span id="mapButton"/>Field Map</span>
<br/>
<span id="mapStyleButton">Map Style</span>
<br/>
<span id="robotColor">Robot Color</span>
</leftBox>
<rightBox>
<span id="desk">Descriptor Area</span>
</rightBox>
<robotFrame id="robotFrame">
<span id="robotImg">|^^|<br/>|__|</span>
</robotFrame>
</body>
</html>
Loading