Crates.io | coppeliasim_zmq_remote_api |
lib.rs | coppeliasim_zmq_remote_api |
version | 4.8.0 |
source | src |
created_at | 2023-10-20 18:21:17.219118 |
updated_at | 2024-12-04 17:42:45.051496 |
description | A ZMQ Client for CoppeliaSim |
homepage | |
repository | https://github.com/samuel-cavalcanti/rust_zmqRemoteApi.git |
max_upload_size | |
id | 1009277 |
size | 1,385,760 |
A Rust ZeroMQ remote API for coppeliasim
to run tests
cargo test
to run an example: make sure to open the correct coppeliasim scene and run the cargo command:
cargo run --example=simple_test
Perhaps you want to see the zmq communication logs. There are two logs levels:
export RUST_LOG="trace"; cargo run --example=simple_test
The RemoteAPIObjects.h has 3750 lines of code, so to port all the functions, I created a kind of c_transpiler.
At moment the only difference encountered is in
std::vector<uint8_t> getStringSignal(std::string signalName);
in rust the function returns a std::String. I haven't observed any examples where the function returns a block of bytes.
// Rust function assing
get_string_signal(signal_name:String)->String
create a new rust project:
cargo new new_project
you can add this crate at your cargo.toml using git:
# the branch is the coppelia version
zmq_remote_api = { git = "https://github.com/samuel-cavalcanti/rust_zmqRemoteApi", branch = "CoppeliaSim_4.8.0"}
See a simple example to understand how to use this crate.