Skip to content

Commit cbef3aa

Browse files
author
Andreu Gimenez Bolinches
committed
Merge branch 'main' into python-recorder
2 parents ac35214 + 9350d95 commit cbef3aa

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

localhost-vao-recorder.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,23 @@
33

44
import socket
55

6-
from flask import Flask
6+
from flask import Flask, request
77

88
app = Flask(__name__)
99

1010
app.secret_key = __name__
1111

12+
# Troubleshooting:
13+
# https://stackoverflow.com/questions/62705271/connect-to-flask-server-from-other-devices-on-same-network
14+
1215
# ! Workaround: Global variable because it is not JSON serializable and can't
1316
# ! be stored in Flask.session.
1417
recorder = Recorder(Config.from_yaml(), setup_name=False)
15-
print(yaml_dump(recorder.config))
16-
1718

1819
@app.route('/setup', methods=['GET'])
1920
def setup():
20-
# TODO get recording name from request
21-
recorder.setup()
21+
name = request.args.get('name', None)
22+
recorder.setup(name=name)
2223
return str(recorder.next_output.name)
2324

2425

recorder/device/realsense.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def __init__(self, *args, **kwargs):
1010
if not (streams := self.config.get('streams', [])):
1111
raise AttributeError('No `streams` found in device')
1212
assert 'serial_number' in self.config
13+
sn = self.config['serial_number']
1314
self.rsconfig = rs.config()
1415
self.rsconfig.enable_device(sn)
1516
for stream in streams.values():

0 commit comments

Comments
 (0)