Struct ros2_client::Node
source · [−]pub struct Node { /* private fields */ }
Expand description
Node in ROS2 network. Holds necessary readers and writers for rosout and parameter events topics internally.
These are produced by a Context
.
Implementations
sourceimpl Node
impl Node
pub fn remove_reader(&mut self, reader: &GUID)
pub fn remove_writer(&mut self, writer: &GUID)
sourcepub fn clear_node(&mut self)
pub fn clear_node(&mut self)
Clears both all reader and writer guids from this node.
pub fn name(&self) -> &str
pub fn namespace(&self) -> &str
pub fn fully_qualified_name(&self) -> String
pub fn options(&self) -> &NodeOptions
pub fn domain_id(&self) -> u16
sourcepub fn create_topic(
&self,
name: &str,
type_name: String,
qos: &QosPolicies
) -> Result<Topic, Error>
pub fn create_topic(
&self,
name: &str,
type_name: String,
qos: &QosPolicies
) -> Result<Topic, Error>
Creates ROS2 topic and handles necessary conversions from DDS to ROS2
Arguments
-
domain_participant
- DomainParticipant -
name
- Name of the topic -
type_name
- What type the topic holds in string form -
qos
- Quality of Service parameters for the topic (not restricted only to ROS2)summary of all rules for topic and service names in ROS 2 (as of Dec 2020)
-
must not be empty
-
may contain alphanumeric characters ([0-9|a-z|A-Z]), underscores (_), or forward slashes (/)
-
may use balanced curly braces ({}) for substitutions
-
may start with a tilde (~), the private namespace substitution character
-
must not start with a numeric character ([0-9])
-
must not end with a forward slash (/)
-
must not contain any number of repeated forward slashes (/)
-
must not contain any number of repeated underscores (_)
-
must separate a tilde (~) from the rest of the name with a forward slash (/), i.e. ~/foo not ~foo
-
must have balanced curly braces ({}) when used, i.e. {sub}/foo but not {sub/foo nor /foo}
sourcepub fn create_subscription<D: DeserializeOwned + 'static>(
&mut self,
topic: &Topic,
qos: Option<QosPolicies>
) -> Result<Subscription<D>, Error>
pub fn create_subscription<D: DeserializeOwned + 'static>(
&mut self,
topic: &Topic,
qos: Option<QosPolicies>
) -> Result<Subscription<D>, Error>
sourcepub fn create_publisher<D: Serialize>(
&mut self,
topic: &Topic,
qos: Option<QosPolicies>
) -> Result<Publisher<D>, Error>
pub fn create_publisher<D: Serialize>(
&mut self,
topic: &Topic,
qos: Option<QosPolicies>
) -> Result<Publisher<D>, Error>
sourcepub fn create_client<S>(
&mut self,
service_mapping: ServiceMappings,
service_name: &str,
request_qos: QosPolicies,
response_qos: QosPolicies
) -> Result<Client<S>, Error> where
S: Service + 'static,
S::Request: Clone,
pub fn create_client<S>(
&mut self,
service_mapping: ServiceMappings,
service_name: &str,
request_qos: QosPolicies,
response_qos: QosPolicies
) -> Result<Client<S>, Error> where
S: Service + 'static,
S::Request: Clone,
Creates ROS2 Service Client
Arguments
service_mapping
- ServiceMapping to be usedservice_name
-qos
-
sourcepub fn create_server<S>(
&mut self,
service_mapping: ServiceMappings,
service_name: &str,
request_qos: QosPolicies,
response_qos: QosPolicies
) -> Result<Server<S>, Error> where
S: Service + 'static,
S::Request: Clone,
pub fn create_server<S>(
&mut self,
service_mapping: ServiceMappings,
service_name: &str,
request_qos: QosPolicies,
response_qos: QosPolicies
) -> Result<Server<S>, Error> where
S: Service + 'static,
S::Request: Clone,
Creates ROS2 Service Server
Arguments
service_mapping
- ServiceMapping to be used. See [Self.create_client
].service_name
-qos
-
Auto Trait Implementations
impl !RefUnwindSafe for Node
impl Send for Node
impl !Sync for Node
impl Unpin for Node
impl !UnwindSafe for Node
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more