Skip to content

Commit ba242c0

Browse files
committed
Add files and instructions to install pose estimators as flowstate services
Signed-off-by: Yadunund <[email protected]>
1 parent 2f272e1 commit ba242c0

File tree

5 files changed

+767
-0
lines changed

5 files changed

+767
-0
lines changed

flowstate/services/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bpc_pose_estimator.tar
2+
bpc_pose_estimator.bundle.tar
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Use the bpc pose estimator image as the base image.
2+
ARG BASE_IMAGE=bpc_pose_estimator:example
3+
4+
FROM ${BASE_IMAGE}
5+
6+
# Copy the zenoh config file.
7+
# TODO(Yadunund): Switch to ZENOH_CONFIG_OVERRIDE after the next jazzy sync.
8+
COPY zenoh_config.json5 /opt/zenoh_config.json5
9+
10+
# Set environment variables
11+
ENV ZENOH_SESSION_CONFIG_URI=/opt/zenoh_config.json5
12+
ENV ZENOH_ROUTER_CHECK_ATTEMPTS=5
13+
# (Optional) If you need to override the entrypoint or command, do it here.
14+
# For example:
15+
# ENTRYPOINT ["/your/new/entrypoint.sh"]
16+
# CMD ["your", "new", "command"]

flowstate/services/README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
## Flowstate Service
2+
3+
The Pose Estimators developed can be run as a service on [Intrinsic Flowstate](https://www.intrinsic.ai/) solutions to build applications with robotic systems.
4+
5+
First, build another Docker image that wraps the pose estimator Docker image generated [previously](../README.md#build-and-test-custom-bpc_pose_estimator-image) with some environment variables to communicate with the Intrinsic Platform.
6+
7+
```bash
8+
# Replace POSE_ESTIMATOR_DOCKER_TAG with tag of the pose estimator image generated previously.
9+
# Replace "bpc_pose_estimator_fs:team_name" with a different tag if needed.
10+
cd ~/bpc_ws/bpc/flowstate
11+
docker buildx build -t bpc_pose_estimator_fs:team_name \
12+
--file Dockerfile.service \
13+
--build-arg BASE_IMAGE=<POSE_ESTIMATOR_DOCKER_TAG> \
14+
.
15+
16+
```
17+
18+
Next, save this Docker image locally. Note, the name of the output file must remain `bpc_pose_estimator.tar`.
19+
20+
```bash
21+
docker save bpc_pose_estimator_fs:example -o bpc_pose_estimator.tar
22+
23+
```
24+
25+
Then build a Flowstate Service bundle.
26+
27+
```bash
28+
cd ~/
29+
git clone https://github.com/intrinsic-ai/sdk.git
30+
cd sdk
31+
bazel run //intrinsic/tools/inbuild -- service bundle \
32+
--manifest ~/bpc_ws/src/bpc/services/flowstate/bpc_pose_estimator.manifest.textproto \
33+
--oci_image ~/bpc_ws/src/bpc/services/flowstate/bpc_pose_estimator.tar \
34+
--output ~/bpc_ws/src/bpc/services/flowstate/bpc_pose_estimator.bundle.tar
35+
```
36+
37+
Finally install the Service in a running solution.
38+
39+
```bash
40+
bazel run //intrinsic/tools/inctl -- service install ~/bpc_ws/src/bpc/services/flowstate/bpc_pose_estimator.bundle.tar \
41+
--cluster CLUSTER_ID \
42+
--org ORG \
43+
--registry REGISTRY \
44+
--skip_direct_upload
45+
```
46+
47+
To uninstall the Service,
48+
49+
```bash
50+
bazel run //intrinsic/tools/inctl -- service uninstall ai.intrinsic.bpc_pose_estimator \
51+
--solution SOLUTION_ID \
52+
--org ORG
53+
```
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
metadata {
2+
id {
3+
package: "ai.intrinsic"
4+
name: "bpc_pose_estimator"
5+
}
6+
vendor {
7+
display_name: "Intrinsic"
8+
}
9+
documentation {
10+
description: "A 6D pose estimator for objects in the BPC challenge."
11+
}
12+
display_name: "BPC Pose Estimator"
13+
}
14+
service_def {
15+
real_spec {
16+
image {
17+
archive_filename: "bpc_pose_estimator.tar"
18+
}
19+
}
20+
sim_spec {
21+
image {
22+
archive_filename: "bpc_pose_estimator.tar"
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)