#zmq #api-bindings #coppelia-sim

coppeliasim_zmq_remote_api

A ZMQ Client for CoppeliaSim

5 stable releases

new 4.9.0 Mar 14, 2025
4.8.0 Dec 4, 2024
4.7.0 Jun 22, 2024
4.6.1 Oct 20, 2023

#67 in Robotics

Download history 133/week @ 2024-12-01 16/week @ 2024-12-08 5/week @ 2024-12-15 1/week @ 2025-01-05 2/week @ 2025-01-12 18/week @ 2025-02-02 8/week @ 2025-02-09 9/week @ 2025-02-16 16/week @ 2025-02-23 3/week @ 2025-03-02 53/week @ 2025-03-09

82 downloads per month

Custom license

490KB
7.5K SLoC

Rust 5K SLoC // 0.0% comments Python 2.5K SLoC // 0.0% comments Shell 41 SLoC // 0.1% comments

example workflow

Rust zmqRemoteApi

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:

  • level 1: debug, debug level you will see the request in json format
  • level 2: trace, trace level you will see the request in json and bytes format
export RUST_LOG="trace"; cargo run --example=simple_test

Porting C++ client to Rust client

The RemoteAPIObjects.h has 3750 lines of code, so to port all the functions, I created a kind of c_transpiler.

diferences between C++ client and Rust client

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

Get started

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.9.0"}

See a simple example to understand how to use this crate.

Dependencies

~5–15MB
~182K SLoC