View Source Rclex.Node (Rclex v0.9.0)
Defines functions to assign job, subscribe or publish, to Node.
Summary
Functions
Returns a specification to start this module under a supervisor.
Create publisher.
Create multiple publishers
Create subscriber.
Create multiple subscribers.
Finish subscribe/publish job.
Finish subscribe/publish jobs.
Get topic names and types, return example is below
Get Node name.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec create_publisher( node_identifier :: charlist(), msg_type :: charlist(), topic_name :: charlist() ) :: {:ok, Rclex.Publisher.id_tuple()}
Create publisher.
Arguments
- node_identifier: node identifier
- msg_types: ex) 'StdMsgs.Msg.String'
- topic_name: topic name, ex) 'test'
create_publishers(node_identifier_list, msg_type, topic_name, type)
View Source@spec create_publishers( node_identifier_list :: [node_identifier :: charlist()], msg_type :: charlist(), topic_name :: charlist(), type :: :single | :multi ) :: {:ok, [Rclex.Publisher.id_tuple()]}
Create multiple publishers
Arguments
- node_identifier_list: node identifier list
- msg_types: ex) 'StdMsgs.Msg.String'
- topic_name: topic name, ex) 'test'
- type: :single or :multi
type: :single
Create multiple publishers to a single topic.
+------------+
| publisher +---------+
+------------+ |
|
+------------+ |
| publisher +---------+
+------------+ | +-------+
+-----+ topic |
+------------+ | +-------+
| publisher +---------+
+------------+ |
|
+------------+ |
| publisher +---------+
+------------+
type: :multi
Create one-to-one publishers for multiple topics.
+------------+ +-------+
| publisher +---------------+ topic |
+------------+ +-------+
+------------+ +-------+
| publisher +---------------+ topic |
+------------+ +-------+
+------------+ +-------+
| publisher +---------------+ topic |
+------------+ +-------+
+------------+ +-------+
| publisher +---------------+ topic |
+------------+ +-------+
@spec create_subscriber( node_identifier :: charlist(), msg_type :: charlist(), topic_name :: charlist() ) :: {:ok, Rclex.Subscriber.id_tuple()}
Create subscriber.
Arguments
- node_identifier: node identifier
- msg_types: ex) 'StdMsgs.Msg.String'
- topic_name: topic name, ex) 'test'
create_subscribers(node_identifier_list, msg_type, topic_name, type)
View Source@spec create_subscribers( [node_identifier :: charlist()], msg_type :: charlist(), topic_name :: charlist(), type :: :single | :multi ) :: {:ok, [Rclex.Subscriber.id_tuple()]}
Create multiple subscribers.
Arguments
- node_identifier_list: node identifier list
- msg_types: ex) 'StdMsgs.Msg.String'
- topic_name: topic name, ex) 'test'
- type: :single or :multi
type: :single
Create multiple subscribers to a single topic.
+------------+
+---------+ subscriber |
| +------------+
|
| +------------+
+---------+ subscriber |
+-------+ | +------------+
| topic +-----+
+-------+ | +------------+
+---------+ subscriber |
| +------------+
|
| +------------+
+---------+ subscriber |
+------------+
type: :multi
Create one-to-one subscribers for multiple topics.
+-------+ +------------+
| topic +---------------+ subscriber |
+-------+ +------------+
+-------+ +------------+
| topic +---------------+ subscriber |
+-------+ +------------+
+-------+ +------------+
| topic +---------------+ subscriber |
+-------+ +------------+
+-------+ +------------+
| topic +---------------+ subscriber |
+-------+ +------------+
@spec finish_job(Rclex.Publisher.id_tuple() | Rclex.Subscriber.id_tuple()) :: :ok
Finish subscribe/publish job.
@spec finish_jobs([Rclex.Publisher.id_tuple() | Rclex.Subscriber.id_tuple()]) :: list()
Finish subscribe/publish jobs.
get_topic_names_and_types(node_identifier, allocator, no_demangle)
View Source@spec get_topic_names_and_types( node_identifier :: charlist(), allocator :: Rclex.Nifs.rcl_allocator(), no_demangle :: boolean() ) :: [{charlist(), [charlist()]}]
Get topic names and types, return example is below
[{'/topic', ['std_msgs/msg/String']}]
Get Node name.