gz
This crate contains following crates and re-exports them.
- gz-msgs: Rust implementation of Gazebo Messages
- gz-transport: Rust wrapper of Gazebo Transport
Gazebo version
This crate is supporting following versions of Gazebo.
- Fortress
- Garden (EOL)
- Harmonic
- Ionic
Gazebo version can be specified by a feature flag (fortress, garden, harmonic or ionic). If not specified, the version is determined by using pkg-config. When multiple versions are installed, the newer version takes precedence. If you want to use an older version, set the feature flag as above.
[]
= { = "0.9.0", = ["harmonic"] }
Dependencies
- Gazebo
- gz-msgs
- gz-transport
- pkg-config
Examples
Example: Publish
use ;
let mut node = new.unwrap;
let mut publisher = node.advertise.unwrap;
let topic = StringMsg ;
assert!;
Example: Subscribe (callback)
use ;
let mut node = new.unwrap;
node.subscribe;
wait_for_shutdown;
Example: Subscribe (channel)
subscribe_channel also uses callbacks internally. However, subscribe_channel may be easier to use when ownership is involved.
use ;
let mut node = new.unwrap;
let rx = node..unwrap;
for msg in rx