Skip to content

Commit

Permalink
Update events recorder (#304)
Browse files Browse the repository at this point in the history
* Update website example

* Update uri call
  • Loading branch information
guilhermedemouraa authored May 1, 2024
1 parent b03eaa2 commit f046017
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions website/docs/examples/events_recorder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ source venv/bin/activate
```

```bash
# assuming you're already in the amiga-dev-kit/ directory
# Assuming you're already in the amiga-dev-kit/ directory
cd farm-ng-amiga/py/examples/events_recorder
```

Expand All @@ -56,24 +56,24 @@ pip3 install -r requirements.txt

### 4. Code overview

In the provided example, we show how to implement the `/start` and `/stop`
In the provided example, we show how to implement the `recorder/start` and `recorder/stop`
requests to start and stop the recording of events. We also provide two example profiles
`record_camera_config.json` and `record_fiter_config.json` that can be used to record the
camera and filter events.

```python
async def start_recording(
service_config: EventServiceConfig, recording_profile: EventServiceConfigList
service_config: EventServiceConfig, recording_profile: EventServiceConfig
) -> None:
reply = await EventClient(service_config).request_reply(
"/start", recording_profile, decode=True
"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
"recorder/stop", Empty(), decode=True
)
print(reply)

Expand All @@ -93,14 +93,14 @@ if __name__ == "__main__":

args = parser.parse_args()

# create a client to the camera service
# Create a client to the Recorder service
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()
args.recording_profile, EventServiceConfig()
)
asyncio.run(start_recording(service_config, recording_profile))

Expand All @@ -127,7 +127,7 @@ python main.py --service-config service_config.json start_recording --recording-
You should see a similar output:

```bash
value: "/mnt/data/2023_09_28_10_24_07_212687_lead-mango"
string_value: "/mnt/data/2023_09_28_10_24_07_212687_lead-mango"
```

In order to stop the recording, run the following command:
Expand Down

0 comments on commit f046017

Please sign in to comment.