.. _robco_hardware:

robco_hardware
==============

The ``robco_hardware`` package provides a ``ros2_control`` hardware interface for RobCo robots.

.. note::
   The ROS 2 interface is currently not shipped by default on RobCo robots. If you are interested
   in using the ROS 2 interface on your RobCo robot, please get in touch with RobCo support.

.. figure:: /_static/ros_control_overview.drawio.svg
   :align: center

   RobCo ros2_control interface overview

Using the Hardware Interface
----------------------------

The ROS interface is disabled when the robot control unit starts up and has to be enabled using the
RobFlow API before using the hardware interface. This can be done in a browser and is described in
:ref:`using_the_hardware_interface`.

.. _provided_command_interfaces:

Provided Command Interfaces
---------------------------

The hardware interface exposes the following types of command interfaces:

* ``position`` + ``velocity`` + ``acceleration`` (must all be active at the same time)
* ``effort`` (joint torque)

.. note::
   At any given point in time, the same set of command interfaces must be active on all robot
   joints. In other words, one joint cannot use a different set of command interfaces than another.

Joint Position/Velocity/Acceleration Interface
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

When the ``position``, ``velocity`` and ``acceleration`` interfaces are active, the internal
controller operates in *trajectory streaming* mode. The internal desired values for joint position,
velocity and acceleration are immediately updated from the values coming from ``ros2_control``.

Joint Effort (Torque) Interface
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

When only the ``effort`` interface is activated, the internal controller operates in
*torque streaming* mode. In this mode, the controller compensates gravity (:math:`\tau_g`) and
coriolis forces (:math:`\tau_{coriolis}`) only. The ``effort`` command (:math:`\tau_{ROS}`) is then
added to form the final torque vector commanded to the motors:

.. math::

   \tau_{motor} = \tau_{ROS} + \tau_g + \tau_{coriolis}