Expand description
The conventions of ROS 2 on DDS, for rustorb-dds: what a DDS program needs to be seen by ROS 2 (Jazzy) as ROS 2 nodes, and to talk with them with types known only at run time.
names: ROS 2 names (topics, services, nodes, namespaces) checked and expanded, and their DDS names:rt/,rq/...Request,rr/...Reply,pkg::msg::dds_::Name_.msg: the.msgand.srvfiles parsed.TypeLibrary: interface types found on a search path (andAMENT_PREFIX_PATH), asMessageTypeandServiceType: the fields, the DDS type as aDynamicType, the description and the RIHS01 type hash of REP-2011 (type_description).Value: messages as trees of named fields, to and from DynamicData, checked against their types.QosProfile: the ROS 2 QoS profiles by name.UserData: thekey=value;entries ROS 2 puts in USER_DATA (typehash=RIHS01_...;).RosParticipantandNode: nodes announced onros_discovery_info, with publishers and subscriptions whose USER_DATA has the type hash; and the writer of a received sample (RosParticipant::writer_of).
ROS 2 is used as a black box: what it puts on DDS, seen with its tools
and in captures, and its documented conventions (REP-2011, the
design articles). No ROS 2 code is used or needed; the .msg files
are read where they are installed.
use rustorb_dds_ros2::{QosProfile, RosParticipant, TypeLibrary, UserData, Value};
let types = TypeLibrary::with_dirs(["msgs"]);
let string = types.message("std_msgs/msg/String")?;
let ros = RosParticipant::new(0)?;
let node = ros.create_node("/", "talker")?;
let publisher =
node.create_publisher("chatter", &string, &QosProfile::DEFAULT, &UserData::new())?;
publisher.publish(&Value::Struct(vec![(
"data".into(),
Value::String("Hello World".into()),
)]))?;Re-exports§
pub use library::MessageType;pub use library::ServiceType;pub use library::TypeLibrary;pub use node::Node;pub use node::RosParticipant;pub use node::RosPublisher;pub use node::RosSubscription;pub use qos::QosProfile;pub use type_description::TypeHash;pub use user_data::UserData;pub use value::Value;
Modules§
- library
- ROS 2 interface types found in
.msgand.srvfiles, with their DDS types (DynamicType), descriptions and RIHS01 hashes. - msg
- The ROS 2 interface definition languages
.msgand.srv, parsed. - names
- ROS 2 names and their DDS names.
- node
- ROS 2 nodes on a DDS participant, announced on
ros_discovery_info. - qos
- The QoS profiles of ROS 2 by name, as DDS QoS.
- type_
description - The description of a type that ROS 2 hashes (REP-2011, “Evolving
Message Types”), and its hash
RIHS01_<sha256>. - user_
data - The USER_DATA of ROS 2 participants, writers and readers: entries
key=value;, one after the other. - value
- Values of ROS 2 messages as a tree of named fields, to and from
DynamicData.
Enums§
- Error
- Errors of this crate.
Type Aliases§
- Result
- The result type of this crate.