pycram.ros.ros2#

Submodules#

Attributes#

Exceptions#

ResourceNotFound

Common base class for all non-exit exceptions.

ServiceException

Common base class for all non-exit exceptions.

Classes#

Time

Class to abstract the ROS2 Time, to make it more consistent with the ROS1 Time class.

ServiceProxy

Functions#

to_sec(self)

Returns the time in seconds from a builtin_interfaces.msg.Time message.

Duration([duration])

Rate(rate)

get_node_names(node[, namespace])

Get the names of all nodes in the ROS system.

create_ros_pack([ros_paths])

get_ros_package_path(package_name)

get_parameter(name, node)

wait_for_message(topic_name, msg_type, node)

is_master_online(node)

sleep(duration, node)

Sleep for a given duration.

get_time(node)

create_timer(duration, callback, node[, oneshot])

create_action_client(→ rclpy.action.ActionClient)

get_service_proxy(→ rclpy.client.Client)

wait_for_service(topic_name, service_message)

create_publisher(→ rclpy.publisher.Publisher)

create_subscriber(→ rclpy.subscription.Subscription)

Package Contents#

pycram.ros.ros2.to_sec(self)#

Returns the time in seconds from a builtin_interfaces.msg.Time message.

Returns:

The time in seconds.

class pycram.ros.ros2.Time(time=0, nsecs=0)#

Bases: builtin_interfaces.msg.Time

Class to abstract the ROS2 Time, to make it more consistent with the ROS1 Time class.

classmethod now(node)#
to_sec()#
pycram.ros.ros2.Duration(duration=0.0)#
pycram.ros.ros2.Rate(rate)#
pycram.ros.ros2.logger#
pycram.ros.ros2.get_node_names(node, namespace=None)#

Get the names of all nodes in the ROS system.

Parameters:

namespace – The namespace to search for nodes.

Returns:

A list of node names.

pycram.ros.ros2.create_ros_pack(ros_paths=None)#
pycram.ros.ros2.get_ros_package_path(package_name)#
pycram.ros.ros2.get_parameter(name, node)#
pycram.ros.ros2.wait_for_message(topic_name, msg_type, node)#
pycram.ros.ros2.is_master_online(node)#
pycram.ros.ros2.sleep(duration, node)#

Sleep for a given duration.

Parameters:

duration – The duration to sleep in seconds.

pycram.ros.ros2.get_time(node)#
pycram.ros.ros2.create_timer(duration, callback, node, oneshot=False)#
exception pycram.ros.ros2.ResourceNotFound(*args, **kwargs)#

Bases: Exception

Common base class for all non-exit exceptions.

exception pycram.ros.ros2.ServiceException(*args, **kwargs)#

Bases: Exception

Common base class for all non-exit exceptions.

pycram.ros.ros2.create_action_client(topic_name: str, action_message, node) rclpy.action.ActionClient#
pycram.ros.ros2.logger#
pycram.ros.ros2.services#
class pycram.ros.ros2.ServiceProxy(topic_name, service_message, node)#
service#
message_type#
__call__(*args, **kwargs)#
wait_for_service(*args, **kwargs)#
pycram.ros.ros2.get_service_proxy(topic_name: str, service_message) rclpy.client.Client#
pycram.ros.ros2.wait_for_service(topic_name: str, service_message)#
pycram.ros.ros2.create_publisher(topic, msg_type, node, queue_size=10) rclpy.publisher.Publisher#
pycram.ros.ros2.create_subscriber(topic, msg_type, callback, node, queue_size=10) rclpy.subscription.Subscription#