Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ common --registry=https://bcr.bazel.build
# Build stamping for version info
build --workspace_status_command=$(pwd)/bazel_stamp_vars.sh

build:_common --@score_baselibs//score/mw/log/detail/flags:KUse_Stub_Implementation_Only=False
build:_common --@score_baselibs//score/mw/log/flags:KRemote_Logging=False
build:_common --@score_baselibs//score/json:base_library=nlohmann
build:_common --@score_baselibs//score/memory/shared/flags:use_typedshmd=False
Expand Down
9 changes: 8 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ bazel_dep(name = "rules_cc", version = "0.2.1")

# tooling
bazel_dep(name = "score_tooling", version = "1.0.5")
bazel_dep(name = "score_rust_policies", version = "0.0.3")
bazel_dep(name = "aspect_rules_lint", version = "1.5.3")
bazel_dep(name = "buildifier_prebuilt", version = "8.2.0.2")

Expand All @@ -75,6 +76,12 @@ bazel_dep(name = "score_baselibs", version = "0.1.3")
bazel_dep(name = "score_communication", version = "0.1.1")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "score_bazel_platforms", version = "0.0.2")
bazel_dep(name = "score_logging", version = "0.0.3")
git_override(
module_name = "score_logging",
commit = "9ed6a88cab10a81bf6b0813712cbd7b9fc7e44c5",
remote = "https://github.com/eclipse-score/logging.git",
)

