1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
//! 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 `.msg` and `.srv` files parsed.
//! - [`TypeLibrary`]: interface types found on a search path (and
//! `AMENT_PREFIX_PATH`), as [`MessageType`] and [`ServiceType`]: the
//! fields, the DDS type as a [`DynamicType`](rustorb_xtypes::dynamic::DynamicType),
//! 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`]: the `key=value;` entries ROS 2 puts in USER_DATA
//! (`typehash=RIHS01_...;`).
//! - [`RosParticipant`] and [`Node`]: nodes announced on
//! `ros_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.
//!
//! ```no_run
//! 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()),
//! )]))?;
//! # Ok::<(), rustorb_dds_ros2::Error>(())
//! ```
use fmt;
pub use ;
pub use ;
pub use QosProfile;
pub use TypeHash;
pub use UserData;
pub use Value;
/// Errors of this crate.
/// The result type of this crate.
pub type Result<T> = Result;