Skip to content

Commit 09bad40

Browse files
authored
example application to demonstrate the use of FEO framework... (#23)
- an ad-demo application that runs 3 activities. - one of the activity sends a location message from an mcap, iteratively on every step of activity cycle. - a python script creates a foxglove server that forwards this mcap message to be visualized in Lichtblick. - Instructions for running the whole chain is available in the README files.
1 parent 0c3725e commit 09bad40

24 files changed

Lines changed: 1550 additions & 0 deletions

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
bazel-*
3939
MODULE.bazel.lock
4040
user.bazelrc
41+
external
4142

4243
# Ruff
4344
.ruff_cache
@@ -54,5 +55,12 @@ styles/
5455

5556
# Python
5657
.venv
58+
venv/*
5759
__pycache__/
5860
/.coverage
61+
62+
# Rust
63+
rust-project.json
64+
65+
# vscode
66+
.vscode/

BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ setup_starpls(
2626
copyright_checker(
2727
name = "copyright",
2828
srcs = [
29+
"feo/ad-demo",
2930
"scorex",
3031
"src",
3132
"tests",

MODULE.bazel

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,37 @@ use_repo(
123123
go_deps,
124124
"com_github_spf13_cobra",
125125
)
126+
127+
#### Following section for Feo framework examples ###
128+
bazel_dep(name = "score_crates", version = "0.0.6")
129+
130+
crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")
131+
crate.from_cargo(
132+
name = "ad-demo-local-crates",
133+
cargo_lockfile = "//feo/ad-demo:Cargo.lock",
134+
manifests = [
135+
"//feo/ad-demo:Cargo.toml",
136+
],
137+
)
138+
use_repo(crate, "ad-demo-local-crates")
139+
140+
# Override feo's dependency on score_docs_as_code to use 2.3.3
141+
single_version_override(
142+
module_name = "score_docs_as_code",
143+
version = "2.3.3",
144+
)
145+
146+
bazel_dep(name = "feo", version = "1.0.1")
147+
git_override(
148+
module_name = "feo",
149+
commit = "05702d0a386daf23912c26ccb2b35b584d3a9e8c",
150+
remote = "https://github.com/eclipse-score/feo.git",
151+
)
152+
153+
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
154+
pip.parse(
155+
hub_name = "lichtblick_com_pypi",
156+
python_version = "3.12",
157+
requirements_lock = "//feo/ad-demo/lichtblick-com:requirements_lock.txt",
158+
)
159+
use_repo(pip, "lichtblick_com_pypi")

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ QNX cross-compilation requires:
256256
Future extensions planned for SCRAMPLE:
257257

258258
- Additional S-CORE platform module demonstrations
259+
- [FEO demo application](feo/ad-demo/README.md)
259260
- More complex communication patterns
260261
- Performance benchmarking utilities
261262
- Integration with other S-CORE components

feo/ad-demo/BUILD.bazel

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
14+
load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library")
15+
16+
rust_library(
17+
name = "activities_lib",
18+
srcs = [
19+
"src/activities/application_config.rs",
20+
"src/activities/camera_activity.rs",
21+
"src/activities/common.rs",
22+
"src/activities/mcap_activity.rs",
23+
"src/activities/messages.rs",
24+
"src/activities/mod.rs",
25+
"src/activities/render_activity.rs",
26+
"src/lib.rs",
27+
],
28+
crate_features = [
29+
"com_iox2",
30+
"signalling_relayed_tcp",
31+
],
32+
crate_name = "ad_demo",
33+
data = ["src/assets/gps_route.mcap"],
34+
visibility = ["//visibility:public"],
35+
deps = [
36+
"@ad-demo-local-crates//:camino",
37+
"@ad-demo-local-crates//:mcap",
38+
"@ad-demo-local-crates//:memmap2",
39+
"@feo//feo:libfeo_rust",
40+
"@feo//feo-com:libfeo_com_rust",
41+
"@feo//feo-log:libfeo_log_rust",
42+
"@feo//feo-logger:libfeo_logger_rust",
43+
"@feo//feo-time:libfeo_time_rust",
44+
"@feo//feo-tracing:libfeo_tracing_rust",
45+
"@score_crates//:anyhow",
46+
"@score_crates//:postcard",
47+
"@score_crates//:rand",
48+
"@score_crates//:serde",
49+
"@score_crates//:serde_json",
50+
"@score_crates//:tracing",
51+
],
52+
)
53+
54+
rust_binary(
55+
name = "agent_primary",
56+
srcs = [
57+
"src/agents/primary.rs",
58+
],
59+
visibility = ["//visibility:public"],
60+
deps = [
61+
":activities_lib",
62+
"@feo//feo:libfeo_rust",
63+
"@feo//feo-log:libfeo_log_rust",
64+
"@feo//feo-logger:libfeo_logger_rust",
65+
"@feo//feo-time:libfeo_time_rust",
66+
"@feo//feo-tracing:libfeo_tracing_rust",
67+
],
68+
)
69+
70+
rust_binary(
71+
name = "agent_secondary",
72+
srcs = [
73+
"src/agents/secondary.rs",
74+
],
75+
visibility = ["//visibility:public"],
76+
deps = [
77+
":activities_lib",
78+
"@feo//feo:libfeo_rust",
79+
"@feo//feo-log:libfeo_log_rust",
80+
"@feo//feo-logger:libfeo_logger_rust",
81+
"@feo//feo-time:libfeo_time_rust",
82+
"@feo//feo-tracing:libfeo_tracing_rust",
83+
],
84+
)

0 commit comments

Comments
 (0)