Compare commits
14 Commits
888ed4db9d
...
station2-c
| Author | SHA1 | Date | |
|---|---|---|---|
| b75e4b270b | |||
| a054e368cb | |||
| db1a261012 | |||
| 7b318831f2 | |||
| 48c532a81c | |||
| c302674958 | |||
| c2df56e15e | |||
| 93fd03e717 | |||
| 3682fc1448 | |||
| f67379f85d | |||
| ac4ff7a657 | |||
| e94f342739 | |||
| e421634432 | |||
| fba81ef345 |
BIN
CAD/StationA_CAD/StationA_Stack_Base.FCStd
Normal file
BIN
CAD/StationA_CAD/StationA_Stack_Base.FCStd
Normal file
Binary file not shown.
@@ -1,31 +0,0 @@
|
||||
import time
|
||||
import logging
|
||||
import verboselogs
|
||||
import coloredlogs
|
||||
|
||||
verboselogs.install()
|
||||
|
||||
# Create a logger object.
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# By default the install() function installs a handler on the root logger,
|
||||
# this means that log messages from your code and log messages from the
|
||||
# libraries that you use will all show up on the terminal.
|
||||
#coloredlogs.install(level='DEBUG')
|
||||
|
||||
|
||||
# If you don't want to see log messages from libraries, you can pass a
|
||||
# specific logger object to the install() function. In this case only log
|
||||
# messages originating from that logger will show up on the terminal.
|
||||
coloredlogs.install(level='INFO', logger=logger)
|
||||
|
||||
logger.info('Lewis Companion Software Started.')
|
||||
logger.success('Ready to robot!')
|
||||
|
||||
# Junk~
|
||||
while True:
|
||||
try:
|
||||
logger.debug('Nothing to do.')
|
||||
time.sleep(1)
|
||||
except KeyboardInterrupt:
|
||||
break
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd /opt/lewis-crawler/companion_software/dashboard
|
||||
|
||||
pipenv install -r requirements.txt
|
||||
|
||||
pipenv run python dash.py
|
||||
9
companion_software/entrypoint.sh
Executable file
9
companion_software/entrypoint.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd /opt/lewis-crawler/companion_software
|
||||
|
||||
git pull
|
||||
|
||||
pipenv install -r requirements.txt
|
||||
|
||||
pipenv run python -m houston -v
|
||||
43
companion_software/houston/__main__.py
Normal file
43
companion_software/houston/__main__.py
Normal file
@@ -0,0 +1,43 @@
|
||||
# Lewis Crawler
|
||||
# 2021 - 2022
|
||||
# Kitsune Scientific
|
||||
|
||||
import logging
|
||||
import argparse
|
||||
import verboselogs
|
||||
import coloredlogs
|
||||
|
||||
from houston.houston import Houston
|
||||
|
||||
|
||||
# Get debug args
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
'-d', '--debug',
|
||||
help="Print lots of debugging statements",
|
||||
action="store_const", dest="loglevel", const='DEBUG',
|
||||
default='WARNING',
|
||||
)
|
||||
parser.add_argument(
|
||||
'-v', '--verbose',
|
||||
help="Be verbose",
|
||||
action="store_const", dest="loglevel", const='INFO',
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
# Install verbose logs
|
||||
verboselogs.install()
|
||||
|
||||
# Create a logger object.
|
||||
logger = logging.getLogger('Houston_Log')
|
||||
|
||||
# Install colored logs
|
||||
coloredlogs.install(level=args.loglevel,
|
||||
logger=logger,
|
||||
fmt='%(asctime)s,%(msecs)03d %(hostname)s %(levelname)s %(message)s') # noqa: E501
|
||||
|
||||
logger.info('Lewis Companion Software Started.')
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = Houston(logger)
|
||||
app.run()
|
||||
30
companion_software/houston/houston.py
Normal file
30
companion_software/houston/houston.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# Lewis Crawler
|
||||
# 2021 - 2022
|
||||
# Kitsune Scientific
|
||||
|
||||
import time
|
||||
|
||||
from houston.robotstreamer.streamer import RobotStreamer
|
||||
|
||||
|
||||
class Houston:
|
||||
def __init__(self, logger):
|
||||
# Setup logger
|
||||
self.log = logger
|
||||
|
||||
# Setup robotstreamer
|
||||
self.rs = RobotStreamer(self.log)
|
||||
|
||||
# We're ready to go!
|
||||
self.log.success('Ready to robot!')
|
||||
|
||||
def run(self):
|
||||
self.rs.run()
|
||||
|
||||
# Junk~
|
||||
while True:
|
||||
try:
|
||||
self.log.debug('Nothing to do.')
|
||||
time.sleep(1)
|
||||
except KeyboardInterrupt:
|
||||
break
|
||||
3
companion_software/houston/robotstreamer/__init__.py
Normal file
3
companion_software/houston/robotstreamer/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# Lewis Crawler
|
||||
# 2021 - 2022
|
||||
# Kitsune Scientific
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 59 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 59 KiB |
@@ -0,0 +1 @@
|
||||
ffmpeg -f image2 -loop 1 -framerate 25 -video_size 1280x720 -r 25 -i Test-Pattern.jpg -vcodec libx264 -profile:v main -preset:v medium -r 30 -g 60 -keyint_min 60 -sc_threshold 0 -b:v 2500k -maxrate 2500k -bufsize 2500k -sws_flags lanczos+accurate_rnd -acodec aac -b:a 96k -ar 48000 -ac 2 -f flv -maxrate 55k "rtmp://rtmp.robotstreamer.com/live/4619?key=jEquBubjizYDMQNe8nKjLdu88iqFpNe3sVQmGRJ2tzbxd4QJrkSSEZBQhi9UTL3k"
|
||||
30
companion_software/houston/robotstreamer/streamer.py
Normal file
30
companion_software/houston/robotstreamer/streamer.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# Lewis Crawler
|
||||
# 2021 - 2022
|
||||
# Kitsune Scientific
|
||||
|
||||
import ffmpeg
|
||||
|
||||
|
||||
class RobotStreamer:
|
||||
def __init__(self, logger):
|
||||
self.log = logger
|
||||
|
||||
def run(self):
|
||||
self.log.debug('Running RobotStreamer')
|
||||
|
||||
stream = ffmpeg.input(
|
||||
'houston/robotstreamer/resources/Test-Pattern.jpg',
|
||||
f='image2',
|
||||
loop='1',
|
||||
framerate=25,
|
||||
video_size='1280x720')
|
||||
|
||||
stream = ffmpeg.output(
|
||||
stream,
|
||||
'http://robotstreamer.com/<secret>/1280/720',
|
||||
f='mpegts',
|
||||
bf=0,
|
||||
muxdelay=0.001,
|
||||
codec='mpeg1video')
|
||||
|
||||
ffmpeg.run(stream)
|
||||
@@ -1,2 +1,3 @@
|
||||
coloredlogs
|
||||
verboselogs
|
||||
ffmpeg-python
|
||||
Reference in New Issue
Block a user