Cleanup old files and readme.
This commit is contained in:
61
README.md
61
README.md
@@ -1,53 +1,12 @@
|
||||
# AESCAPE LAB UI
|
||||
# Aescape Lab UI
|
||||
|
||||
## To run
|
||||
Set your master to be what you want - default is `phoebe`.
|
||||
Then run
|
||||
```
|
||||
roslaunch aescape_lab_ui lab_ui.launch
|
||||
```
|
||||
|
||||
|
||||
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.
|
||||
|
||||
The best way to contribute to this project is to make a new brach from the master branch called the name of the robot that it is used for. This will also alow maximum colaberation between labs. This can be accomplished by going to the tabs Commits->Branches then select "New Branch"
|
||||
|
||||
### Quick Start Guide
|
||||
|
||||
If you are connecting to a remote computer that is running the roscore, you need to run the following lines in the terminal:
|
||||
|
||||
sudo route add 192.168.2.1 gw <Host computer IP>
|
||||
export ROS_MASTER_URI=http://<Host computer IP>:11311
|
||||
export ROS_IP=<your IP>
|
||||
|
||||
Make sure you have the web_video_server installed:
|
||||
|
||||
sudo apt-get install ros-indigo-web-video-server
|
||||
|
||||
Make sure you have ROSBridge installed:
|
||||
|
||||
sudo apt-get install ros-indigo-rosbridge-suite
|
||||
|
||||
Then run the bash file in the working directory by running the following in the terminal.
|
||||
|
||||
. launch.bash
|
||||
|
||||
#### Just display the webpage
|
||||
|
||||
If you just want to test the webpage, navigate to the working directory in the terminal and type
|
||||
|
||||
python -m SimpleHTTPServer
|
||||
|
||||
Then open http://localhost:8000/. or yourIPAddress:8000
|
||||
|
||||
# Making Changes
|
||||
|
||||
Feel free to clone this project, make a new branch and use it as a base for your own GUI.
|
||||
|
||||
You can easily customise the "Data Display" pannel by changing the HTML "data\_dsisplay\data\_display.html" file.
|
||||
|
||||
All ROS related Javascript should go in the "data\_display/js/ros\_scripts.js" file.
|
||||
All functions that are used to update the GUI should go in the "data\_display/js/update_guis.js" file.
|
||||
|
||||
DO NOT MAKE CHANGES OUTISDE OF THIS DIECTORY AS IT WILL CAUSE MERG PROBLEMS.
|
||||
|
||||
By using ROSBridge, this GUI will attempt to display relevant information over the web for any device.
|
||||
|
||||
# Screen Shots
|
||||
|
||||
Screen shots are in the root working directory
|
||||
|
||||
## To access
|
||||
Use Hamachi network:
|
||||
http://titan.aescape.co:8000
|
||||
Binary file not shown.
Binary file not shown.
@@ -110,7 +110,7 @@ window.setInterval(function(){
|
||||
updateTopicsGUI();
|
||||
updateNodesGUI();
|
||||
|
||||
}, 500);
|
||||
}, 5000);
|
||||
|
||||
function validateForm()
|
||||
{
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 56 KiB |
@@ -27,8 +27,6 @@ Tutorials can be found here: http://www.w3schools.com/bootstrap/default.asp
|
||||
|
||||
<script type="text/javascript" src="backend/js/Topic.js"></script>
|
||||
|
||||
<audio id="audio" src="audio/beep-04.mp3" autostart="false" ></audio>
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<script>
|
||||
|
||||
26
launch.bash
26
launch.bash
@@ -1,26 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
kill_child_processes() {
|
||||
isTopmost=$1
|
||||
curPid=$2
|
||||
childPids=`ps -o pid --no-headers --ppid ${curPid}`
|
||||
for childPid in $childPids
|
||||
do
|
||||
kill_child_processes 0 $childPid
|
||||
done
|
||||
if [ $isTopmost -eq 0 ]; then
|
||||
kill -9 $curPid 2> /dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
# Ctrl-C trap. Catches INT signal
|
||||
trap "kill_child_processes 1 $$; exit 0" INT
|
||||
|
||||
chmod a+x src/bagger.py
|
||||
|
||||
x-terminal-emulator -e "roslaunch aescape_lab_ui all.launch" &
|
||||
x-terminal-emulator -e "python -m SimpleHTTPServer 8000" &
|
||||
x-terminal-emulator -e "rosrun web_video_server web_video_server"
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<launch>
|
||||
<include file="$(find rosbridge_server)/launch/rosbridge_websocket.launch" />
|
||||
<include file="$(find aescape_lab_ui)/launch/bagger.launch" />
|
||||
<include file="$(find aescape_lab_ui)/launch/talker.launch" />
|
||||
</launch>
|
||||
@@ -1,3 +0,0 @@
|
||||
<launch>
|
||||
<node name="bagger" pkg="aescape_lab_ui" type="bagger.py" />
|
||||
</launch>
|
||||
5
launch/lab_ui.launch
Executable file
5
launch/lab_ui.launch
Executable file
@@ -0,0 +1,5 @@
|
||||
<launch>
|
||||
<include file="$(find rosbridge_server)/launch/rosbridge_websocket.launch" />
|
||||
|
||||
<node name="lab_ui_webserver" pkg="aescape_lab_ui" type="webserver.sh" respawn="true" />
|
||||
</launch>
|
||||
@@ -1,3 +0,0 @@
|
||||
<launch>
|
||||
<node name="talker" pkg="aescape_lab_ui" type="talker.py" />
|
||||
</launch>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 60 KiB |
4
scripts/webserver.sh
Executable file
4
scripts/webserver.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cd $(rospack find aescape_lab_ui)
|
||||
python3 -m http.server --bind titan.local
|
||||
@@ -1,49 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
import rospy
|
||||
from std_msgs.msg import String
|
||||
import rospkg
|
||||
import subprocess
|
||||
import os
|
||||
import signal
|
||||
|
||||
class Bagger(object):
|
||||
|
||||
def __init__(self):
|
||||
rospy.init_node("bagger", anonymous=True)
|
||||
rospy.Subscriber("bag_publisher", String, self.callback)
|
||||
self.pub = rospy.Publisher("bag_notifier", String, queue_size=10)
|
||||
self.proc = None
|
||||
rospack = rospkg.RosPack()
|
||||
self.data_path = os.path.join(rospack.get_path("aescape_lab_ui"), "data")
|
||||
|
||||
def callback(self, msg):
|
||||
if msg.data == "STOP" and self.proc is not None:
|
||||
os.killpg(self.proc.pid, signal.SIGINT)
|
||||
self.pub.publish("STOPPED")
|
||||
else:
|
||||
msg_data = msg.data.split()
|
||||
self.pub.publish(str(len(msg_data)))
|
||||
self.pub.publish(str(msg_data))
|
||||
if len(msg_data) == 0: # We only got the name of the bag file and not any topics
|
||||
bag_file_name = os.path.join(self.data_path, "bag_file")
|
||||
self.proc = subprocess.Popen(["rosbag", "record",
|
||||
"--all", "-o", bag_file_name], preexec_fn=os.setsid)
|
||||
self.pub.publish("STARTED")
|
||||
elif len(msg_data) == 1: # We only got the name of the bag file and not any topics
|
||||
bag_file_name = os.path.join(self.data_path, msg_data)
|
||||
self.proc = subprocess.Popen(["rosbag", "record",
|
||||
"--all", "-o", bag_file_name], preexec_fn=os.setsid)
|
||||
self.pub.publish("STARTED")
|
||||
else: #we posibly have a bag file name and a list of topics
|
||||
if msg_data[0].startswith("/"): #then we know there is no bag file name
|
||||
msg_data = ["bagfile"] + msg_data
|
||||
msg_data[0] = os.path.join(self.data_path, msg_data[0])
|
||||
processList = ["rosbag", "record", "-o"] + msg_data
|
||||
self.pub.publish(" ".join(processList))
|
||||
self.proc = subprocess.Popen( processList, preexec_fn=os.setsid)
|
||||
self.pub.publish("STARTED")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
Bagger()
|
||||
rospy.spin()
|
||||
@@ -1,20 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# license removed for brevity
|
||||
import rospy
|
||||
from std_msgs.msg import String
|
||||
|
||||
def talker():
|
||||
pub = rospy.Publisher('chatter', String, queue_size=10)
|
||||
rospy.init_node('talker', anonymous=True)
|
||||
rate = rospy.Rate(10) # 10hz
|
||||
while not rospy.is_shutdown():
|
||||
hello_str = "hello world %s" % rospy.get_time()
|
||||
rospy.loginfo(hello_str)
|
||||
pub.publish(hello_str)
|
||||
rate.sleep()
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
talker()
|
||||
except rospy.ROSInterruptException:
|
||||
pass
|
||||
Reference in New Issue
Block a user