Browse Source

Fix stop in example nodes

tags/v0.3.12-rc0
haixuantao 7 months ago
parent
commit
d155ee789a
11 changed files with 16 additions and 13 deletions
  1. +1
    -1
      apis/c++/node/src/lib.rs
  2. +1
    -1
      examples/multiple-daemons/node/src/main.rs
  3. +2
    -2
      examples/multiple-daemons/sink/src/main.rs
  4. +1
    -1
      examples/rust-dataflow/node/src/main.rs
  5. +2
    -2
      examples/rust-dataflow/sink-dynamic/src/main.rs
  6. +2
    -2
      examples/rust-dataflow/sink/src/main.rs
  7. +1
    -1
      examples/rust-dataflow/status-node/src/main.rs
  8. +1
    -1
      examples/rust-ros2-dataflow/node/src/main.rs
  9. +2
    -0
      node-hub/dora-keyboard/dora_keyboard/main.py
  10. +1
    -0
      node-hub/dora-microphone/dora_microphone/main.py
  11. +2
    -2
      node-hub/dora-mistral-rs/src/main.rs

+ 1
- 1
apis/c++/node/src/lib.rs View File

@@ -144,7 +144,7 @@ pub struct DoraEvent(Option<Event>);
fn event_type(event: &DoraEvent) -> ffi::DoraEventType {
match &event.0 {
Some(event) => match event {
Event::Stop => ffi::DoraEventType::Stop,
Event::Stop(_) => ffi::DoraEventType::Stop,
Event::Input { .. } => ffi::DoraEventType::Input,
Event::InputClosed { .. } => ffi::DoraEventType::InputClosed,
Event::Error(_) => ffi::DoraEventType::Error,


+ 1
- 1
examples/multiple-daemons/node/src/main.rs View File

@@ -26,7 +26,7 @@ fn main() -> eyre::Result<()> {
}
other => eprintln!("Ignoring unexpected input `{other}`"),
},
Event::Stop => println!("Received manual stop"),
Event::Stop(_) => println!("Received stop"),
other => eprintln!("Received unexpected input: {other:?}"),
}
}


+ 2
- 2
examples/multiple-daemons/sink/src/main.rs View File

@@ -24,8 +24,8 @@ fn main() -> eyre::Result<()> {
}
other => eprintln!("Ignoring unexpected input `{other}`"),
},
Event::Stop => {
println!("Received manual stop");
Event::Stop(_) => {
println!("Received stop");
}
Event::InputClosed { id } => {
println!("Input `{id}` was closed");


+ 1
- 1
examples/rust-dataflow/node/src/main.rs View File

@@ -26,7 +26,7 @@ fn main() -> eyre::Result<()> {
}
other => eprintln!("Ignoring unexpected input `{other}`"),
},
Event::Stop => println!("Received manual stop"),
Event::Stop(_) => println!("Received stop"),
other => eprintln!("Received unexpected input: {other:?}"),
}
}


+ 2
- 2
examples/rust-dataflow/sink-dynamic/src/main.rs View File

@@ -25,8 +25,8 @@ fn main() -> eyre::Result<()> {
}
other => eprintln!("Ignoring unexpected input `{other}`"),
},
Event::Stop => {
println!("Received manual stop");
Event::Stop(_) => {
println!("Received stop");
}
Event::InputClosed { id } => {
println!("Input `{id}` was closed");


+ 2
- 2
examples/rust-dataflow/sink/src/main.rs View File

@@ -24,8 +24,8 @@ fn main() -> eyre::Result<()> {
}
other => eprintln!("Ignoring unexpected input `{other}`"),
},
Event::Stop => {
println!("Received manual stop");
Event::Stop(_) => {
println!("Received stop");
}
Event::InputClosed { id } => {
println!("Input `{id}` was closed");


+ 1
- 1
examples/rust-dataflow/status-node/src/main.rs View File

@@ -29,7 +29,7 @@ fn main() -> eyre::Result<()> {
}
other => eprintln!("ignoring unexpected input {other}"),
},
Event::Stop => {}
Event::Stop(_) => {}
Event::InputClosed { id } => {
println!("input `{id}` was closed");
if *id == "random" {


+ 1
- 1
examples/rust-ros2-dataflow/node/src/main.rs View File

@@ -119,7 +119,7 @@ fn main() -> eyre::Result<()> {
}
other => eprintln!("Ignoring unexpected input `{other}`"),
},
Event::Stop => println!("Received manual stop"),
Event::Stop(_) => println!("Received stop"),
other => eprintln!("Received unexpected input: {other:?}"),
},
MergedEvent::External(pose) => {


+ 2
- 0
node-hub/dora-keyboard/dora_keyboard/main.py View File

@@ -11,6 +11,8 @@ def main():
node = Node()

always_none = node.next(timeout=0.001) is None
always_none = node.next(timeout=0.001) is None
print("Always None:", always_none)
with keyboard.Events() as events:
while True:
if not always_none:


+ 1
- 0
node-hub/dora-microphone/dora_microphone/main.py View File

@@ -19,6 +19,7 @@ def main():
start_recording_time = tm.time()
node = Node()

always_none = node.next(timeout=0.001) is None
always_none = node.next(timeout=0.001) is None
finished = False



+ 2
- 2
node-hub/dora-mistral-rs/src/main.rs View File

@@ -46,8 +46,8 @@ async fn main() -> eyre::Result<()> {
}
other => eprintln!("Received input `{other}`"),
},
Event::Stop => {
println!("Received manual stop")
Event::Stop(_) => {
println!("Received command");
}
Event::InputClosed { id } => {
println!("input `{id}` was closed");


Loading…
Cancel
Save