openrr_apps_velocity_sender/
velocity_sender.rs1use std::path::PathBuf;
2
3use anyhow::Result;
4use clap::Parser;
5use openrr_apps::utils::init_tracing;
6use openrr_client::BoxRobotClient;
7use tracing::debug;
8
9#[derive(Parser, Debug)]
11#[clap(name = env!("CARGO_BIN_NAME"))]
12struct Opt {
13 #[clap(short, long, value_parser)]
15 config_path: Option<PathBuf>,
16 #[clap(long)]
19 config: Option<String>,
20}
21
22fn main() -> Result<()> {
23 init_tracing();
24 let opt = Opt::parse();
25 debug!("opt: {opt:?}");
26
27 let config_path = openrr_apps::utils::get_apps_robot_config(opt.config_path);
28 let config =
29 openrr_apps::utils::resolve_robot_config(config_path.as_deref(), opt.config.as_deref())?;
30
31 openrr_apps::utils::init(env!("CARGO_BIN_NAME"), &config);
32 let client: BoxRobotClient = config.create_robot_client()?;
33 openrr_gui::velocity_sender(client)?;
34 Ok(())
35}
36
37#[cfg(test)]
38mod tests {
39 use clap::CommandFactory;
40
41 use super::*;
42
43 #[test]
44 fn assert_app() {
45 Opt::command().debug_assert();
46 }
47}