Skip to content

fbot-furg/vsss_client_rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fbot-vss

FIRASim Rust Client

Executando Exemplos

  • Seguidor de Bola: cargo run --example follow_ball

Instalando como dependência

Adicionar a dependência no arquivo Cargo.toml

[dependencies]
fbot_rust_client = { git = "https://github.com/vsssfbot/fbot_rust_client" }

Vamos escrever o seguinte código no arquivo src/main.js. O codigo a abaixo obtem os valores do robo amarelo de id 0, e as informações da bola

use fbot_rust_client::fira_protos;
use fbot_rust_client::{ball, yellow_robot};

fn main() {
    let robot = yellow_robot(&0).unwrap();
    let ball = ball();

    println!("Robot: {:?}", robot);
    println!("Ball{:?}", ball);
}

Enviando um commando para o FIRASim

fn main() {

    //...
    
    let commands = fira_protos::Commands {
        robot_commands: vec![
            fira_protos::Command {
                id: 0,
                yellowteam: true,
                wheel_left: 5.0,
                wheel_right: -5.0,
            },
        ]
    };

    fbot_rust_client::send_command(commands)
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages