
.. _ads_setup:

Spezifische Konfiguration für Beckhoff ADS-Schnittstelle
---------------------------------------------------------------


Dieser Abschnitt beschreibt die notwendigen Schritte zur Einrichtung der Kommunikation via Beckhoff ADS.


.. _ads_datatypes:

Datentypen
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. table::
    :widths: 30 30 40

    ==================  ============================ =================================================================================================================
    Datentyp Mikado     Datentyp SPS                 Bemerkung
    ==================  ============================ =================================================================================================================
    ``Bool``            ``BOOL``
    ``Integer``         ``INT``
    ``Double``          ``REAL``
    ``Pose``            ``ARRAY [1..6] OF REAL``     Die sechs Werte repräsentieren x,y,z,R1,R2 und R3 der Mikado-Pose
    ``PoseList``        ``ARRAY [1..6*n] OF REAL``   Die Länge des Arrays muss ein Vielfaches von 6 sein. Jeweils 6 benachbarte Werte repräsentieren eine Pose.
    ``String``          ``STRING``
    ``StringList``      ``ARRAY [1..n] OF REAL``     | **Nur Mikado an SPS**. Die Länge des Arrays unterliegt keinen Beschränkungen.
                                                     | Die Werte innerhalb der Mikado-StringList werden zu Doubles konvertiert.
    ==================  ============================ =================================================================================================================

.. note::
    Ist eine PoseList oder StringList in Mikado länger als der SPS-seitige verfügbare Platz, wird die Mikado-seitige Liste auf die verfügbare Länge abgeschnitten.


.. _ads_config:

Konfiguration
^^^^^^^^^^^^^^^^^^^^^

In der Konfigurationsdatei ``ads.yaml`` lassen sich zusätzlich zu den Feldbus-Adapter-Parametern folgende ADS-spezifischen Parameter einstellen:

.. code-block:: yaml

    # for publishing joint state:
    publish_robot_state: false # if true, the robot joint state is published every cycle
    current_joint_position_array_name: MAIN.OutCurrentJointPositions # Name of main robot's joint positions on PLC
    main_robot_prefix: "" # prefix as stated in the xacro-macro of main robot (works at least for staeubli)

    # publishing additional robots (optional):
    additional_robot1_prefix: "example_prefix" # prefix as stated in xacro-macro of additional robot
    additional_robot1_variable: MAIN.OutJointPosOfRobotWithExamplePrefix # Name of additional robot's joint positions on PLC

    additional_robot2_prefix: "example_prefix2"
    additional_robot2_variable: MAIN.OutJointPosOfRobotWithExamplePrefix2
    # .. and so on

    # network settings:
    local_net_id: ""
    remote_ip: ""
    remote_net_id: ""
    remote_port: 851

    # IOs
    input_array_name: GVL.inputBytes  # IO-Name on PLC
    output_array_name: GVL.outputBytes # IO-Name on PLC

    # robot control:
    enable_robot_control: false # if true, the robot is controlled via ADS-interface
    publish_robot_status: false # if true, the robot status is published every cycle
    trajectory_array_name: MAIN.InTrajectory
    in_motion_name: MAIN.OutInMotion
    writing_trajectory_allowed_name: MAIN.OutWritingTrajectoryAllowed
