Node

class rclpy.node.Node(node_name, *, context=None, cli_args=None, namespace=None, use_global_arguments=True, start_parameter_services=True, initial_parameters=None)
add_waitable(waitable)

Add a class which itself is capable of add things to the wait set.

context
count_publishers(topic_name)

Return the number of publishers on a given topic.

topic_name may be a relative, private, or fully qualifed topic name. A relative or private topic is expanded using this node’s namespace and name. The queried topic name is not remapped.

Parameters:topic_name (str) – the topic_name on which to count the number of publishers.
Returns:the number of publishers on the topic.
count_subscribers(topic_name)

Return the number of subscribers on a given topic.

topic_name may be a relative, private, or fully qualifed topic name. A relative or private topic is expanded using this node’s namespace and name. The queried topic name is not remapped.

Parameters:topic_name (str) – the topic_name on which to count the number of subscribers.
Returns:the number of subscribers on the topic.
create_client(srv_type, srv_name, *, qos_profile=<rclpy.qos.QoSProfile object>, callback_group=None)
create_guard_condition(callback, callback_group=None)
create_publisher(msg_type, topic, *, qos_profile=<rclpy.qos.QoSProfile object>)
create_service(srv_type, srv_name, callback, *, qos_profile=<rclpy.qos.QoSProfile object>, callback_group=None)
create_subscription(msg_type, topic, callback, *, qos_profile=<rclpy.qos.QoSProfile object>, callback_group=None, raw=False)
create_timer(timer_period_sec, callback, callback_group=None)
default_callback_group
destroy_client(client)
destroy_guard_condition(guard)
destroy_node()
destroy_publisher(publisher)
destroy_service(service)
destroy_subscription(subscription)
destroy_timer(timer)
executor

Get the executor if the node has been added to one, else return None.

get_clock()
get_logger()
get_name()
get_namespace()
get_node_names()
get_node_names_and_namespaces()
get_parameter(name)
get_parameters(names)
get_publisher_names_and_types_by_node(node_name, node_namespace, no_demangle=False)
get_service_names_and_types()
get_service_names_and_types_by_node(node_name, node_namespace)
get_subscriber_names_and_types_by_node(node_name, node_namespace, no_demangle=False)
get_topic_names_and_types(no_demangle=False)
handle
remove_waitable(waitable)

Remove a class which itself is capable of add things to the wait set.

set_parameters(parameter_list)
set_parameters_atomically(parameter_list)
set_parameters_callback(callback)