# TRLC dependency for requirements traceability
bazel_dep(name = "trlc", version = "0.0.0")
Expand All @@ -87,7 +94,7 @@ git_override(
bazel_dep(name = "rules_go", version = "0.59.0")
bazel_dep(name = "gazelle", version = "0.42.0", repo_name = "bazel_gazelle")

go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk", dev_dependency = True)
go_sdk.download(
name = "go_sdk",
version = "1.23.5",
Expand Down
16 changes: 3 additions & 13 deletions feo/ad-demo/src/activities/application_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ pub fn agent_assignments() -> HashMap<AgentId, Vec<(WorkerId, Vec<ActivityIdAndB
let worker_40: WorkerAssignment = (
40.into(),
vec![
(
0.into(),
Box::new(|id| Camera::build(id, TOPIC_CAMERA_FRONT)),
),
(0.into(), Box::new(|id| Camera::build(id, TOPIC_CAMERA_FRONT))),
(
1.into(),
Box::new(|id| SceneRender::build(id, TOPIC_CAMERA_FRONT, TOPIC_INFERRED_SCENE)),
Expand All @@ -71,11 +68,7 @@ pub fn agent_assignments() -> HashMap<AgentId, Vec<(WorkerId, Vec<ActivityIdAndB
}

pub fn activity_dependencies() -> ActivityDependencies {
let dependencies = [
(0.into(), vec![]),
(1.into(), vec![0.into()]),
(2.into(), vec![]),
];
let dependencies = [(0.into(), vec![]), (1.into(), vec![0.into()]), (2.into(), vec![])];

dependencies.into()
}
Expand All @@ -84,10 +77,7 @@ pub fn topic_dependencies<'a>() -> Vec<TopicSpecification<'a>> {
use Direction::*;

vec![
TopicSpecification::new::<CameraImage>(
TOPIC_CAMERA_FRONT,
vec![(0.into(), Outgoing), (1.into(), Incoming)],
),
TopicSpecification::new::<CameraImage>(TOPIC_CAMERA_FRONT, vec![(0.into(), Outgoing), (1.into(), Incoming)]),
TopicSpecification::new::<Scene>(TOPIC_INFERRED_SCENE, vec![(1.into(), Outgoing)]),
]
}
Expand Down
18 changes: 7 additions & 11 deletions feo/ad-demo/src/activities/mcap_activity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,9 @@ impl Mcap {
}

pub fn build(activity_id: ActivityId) -> Box<dyn Activity> {
let mcap_to_map = Self::map_mcap("feo/ad-demo/src/assets/gps_route.mcap")
.expect("Could not open MCAP file");
let mcap_to_map = Self::map_mcap("feo/ad-demo/src/assets/gps_route.mcap").expect("Could not open MCAP file");
let static_slice: &'static [u8] = Box::leak(mcap_to_map.to_vec().into_boxed_slice());
let message_stream =
MessageStream::new(static_slice).expect("Failed to create MessageStream");
let message_stream = MessageStream::new(static_slice).expect("Failed to create MessageStream");
Box::new(Self {
activity_id,
message_stream,
Expand All @@ -62,21 +60,20 @@ impl Mcap {
fn get_single_msg(&mut self) -> Result<Option<Value>> {
match self.message_stream.next() {
Some(Ok(message)) => {
let data_json = serde_json::from_slice(&message.data)
.context("Failed to convert msg data as JSON")?;
let data_json = serde_json::from_slice(&message.data).context("Failed to convert msg data as JSON")?;

debug!("single mcap message data: {}", data_json);

Ok(Some(data_json))
}
},
Some(Err(e)) => {
debug!("Error reading MCAP message: {}", e);
Ok(None)
}
},
None => {
debug!("No more messages in MCAP file");
Ok(None)
}
},
}
}

Expand Down Expand Up @@ -112,8 +109,7 @@ impl Activity for Mcap {
debug!("Stepping Mcap");

if let Ok(Some(mcap_msg_json)) = self.get_single_msg() {
let compact_json =
serde_json::to_string(&mcap_msg_json).expect("failed to stringify Json");
let compact_json = serde_json::to_string(&mcap_msg_json).expect("failed to stringify Json");

debug!("Read Mcap message: {compact_json:?}");
self.send_tcp_msg(&compact_json);
Expand Down
6 changes: 1 addition & 5 deletions feo/ad-demo/src/activities/render_activity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ pub struct SceneRender {
}

impl SceneRender {
pub fn build(
activity_id: ActivityId,
image_topic: &str,
scene_topic: &str,
) -> Box<dyn Activity> {
pub fn build(activity_id: ActivityId, image_topic: &str, scene_topic: &str) -> Box<dyn Activity> {
Box::new(Self {
activity_id,
input_image: activity_input(image_topic),
Expand Down
4 changes: 2 additions & 2 deletions feo/ad-demo/src/agents/primary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ use feo_time::Duration;
use std::collections::HashMap;

use ad_demo::activities::application_config::{
activity_dependencies, agent_assignments, agent_assignments_ids, topic_dependencies,
worker_agent_map, BIND_ADDR, BIND_ADDR2, COM_BACKEND, MAX_ADDITIONAL_SUBSCRIBERS,
activity_dependencies, agent_assignments, agent_assignments_ids, topic_dependencies, worker_agent_map, BIND_ADDR,
BIND_ADDR2, COM_BACKEND, MAX_ADDITIONAL_SUBSCRIBERS,
};

const AGENT_ID: AgentId = AgentId::new(100);
Expand Down
6 changes: 2 additions & 4 deletions feo/ad-demo/src/agents/secondary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
// *******************************************************************************

use ad_demo::activities::application_config::{
agent_assignments, agent_assignments_ids, topic_dependencies, BIND_ADDR, BIND_ADDR2,
COM_BACKEND,
agent_assignments, agent_assignments_ids, topic_dependencies, BIND_ADDR, BIND_ADDR2, COM_BACKEND,
};
use core::time::Duration;
use feo::agent::com_init::initialize_com_secondary;
Expand Down Expand Up @@ -48,8 +47,7 @@ fn main() {
.collect();

// Initialize topics. Make it alive until application runs.
let _topic_guards =
initialize_com_secondary(COM_BACKEND, topic_dependencies(), &local_activities);
let _topic_guards = initialize_com_secondary(COM_BACKEND, topic_dependencies(), &local_activities);

info!("Starting secondary agent {}", secondary_agent_id);

Expand Down
4 changes: 2 additions & 2 deletions src/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ cc_binary(
":sample_sender_receiver",
"@boost.program_options",
"@score_baselibs//score/language/futurecpp",
"@score_baselibs//score/mw/log",
"@score_communication//score/mw/com",
"@score_logging//score/mw/log",
],
)

Expand All @@ -37,7 +37,7 @@ cc_library(
],
deps = [
":datatype",
"@score_baselibs//score/mw/log",
"@score_baselibs//score/mw/log:frontend",
"@score_communication//score/mw/com",
],
)
Expand Down
Loading