Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
motii8128 authored Mar 26, 2024
1 parent d99c9f5 commit 068fdc8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 24 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ edition = "2021"
async-std = "1.0"
zenoh = "0.7.0-rc"

keyboard_publisher = {git = "https://github.com/PureRustRobot/keyboard_publisher.git"}
joy_publisher = {git = "https://github.com/PureRustRobot/joy_publisher"}
command_controller = {git = "https://github.com/PureRustRobot/command_controller.git"}
motor_controller = {git = "https://github.com/PureRustRobot/motor_controller"}
serial_transporter = {git = "https://github.com/PureRustRobot/serial_transporter"}
udp_bridge = {git = "https://github.com/PureRustRobot/udp_bridge"}
39 changes: 17 additions & 22 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,36 +1,31 @@
use async_std;
use zenoh::Error;

use keyboard_publisher::wasd_controller;
use joy_publisher::joy_publisher;
use command_controller::gamecon_to_cmd_vel;
use motor_controller::cmd_vel_to_wheel;
use serial_transporter::serial_transporter;
use udp_bridge::wheel_bridge;

#[async_std::main]
async fn main()->Result<(), Error>
{
let key_task = async_std::task::spawn(wasd_controller(
"keyboard_publisher",
"cmd_vel",
1.0)
);
let controller_task = async_std::task::spawn(joy_publisher("joy_publisher", "game_con", "ble"));

let wheel_task = async_std::task::spawn(cmd_vel_to_wheel(
"cmd_to_wheel",
"cmd_vel",
"cmd/wheel",
1.0)
);
let cmd_convert_task = async_std::task::spawn(gamecon_to_cmd_vel("gamecon_to_cmd_vel", "game_con", "cmd_vel/wheel", false));

let serial_task = async_std::task::spawn(serial_transporter(
"wheel_serial",
"cmd/wheel",
"/dev/ttyACM0",
115200)
);
let cmd_to_wheel = async_std::task::spawn(cmd_vel_to_wheel("cmd_vel_to_wheel", "cmd_vel/wheel", "motor/wheel", 1.0));

key_task.await?;
wheel_task.await?;
serial_task.await?;
let wheel_to_esp32 = async_std::task::spawn(wheel_bridge(
"to_esp32",
"motor/wheel",
"192.168.4.2:8080",
"192.168.4.1:10000",
false));

controller_task.await?;
cmd_convert_task.await?;
cmd_to_wheel.await?;
wheel_to_esp32.await?;

Ok(())
}

0 comments on commit 068fdc8

Please sign in to comment.