diff --git a/py/examples/event_recorder/main.py b/py/examples/event_recorder/main.py index 6a998462..1e486837 100644 --- a/py/examples/event_recorder/main.py +++ b/py/examples/event_recorder/main.py @@ -18,18 +18,17 @@ from farm_ng.core.event_client import EventClient from farm_ng.core.event_service_pb2 import EventServiceConfig -from farm_ng.core.event_service_pb2 import EventServiceConfigList from farm_ng.core.events_file_reader import proto_from_json_file from google.protobuf.empty_pb2 import Empty -async def start_recording(service_config: EventServiceConfig, recording_profile: EventServiceConfigList) -> None: - reply = await EventClient(service_config).request_reply("start", recording_profile, decode=True) +async def start_recording(service_config: EventServiceConfig, recording_profile: EventServiceConfig) -> None: + reply = await EventClient(service_config).request_reply("recorder/start", recording_profile, decode=True) print(reply) async def stop_recording(service_config: EventServiceConfig) -> None: - reply = await EventClient(service_config).request_reply("/stop", Empty(), decode=True) + reply = await EventClient(service_config).request_reply("recorder/stop", Empty(), decode=True) print(reply) @@ -50,7 +49,7 @@ async def stop_recording(service_config: EventServiceConfig) -> None: service_config: EventServiceConfig = proto_from_json_file(args.service_config, EventServiceConfig()) if args.command == "start_recording": - recording_profile = proto_from_json_file(args.recording_profile, EventServiceConfigList()) + recording_profile = proto_from_json_file(args.recording_profile, EventServiceConfig()) asyncio.run(start_recording(service_config, recording_profile)) if args.command == "stop_recording": diff --git a/py/examples/event_recorder/record_camera_config.json b/py/examples/event_recorder/record_camera_config.json index 0d8d1cc1..27719b34 100644 --- a/py/examples/event_recorder/record_camera_config.json +++ b/py/examples/event_recorder/record_camera_config.json @@ -1,30 +1,26 @@ { - "configs": [ + "name": "record_default", + "subscriptions": [ { - "name": "record_default", - "subscriptions": [ - { - "uri": { - "path": "*", - "query": "service_name=gps" - }, - "every_n": 1 - }, - { - "uri": { - "path": "*", - "query": "service_name=oak0" - }, - "every_n": 1 - }, - { - "uri": { - "path": "*", - "query": "service_name=oak1" - }, - "every_n": 1 - } - ] + "uri": { + "path": "*", + "query": "service_name=gps" + }, + "every_n": 1 + }, + { + "uri": { + "path": "*", + "query": "service_name=oak/0" + }, + "every_n": 1 + }, + { + "uri": { + "path": "*", + "query": "service_name=oak/1" + }, + "every_n": 1 } ] } diff --git a/py/examples/event_recorder/record_filter_config.json b/py/examples/event_recorder/record_filter_config.json index b0502e17..7af10653 100644 --- a/py/examples/event_recorder/record_filter_config.json +++ b/py/examples/event_recorder/record_filter_config.json @@ -1,35 +1,33 @@ { - "config": { - "name": "record_default", - "subscriptions": [ - { - "uri": { - "path": "*", - "query": "service_name=canbus" - }, - "every_n": 1 - }, - { - "uri": { - "path": "*", - "query": "service_name=gps" - }, - "every_n": 1 - }, - { - "uri": { - "path": "/imu", - "query": "service_name=oak0" - }, - "every_n": 1 - }, - { - "uri": { - "path": "*", - "query": "service_name=filter" - }, - "every_n": 1 - } - ] - } + "name": "record_default", + "subscriptions": [ + { + "uri": { + "path": "*", + "query": "service_name=canbus" + }, + "every_n": 1 + }, + { + "uri": { + "path": "*", + "query": "service_name=gps" + }, + "every_n": 1 + }, + { + "uri": { + "path": "/imu", + "query": "service_name=oak/0" + }, + "every_n": 1 + }, + { + "uri": { + "path": "*", + "query": "service_name=filter" + }, + "every_n": 1 + } + ] } diff --git a/py/examples/event_recorder/service_config.json b/py/examples/event_recorder/service_config.json index 035a085c..1699fe52 100644 --- a/py/examples/event_recorder/service_config.json +++ b/py/examples/event_recorder/service_config.json @@ -1,9 +1,5 @@ { - "name": "recorder", - "port": 5000, - "host": "localhost", - "log_level": "INFO", - "args": [ - "--data-dir", "/mnt/data" - ] + "name": "amiga", + "port": 50010, + "host": "localhost" }