You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

run.rs 928 B

1234567891011121314151617181920212223242526272829303132333435
  1. use eyre::{bail, Context};
  2. use std::{env, path::Path};
  3. #[tokio::main]
  4. async fn main() -> eyre::Result<()> {
  5. let root = Path::new(env!("CARGO_MANIFEST_DIR"));
  6. std::env::set_current_dir(root.join(file!()).parent().unwrap())
  7. .wrap_err("failed to set working dir")?;
  8. build_package("dora-runtime").await?;
  9. run(root).await?;
  10. Ok(())
  11. }
  12. async fn build_package(package: &str) -> eyre::Result<()> {
  13. let cargo = std::env::var("CARGO").unwrap();
  14. let mut cmd = tokio::process::Command::new(&cargo);
  15. cmd.arg("build");
  16. cmd.arg("--package").arg(package);
  17. if !cmd.status().await?.success() {
  18. bail!("failed to build {package}");
  19. };
  20. Ok(())
  21. }
  22. async fn run(_root: &Path) -> eyre::Result<()> {
  23. let mut run = tokio::process::Command::new("sh");
  24. run.arg("./run.sh");
  25. if !run.status().await?.success() {
  26. bail!("failed to run python example.");
  27. };
  28. Ok(())
  29. }

DORA (Dataflow-Oriented Robotic Architecture) is middleware designed to streamline and simplify the creation of AI-based robotic applications. It offers low latency, composable, and distributed datafl