waxz / rs_robot

robot on rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rs_robot

There are libraries and applications for robot perception and control.

cpp bindings

Pallet detection application and Ros, Fastdds and pallet detection bindings have dependency on cpp_robot. cpp_robot needs to be compiled and installed first. Its install path is like /tmp/cpp-target/install/lib.

Modify clang_args, rustc-link-search , rustc-link-arg in nx_message_center/build.rs

fn main() {
    std::env::set_var("REBUILD", format!("{:?}", std::time::Instant::now()));
    println!("cargo:rerun-if-env-changed=REBUILD");
    let clang_args = ["-I/tmp/cpp-target/install/include"];

    println!("cargo:rustc-link-arg=-Wl,-rpath,$ORIGIN/../lib");
    println!("cargo:rustc-link-arg=-fuse-ld=gold");

    println!("cargo:rustc-link-search=native=/tmp/cpp-target/install/lib");
    println!("cargo:rustc-link-arg=-Wl,-rpath,/tmp/cpp-target/install/lib");
    println!("cargo:rustc-link-lib=ros_helper");
    println!("cargo:rustc-link-lib=dds_helper_shared");
    println!("cargo:rustc-link-lib=tinyalloc");
    println!("cargo:rustc-link-lib=tcc_builder");
    println!("cargo:rustc-link-lib=pointcloud_process");
}

and nx_app/build.rs .

fn main()
{
    std::env::set_var("REBUILD", format!("{:?}", std::time::Instant::now()));
    println!("cargo:rerun-if-env-changed=REBUILD");

    println!("cargo:rustc-link-arg=-Wl,-rpath,$ORIGIN/../lib");
    println!("cargo:rustc-link-arg=-fuse-ld=gold");

    println!("cargo:rustc-link-search=native=/tmp/cpp-target/install/lib");
    println!("cargo:rustc-link-arg=-Wl,-rpath,/tmp/cpp-target/install/lib");
}

usage

install application in nx_app

cargo install --path crates/nx_app  --offline  --root /tmp/cargo-target/install  --bins 

run pallet detection

A dds_ros_bridge in cpp_robot needed to be executed first to transform depth camera ros driver message to fastdds.

cd /tmp/cargo-target/install/bin 
./pallet_detector -d ./gui_config.toml -c

run motion control

/tmp/cargo-target/install/bin
./ros_motion_control_rerun -r ./comm_config.toml -m ./robot_config.toml

About

robot on rust

License:Apache License 2.0


Languages

Language:Rust 99.5%Language:WGSL 0.3%Language:CMake 0.1%Language:C 0.1%Language:C++ 0.0%