pycram.ros.ros2
===============

.. py:module:: pycram.ros.ros2


Submodules
----------

.. toctree::
   :maxdepth: 1

   /autoapi/pycram/ros/ros2/action_lib/index
   /autoapi/pycram/ros/ros2/data_types/index
   /autoapi/pycram/ros/ros2/filter/index
   /autoapi/pycram/ros/ros2/logging/index
   /autoapi/pycram/ros/ros2/publisher/index
   /autoapi/pycram/ros/ros2/ros_tools/index
   /autoapi/pycram/ros/ros2/service/index
   /autoapi/pycram/ros/ros2/subscriber/index
   /autoapi/pycram/ros/ros2/viz_marker_publisher/index


Attributes
----------

.. autoapisummary::

   pycram.ros.ros2.node
   pycram.ros.ros2.services


Classes
-------

.. autoapisummary::

   pycram.ros.ros2.Time
   pycram.ros.ros2.LoggerLevel
   pycram.ros.ros2.ServiceProxy


Functions
---------

.. autoapisummary::

   pycram.ros.ros2.to_sec
   pycram.ros.ros2.Duration
   pycram.ros.ros2.Rate
   pycram.ros.ros2.set_logger_level
   pycram.ros.ros2.set_logger_format
   pycram.ros.ros2.logwarn
   pycram.ros.ros2.loginfo
   pycram.ros.ros2.logerr
   pycram.ros.ros2.logdebug
   pycram.ros.ros2.logwarn_once
   pycram.ros.ros2.loginfo_once
   pycram.ros.ros2.logerr_once
   pycram.ros.ros2.logdebug_once
   pycram.ros.ros2.create_action_client
   pycram.ros.ros2.loginfo_once
   pycram.ros.ros2.get_service_proxy
   pycram.ros.ros2.wait_for_service
   pycram.ros.ros2.create_publisher
   pycram.ros.ros2.create_subscriber


Package Contents
----------------

.. py:function:: to_sec(self)

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

   :return: The time in seconds.


.. py:data:: node

.. py:class:: Time(time=0, nsecs=0)

   Bases: :py:obj:`builtin_interfaces.msg.Time`


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


   .. py:method:: now()
      :classmethod:



   .. py:method:: to_sec()


.. py:function:: Duration(duration=0.0)

.. py:function:: Rate(rate)

.. py:class:: LoggerLevel

   Bases: :py:obj:`enum.Enum`


   Enum for the different logger levels.


   .. py:attribute:: DEBUG
      :value: 'debug'



   .. py:attribute:: INFO
      :value: 'info'



   .. py:attribute:: WARN
      :value: 'warn'



   .. py:attribute:: ERROR
      :value: 'error'



   .. py:attribute:: FATAL
      :value: 'fatal'



.. py:function:: set_logger_level(level: pycram.datastructures.enums.LoggerLevel)

   Set the logger level for the pycram logger. Possible values are: DEBUG, INFO, WARN, ERROR, FATAL.

   :param level: The level to set the logger to.


.. py:function:: set_logger_format(logger_format: str)

   Set the logger format for the pycram logger. The format can contain the following placeholders:
   - {severity}
   - {name}
   - {message}
   - {function_name}
   - {file_name}
   - {line_number}
   The format is set to the environment variable RCUTILS_CONSOLE_OUTPUT_FORMAT. Therefore, the format is not only
   applied to the pycram logger but to all loggers in the environment.

   :param logger_format: The format to set the logger to.


.. py:function:: logwarn(message: str)

.. py:function:: loginfo(message: str)

.. py:function:: logerr(message: str)

.. py:function:: logdebug(message: str)

.. py:function:: logwarn_once(message: str)

.. py:function:: loginfo_once(message: str)

.. py:function:: logerr_once(message: str)

.. py:function:: logdebug_once(message: str)

.. py:function:: create_action_client(topic_name: str, action_message) -> rclpy.action.ActionClient

.. py:function:: loginfo_once(message: str)

.. py:data:: services

.. py:class:: ServiceProxy(topic_name, service_message)

   .. py:attribute:: service


   .. py:attribute:: message_type


   .. py:method:: __call__(*args, **kwargs)


   .. py:method:: wait_for_service(*args, **kwargs)


.. py:function:: get_service_proxy(topic_name: str, service_message) -> rclpy.client.Client

.. py:function:: wait_for_service(topic_name: str, service_message)

.. py:function:: create_publisher(topic, msg_type, queue_size=10) -> rclpy.publisher.Publisher

.. py:function:: create_subscriber(topic, msg_type, callback, queue_size=10) -> rclpy.subscription.Subscription

