Skip to content

Commit a852d91

Browse files
solve CI build issue
1 parent 2156de3 commit a852d91

File tree

5 files changed

+29
-15
lines changed

5 files changed

+29
-15
lines changed

examples/rust/cycle-benchmark/src/activities.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ impl Activity for DummyActivity {
4040
}
4141

4242
#[instrument(name = "Activity startup")]
43-
fn startup(&mut self) {}
43+
fn startup(&mut self) -> Result<(), ActivityError> {
44+
Ok(())
45+
}
4446

4547
#[instrument(name = "Activity step")]
4648
fn step(&mut self) -> Result<(), ActivityError> {

examples/rust/cycle-benchmark/src/composites.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@ impl Activity for CompositeActivity {
4949
}
5050

5151
#[instrument(name = "Composite startup")]
52-
fn startup(&mut self) {
52+
fn startup(&mut self) -> Result<(), ActivityError> {
5353
for activity in &mut self.activities {
54-
activity.startup();
54+
activity.startup()?;
5555
}
56+
Ok(())
5657
}
5758

5859
#[instrument(name = "Composite step")]

examples/rust/mini-adas/src/activities/components.rs

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ impl Activity for Camera {
8282
}
8383

8484
#[instrument(name = "Camera startup")]
85-
fn startup(&mut self) {}
85+
fn startup(&mut self) -> Result<(), ActivityError> {
86+
Ok(())
87+
}
8688

8789
#[instrument(name = "Camera")]
8890
fn step(&mut self) -> Result<(), ActivityError> {
@@ -149,7 +151,9 @@ impl Activity for Radar {
149151
}
150152

151153
#[instrument(name = "Radar startup")]
152-
fn startup(&mut self) {}
154+
fn startup(&mut self) -> Result<(), ActivityError> {
155+
Ok(())
156+
}
153157

154158
#[instrument(name = "Radar")]
155159
fn step(&mut self) -> Result<(), ActivityError> {
@@ -236,7 +240,9 @@ impl Activity for NeuralNet {
236240
}
237241

238242
#[instrument(name = "NeuralNet startup")]
239-
fn startup(&mut self) {}
243+
fn startup(&mut self) -> Result<(), ActivityError> {
244+
Ok(())
245+
}
240246

241247
#[instrument(name = "NeuralNet")]
242248
fn step(&mut self) -> Result<(), ActivityError> {
@@ -302,7 +308,9 @@ impl Activity for EmergencyBraking {
302308
}
303309

304310
#[instrument(name = "EmergencyBraking startup")]
305-
fn startup(&mut self) {}
311+
fn startup(&mut self) -> Result<(), ActivityError> {
312+
Ok(())
313+
}
306314

307315
#[instrument(name = "EmergencyBraking")]
308316
fn step(&mut self) -> Result<(), ActivityError> {
@@ -379,7 +387,9 @@ impl Activity for BrakeController {
379387
}
380388

381389
#[instrument(name = "BrakeController startup")]
382-
fn startup(&mut self) {}
390+
fn startup(&mut self) -> Result<(), ActivityError> {
391+
Ok(())
392+
}
383393

384394
#[instrument(name = "BrakeController")]
385395
fn step(&mut self) -> Result<(), ActivityError> {
@@ -435,7 +445,9 @@ impl Activity for EnvironmentRenderer {
435445
}
436446

437447
#[instrument(name = "EnvironmentRenderer startup")]
438-
fn startup(&mut self) {}
448+
fn startup(&mut self) -> Result<(), ActivityError> {
449+
Ok(())
450+
}
439451

440452
#[instrument(name = "EnvironmentRenderer")]
441453
fn step(&mut self) -> Result<(), ActivityError> {
@@ -487,7 +499,9 @@ impl Activity for SteeringController {
487499
}
488500

489501
#[instrument(name = "SteeringController startup")]
490-
fn startup(&mut self) {}
502+
fn startup(&mut self) -> Result<(), ActivityError> {
503+
Ok(())
504+
}
491505

492506
#[instrument(name = "SteeringController")]
493507
fn step(&mut self) -> Result<(), ActivityError> {

feo/src/cpp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ macro_rules! cpp_activity {
8686
}
8787

8888
#[instrument(name = "startup")]
89-
fn startup(&mut self) -> Result<(), ActivityError>{
89+
fn startup(&mut self) -> Result<(), ActivityError> {
9090
// Safety: Call of external C functions belonging to C++ activitiy, to be reviewed
9191
unsafe { make_fn_call!($name, _startup, (self.cpp_activity)) };
9292
Ok(())

feo/src/scheduler.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,7 @@ impl Scheduler {
135135
if let Err(err) = self.wait_next_ready() {
136136
// An error here, such as ActivityFailed or a timeout, constitutes a startup failure.
137137
// Log the specific error, but pass a generic reason to shutdown_gracefully
138-
error!(
139-
"A failure occurred during startup: {:?}. Aborting.",
140-
err
141-
);
138+
error!("A failure occurred during startup: {:?}. Aborting.", err);
142139
self.shutdown_gracefully("Startup failed due to an activity error.");
143140
return;
144141
}

0 commit comments

Comments
 (0)