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 they can be polled.

Modules

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 NodeEntitiesInfos. 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

  • There are different and incompatible ways to map Services onto DDS Topics. The mapping used by ROS2 depends on the DDS implementation used and its configuration. For details, see OMG Specification RPC over DDS Section “7.2.4 Basic and Enhanced Service Mapping for RPC over DDS” RPC over DDS“ . which defines Service Mappings “Basic” and “Enhanced” ServiceMapping::Cyclone represents a third mapping used by RMW for CycloneDDS.

Statics

Traits

  • Trait to ensure Messages can be (de)serialized
  • Service trait pairs the Request and Response types together. Additionally, it ensures that Response and Request are Messages (Serializable), and we have a means to name the types.