Crate ros2_client
source ·Expand description
ROS2 interface using DDS module
Examples
use rustdds::*;
use ros2_client::*;
use ros2_client::node_entities_info::NodeEntitiesInfo;
let mut ros_context = Context::new().unwrap();
let mut ros_node = ros_context.new_node(
"some_node_name",
"/some_namespace",
NodeOptions::new().enable_rosout(true),
).unwrap();
let some_topic = ros_node.create_topic(
"some_topic_name",
"NodeEntitiesInfo".to_string(),
&QosPolicies::builder().build() )
.unwrap();
// declaring some writer that use non keyed types
let some_writer = ros_node
.create_publisher::<NodeEntitiesInfo>(&some_topic, None)
.unwrap();
// Publisher and subscription implement [`mio::Evented`], so thay can be polled.
Modules
- Some builtin interfaces for ROS2 communication
- Some builtin datatypes needed for ROS2 communication Some convenience topic infos for ROS2 communication
- Module for stuff we do not want to export from top level;
Structs
- AService is a means of constructing a descriptor for a Service on the fly. This allows generic code to construct a Service from the types of request and response.
- Client end of a ROS2 Service
- Context communicates with other participants information in ROS2 network. It keeps track of
NodeEntitiesInfo
s. Also acts as a wrapper for a RustDDS instance. - Node in ROS2 network. Holds necessary readers and writers for rosout and parameter events topics internally.
- Configuration of Node This is a builder-like struct.
- A ROS2 Publisher
- Server end of a ROS2 Service
- A ROS2 Subscription
Enums
- Enumerate supported service mappings
Statics
Traits
- Trait to ensure Messages can be (de)serialized
- Service trait pairs the Request and Response types together. Additonally, it ensures that Response and Request are Messages (serializable) and we have a means to name the types.