Skip to main content
Glama

nUR MCP Server

by nonead
rtde.cpython-312.pyc37.3 kB
� �60hw�����dZdZdZdZddlZddlZddlZddlZddlZddl Z ddl m cm ZddlZddlZdZGd�d�ZGd �d �ZGd �d ej*�ZGd �de�ZGd�de�Zy)al Python 3.x library to control an UR robot through its TCP/IP interfaces Copyright (C) 2017 Martin Huus Bjerge, Rope Robotics ApS, Denmark Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL "Rope Robotics ApS" BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of "Rope Robotics ApS" shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from "Rope Robotics ApS". zMartin Huus Bjergez*Copyright 2017, Rope Robotics ApS, Denmarkz MIT License�Ng�?c�,�eZdZdZdZdZdZdZdZdZ dZ y ) �Command�V�v�M�U�O�I�S�PN) �__name__� __module__� __qualname__�RTDE_REQUEST_PROTOCOL_VERSION�RTDE_GET_URCONTROL_VERSION�RTDE_TEXT_MESSAGE�RTDE_DATA_PACKAGE�"RTDE_CONTROL_PACKAGE_SETUP_OUTPUTS�!RTDE_CONTROL_PACKAGE_SETUP_INPUTS�RTDE_CONTROL_PACKAGE_START�RTDE_CONTROL_PACKAGE_PAUSE���ND:\mcp\Nonead-Universal-Robots-MCP\Nonead-Universal-Robots-MCP\URBasic\rtde.pyrr(s2��$&�!�!$������)+�&�(*�%�!#��!#�rrc� �eZdZdZdZdZdZdZy)�ConnectionStater����N)r rr�ERROR� DISCONNECTED� CONNECTED�PAUSED�STARTEDrrrrr3s�� �E��L��I� �F��Grrc��eZdZdZdd�Zd�Zd�Zd�Zd�Zd�Z d �Z dgdfd �Z dgfd �Z d �Z d �Zd�Zd�Ze�fd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Zd�Zy)�RTDEaN Interface to UR robot Real Time Data Exchange interface. See this site for more detail: http://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/real-time-data-exchange-rtde-guide-22229/ The constructor takes a UR robot hostname as input and a path to a RTDE configuration file. Input parameters: host (string): Hostname or IP of UR Robot (RT CLient server) conf_filename (string): Path to xml file describing what channels to activate Example: rob = URBasic.rtde.RTDE('192.168.56.101', 'rtde_configuration.xml') rob.close_rtde() Nc��� ||_d|_t �|_|��tjdtjjd�dz}t|�tjj|�s>tjdtjjd�dz}t|�||_d|_t j"j%|�t!j&�|_t*j,|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ |jC�y)zB Constructor see class description for more info. �<Nr�URBasiczURBasic/rtdeConfiguration.xmlz$URBasic/rtdeConfigurationDefault.xmlT)"� isinstancer*� robotModel� RobotModel�_RTDE__robotModel�_RTDE__reconnectTimeout�RTDEDataObject�_RTDE__dataSend�__file__�find�print�os�path�isfile�_RTDE__conf_filename�_RTDE__stop_event� threading�Thread�__init__� Condition�_RTDE__dataEventrr"�_RTDE__conn_state� _RTDE__sock�_RTDE__rtde_output_names�_RTDE__rtde_output_config�_RTDE__rtde_input_names�_RTDE__rtde_input_initValues�_RTDE__rtde_input_config�_RTDE__controllerVersion�_RTDE__protocol_version�_RTDE__packageCounter�start)�selfr,� conf_filenames rr<z RTDE.__init__Ls,�� �&���"$���(�*��� � �#�,�,�Q�w�/?�/?�/D�/D�Y�/O�P�Sr�r�M� �-� ��7�7�>�>�-�0� '� 0� 0��7�3C�3C�3H�3H��3S� T�W}� }� ��m�$�,��� ������!�!�$�'�$�.�.�0���+�8�8����� �#'�� �$(��!�"&���'+��$�#'�� �#'�� �"&��� !��� � � � rc���|jry tjtjtj�|_|jj tj tj d�|jj tjtjd�|jjt�|jj|jjdf�tj|_y#tj"tj$f$r0|jr|j&j)�d|_YywxYw)z� Initialize RTDE connection to host and set up data interfaces based on configuration XML. Return value: success (boolean) Tri4uNF)r@�socket�AF_INET� SOCK_STREAM� setsockopt� IPPROTO_TCP� TCP_NODELAY� SOL_SOCKET� SO_REUSEADDR� settimeout�DEFAULT_TIMEOUT�connectr.� ipAddressrr#r?�timeout�error�sock�close�rJs r� __connectzRTDE.__connectps��� �;�;�� � �-�-�����8J�8J�K�D�K� �K�K� "� "�6�#5�#5�v�7I�7I�1� M� �K�K� "� "�6�#4�#4�f�6I�6I�1� M� �K�K� "� "�?� 3� �K�K� � ��!2�!2�!<�!<�e� D� E� /� 9� 9�D� � �� ���� � �-� ��{�{�� � ���!��D�K��  �s�DD�AE1�0E1c��|jr!|jj�d|_tj|_y)z, Close the RTDE connection. NT)r@r\rr"r?r]s r� __disconnectzRTDE.__disconnect�s3�� �;�;� �K�K� � � ��D�K�+�8�8���rc�<�|jtjkDS)zg Returns True if the connection is open. Return value: open (boolean) )r?rr"r]s r� __isConnectedzRTDE.__isConnected�s��� � �?�#?�#?�?�?rc�<�|jtjk\S)z: Return True if RTDE interface is running )r?rr%r]s r� isRunningzRTDE.isRunning�s�� � � �O�$;�$;�;�;rc�F�tj}|j|�y)z� Returns the software version of the robot controller running the RTDE server. Return values: major (int) minor (int) bugfix (int) N)rr� _RTDE__send�rJ�cmds r�__getControllerVersionzRTDE.__getControllerVersion�s���0�0�� � � �C�rc�t�tj}tjd|�}|j ||�y)a� Negotiate the protocol version with the server. Returns True if the controller supports the specified protocol version. We recommend that you use this to ensure full compatibility between your application and future versions of the robot controller. Input parameters: protocol (int): protocol version number Return value: success (boolean) z>HN)rr�struct�packrf)rJ�protocolrh�payloads r�__negotiateProtocolVersionzRTDE.__negotiateProtocolVersion�s/���3�3���+�+�d�8�,�� � � �C��!rc�&�|��tj|j�}|j�}|j d�}g}g}|�L|D]G}|j |j d�|j t|j d���Itj}d} |�8t|�turdj|�} nt|�tur|} ny||_||_| j!d�} |j#|| �y) a� Configure an input package that the external(this) application will send to the robot controller. An input package is a collection of input input_variables that the external application will provide to the robot controller in a single update. Variables is a list of variable names and should be a subset of the names supported as input by the RTDE interface.The list of types is optional, but if any types are provided it should have the same length as the input_variables list. The provided types will be matched with the types that the RTDE interface expects and the function returns None if they are not equal. Multiple input packages can be configured. The returned InputObject has a reference to the recipe id which is used to identify the specific input format when sending an update. If input_variables is empty, xml configuration file is used. Input parameters: input_variables (list<string> or Str): [Optional] Variable names from the list of possible RTDE inputs types (list<string> or str): [Optional] Types matching the input_variables Return value: success (boolean) N�send�name� initValue��,�utf-8T)�ET�parser8�getrootr3�append�attrib�floatrr�type�list�join�strrCrD�encoderf) rJ�input_variables�types� initValues�tree�root�recive�childrhrns r� __setupInputzRTDE.__setupInput�s���* � "��8�8�D�0�0�1�D��<�<�>�D��Y�Y�v�&�F� �O��J��!�#�E�#�*�*�5�<�<��+?�@��%�%�e�E�L�L��,E�&F�G�$��7�7���� � &��O�$��,��(�(�?�3���o�&�#�-�)���"1���'1��$��.�.��)�� � � �C��!�rc��|��tjj|j�syt j |j�}|j �}|jd�}dg}|D] }|j|jd��"tj}t|�turdj|�}nt|�tur|}ny||_|j#d�}|j%||�y) a� Configure an output package that the robot controller will send to the external(this) application at the control frequency. Variables is a list of variable names and should be a subset of the names supported as output by the RTDE interface. The list of types is optional, but if any types are provided it should have the same length as the output_variables list. The provided types will be matched with the types that the RTDE interface expects and the function returns False if they are not equal. Only one output package format can be specified and hence no recipe id is used for output. If output_variables is empty, xml configuration file is used. Input parameters: output_variables (list<string> or str): [Optional] Variable names from the list of possible RTDE outputs types (list<string> or str): [Optional] Types matching the output_variables Return value: success (boolean) NF�receive� timestamprrrurvT)r5r6r7r8rwrxryr3rzr{rrr}r~rr�rAr�rf) rJ�output_variablesr�r�r�r�r�rhrns r� __setupOutputzRTDE.__setupOutput�s���( � #��7�7�>�>�$�"6�"6�7���8�8�D�0�0�1�D��<�<�>�D��Y�Y�y�)�F� +�}� ��� �'�'�� � �V�(<�=� ��8�8�� � � !�T� )��h�h�/�0�G� �"� #�s� *�&�G��#3�� ��.�.��)�� � � �C��!�rc�F�tj}|j|�y)z� Sends a start command to the RTDE server. Setup of all inputs and outputs must be done before starting the RTDE interface Return value: success (boolean) T)rrrfrgs r� __sendStartzRTDE.__sendStart)����0�0�� � � �C��rc�F�tj}|j|�y)z� Sends a pause command to the RTDE server When paused it is possible to change the input and output configurations Return value: success (boolean) T)rrrfrgs r� __sendPausezRTDE.__sendPause5r�rc���|jtjk7ry|jj �ry|j }|j tj|j|j��S)z� Send the contents of a RTDEDataObject as input to the RTDE server. Returns True if successful. Return value: success (boolean) N) r?rr%r.�StopRunningFlagrErfrrrlr1)rJ�configs r�sendDataz RTDE.sendDataAsa�� � � �� 7� 7� 7� � � � � ,� ,� .� ��)�)���{�{�7�4�4�f�k�k�$�/�/�6R�S�Src�l�t|�tur�t|�t|�k7r&tdt|�zdzt|�z��t |�t |�k7r td��t t |��D]d}|j |jj||�r |||jj||<�Ltt||�dz��y||jjvr||jj|<ytt|�dz��)a� Set data to be send to the robot Object is locked while updating to avoid sending half updated values, hence send all values as two lists of equal lengths Input parameters: variable_name (List/str): Variable name from the list of possible RTDE inputs value (list/int/double) Return value: Status (Bool): True=Data sucesfull updated, False=Data not updated zRTDE z is not type of zNList of RTDE Output values does not have same length as list of variable namesz not found in RTDE OUTPUT configN) r}r~� ValueErrorr��len�range�hasattrrE�namesr1�__dict__)rJ� variable_name�value�iis r�setDataz RTDE.setDataVs�� � � �$� &��M�"�d�5�k�1� ��3�}�+=�!=�@R�!R�UX�Y^�U_�!_�`�`��=�!�S��Z�/� �!q�r�r��C��J�'���<�<�� 8� 8� >� >� �b�@Q�R�BG��)�D�O�O�,�,�]�2�->�?�$�S��r�):�%;�>`�%`�a�a� (��� 8� 8� >� >�>�:?����(�(��7� ��]�!3�6X�!X�Y�Yrc�\�d}tj|�t|�z}tj|||�|z}|j�yt j g|jggt �\}}}t|�r|jj|�y|j�y)z� Send command and data (payload) to Robot Controller and receive the respond from the Robot Controller. Input parameters: cmd (int) payload (bytes) Return value: success (boolean) �>HBFT) rk�calcsizer�rlr@�selectrV�sendall�_RTDE__disconnect)rJ�commandrn�fmt�size�buf�_�writables r�__sendz RTDE.__sendys��������s�#�c�'�l�2���k�k�#�t�W�-��7�� �;�;� ��!�=�=��d�k�k�]�B��P���H�a� �x�=� �K�K� � �� $�� � � � �rc��t�}tj|jgggt�\}}}t |�r?|jj d�}t |�dk(r|j �y||z }t |�dk\�r�tjd|�\}}t |�}||k\�rE|d|||d}}|j||�} |tjk(r|j| ��n-|tjk(r|j| ��n|tjk(�r | |_|j"|j _t&j)|j"|j j*�|_|j.���t1t |j j$��D�]w} d|j j2| k(r@|j5|j j$| t7|j.| ���`d|j j2| k(r@|j5|j j$| t7|j.| ����d|j j2| k(rA|j5|j j$| t7|j.| ����d|j j2| k(r8|j5|j j$| |j.| ���mt9d ���zn�|tj:k(r#| |_|j>|j<_n�|tj@k(rtBjD|_#n�|tjHk(rtBjJ|_#n_|tjLk(r|jO| �n:|dk(r5t�}n*t9d tQt |��z�t�}t |�dk\r���t |�dk7r t�}yy) Ni@rrr��UINT8�UINT32�INT32�DOUBLEzUnknown data typez4skipping package - unexpected packet_size - length: ))�bytesr�r@rVr��recvr�rk� unpack_from�_RTDE__decodePayloadrr�_RTDE__verifyControllerVersionr�_RTDE__verifyProtocolVersionrrErCr�r0� create_empty�idr1rDr�r�r��intr4rrBrArrr%r?rr$r�_RTDE__updateModelr�) rJ� byte_buffer�readabler��more� packet_size�packet_command� buffer_length�packet�datar�s r� __receivezRTDE.__receive�s����g� �!�=�=�$�+�+���B��P���1�a� ��M��;�;�#�#�E�*�D��4�y�A�~��!�!�#�� �D� �K��+��!�#�,2�,>�,>�u�k�,R� )�[�.�� �,�M��;�.�&1�!�K�&@�+�k�l�B[� ���+�+�N�F�C��"�W�%G�%G�G��2�2�4�8�#�w�'L�'L�L��0�0��6�#�w�'P�'P�P�/3�D�,�59�5L�5L�D�,�,�2�&4�&A�&A�$�BY�BY�[_�[s�[s�[v�[v�&w�D�O��3�3�?�"'��D�,D�,D�,J�,J�(K�"L�B�&�$�*B�*B�*H�*H��*L�L� $� � �T�-E�-E�-K�-K�B�-O�QT�UY�Uq�Uq�rt�Uu�Qv� w�!)�T�-E�-E�-K�-K�B�-O�!O� $� � �T�-E�-E�-K�-K�B�-O�QT�UY�Uq�Uq�rt�Uu�Qv� w�!(�D�,D�,D�,J�,J�2�,N�!N� $� � �T�-E�-E�-K�-K�B�-O�QT�UY�Uq�Uq�rt�Uu�Qv� w�!)�T�-E�-E�-K�-K�B�-O�!O� $� � �T�-E�-E�-K�-K�B�-O�RV�Rn�Rn�oq�Rr� t�!&�&9� :�#M�$�w�'Q�'Q�Q�04�D�-�6:�6N�6N�D�-�-�3�#�w�'I�'I�I�(7�(?�(?�D�%�#�w�'I�'I�I�(7�(>�(>�D�%�#�w�'@�'@�@��&�&�t�,�#�q�(�"'�'�K��L�s�SV�Wb�Sc�Od�d�e�#�g� �i�+��!�#�l �{� �q� ��'�K� !rc���|jdz|_|jdzdk(r!tdt|j�z�|jjddk7rS|d|jjdz }|dkDr/tdt|d�zdzt|dz�zd z�|j �D]}|||jj|<� y) Nri�rzTotal packages: r�g��*Ob�?zLost some RTDE at z - z milliseconds since last package)rHr4r�r.�dataDir�keys)rJ�rtde_data_package�delta�tagnames r� __updateModelzRTDE.__updateModel�s��� $� 5� 5�� 9��� � � �4� '�1� ,� �$�s�4�+@�+@�'A�A� B� � � � $� $�[� 1�T� 9�%�k�2�T�5F�5F�5N�5N�{�5[�[�E��z�!��*�S�1B�;�1O�-P�P�SX�X�[^��D�L�\"�"�$F�G�H�(�-�-�/�G�1B�7�1K�D� � � %� %�g� .�0rc��||_|j\}}}}|rr|ro|rltdt|�zdzt|�zdzt|�zdzt|�z�|dkr"|dkr|dkrtd�td��yyyyyy)NzController version: �.�-rri�Jz;Please upgrade your controller to minimum version 3.2.19171)rFr4r�r�)rJr��major�minor�bugfix�builds r�__verifyControllerVersionzRTDE.__verifyControllerVersion�s���#'�� �(,�(@�(@�%���v�u� �U�v� �&��U��3�c�9�C��J�F��L�s�SY�{�Z�]`�`�cf�gl�cm�m� o���z�e�q�j�V�e�^��S�T� �!^�_�_�.<�j�z� &�U�5rc�F�||_|jdk7r td��y)Nrz0We only support protocol version 1 at the moment)rGr�)rJr�s r�__verifyProtocolVersionzRTDE.__verifyProtocolVersion�s)��"&��� � "� "�a� '��O�P� P� (rc���|tjk(r(t|�dk7rytjd|�dS|tj k(r�dt|�k(r=t jt jtjd|��d�Sdt|�k(r)t jtjd|��Sy|tjk(r�t|�dkryd}d}d }d }d tt|��zd z}tj||�}|d} d jtt|dd��} | |k(s| |k(rtd| z�y| |k(rtd| z�y| |k(rtd| z�yy|tjk(r)t|�dkryd} t j#|| �} | S|tj$k(r)t|�dkryd} t j#|| �} | S|tj&k(r1t|�dk7ryt)tjd|�d�S|tj*k(r1t|�dk7ryt)tjd|�d�S|tj,k(r*|j.�y|j.j1|�}|Stdt|�z�y)z� Decode the package received from the Robot payload (bytes) Return value(s): Output from Robot controller (type is depended on the cmd value) rN�>Br� z>III�z>IIIIrr�>�BrtzServer message: FTzUnknown RTDE command type: )rrr�rkr�r�nprz�arrayrr�r�map�chrr4r�RTDE_IO_Config� unpack_reciperr�boolrrrB�unpack)rJrhrn�EXCEPTION_MESSAGE� ERROR_MESSAGE�WARNING_MESSAGE� INFO_MESSAGEr��out�level�message� has_recipe_id� output_config� input_config�outputs r�__decodePayloadzRTDE.__decodePayload�s��� �'�7�7� 7��7�|�q� ���%�%�d�G�4�Q�7� 7� �G�6�6� 6��S��\�!��y�y����&�*<�*<�V�W�*M�!N�PQ�R�R��s�7�|�#��x�x�� 2� 2�7�G� D�E�E���G�-�-� -��7�|�a��� !� ��M��O��L���C��L�)�)�C�/�C��$�$�S�'�2�C���F�E��g�g�c�#�c�!�"�g�.�/�G��)�)�� �%��(�7�2�3��/�)��(�7�2�3��,�&��(�7�2�3�'��G�>�>� >��7�|�a���!�M�*�8�8��-�P�M� � � �G�=�=� =��7�|�a��� �M�)�7�7���O�L�� � �G�6�6� 6��7�|�q� ����*�*�4��9�!�<�=� =� �G�6�6� 6��7�|�q� ����*�*�4��9�!�<�=� =� �G�-�-� -��(�(�0���.�.�5�5�g�>�F��M� �/�#�c�(�:� ;rc��t|�t|�k7rytt|��D]}||||k7s�yy�NFT)r�r�)rJ�l1�l2�is r� __listEqualszRTDE.__listEqualsRs?�� �r�7�c�"�g� ���s�B�y�!�A��!�u��1��~��"�rc�4�d}|jtjkr>tjd�|dz }|dkDry|jtjkr�>|j 5|j j �ddd�y#1swYyxYw)zAWait while the data receiving thread is receiving a new data set.rr�FNT)r?rr%�time�sleepr>�wait)rJ�cnts r�__waitz RTDE.__waitZs}�������/�"9�"9�9� �J�J�q�M� �!�G�C��1�u�� ���/�"9�"9�9�� � � � � � !� !� #�����s �*B�Bc��|jdur8d|_|j�|j�|j�yyr�)r9� _RTDE__waitrr�r]s rr\z RTDE.closeks;�� � � �� %� $�D� � �K�K�M� �I�I�K� � � � � &rc�x�d|_tj�}tj�|z |jk�r|jtj k7r�|j �|j�|j �|j�|j�|jd�|j�|j�|j�|j�|j�tj�|z |jkr|jtj k7r��|jtj k7ry|jsztj�|z |jkrV |j�tj�}|js%tj�|z |jkr�V|j�|j&5|j&j)�ddd�y#t$r�|jtj k\rtj|_|j�|j�se|j�tj d�|j �|j�|j#�|j�|jtj k(r t%d�n t%d�Y��hwxYw#1swYyxYw)NFrzRTDE interface restartedzRTDE reconnection failed!)r9r�r/r?rr%�_RTDE__connectr��_RTDE__getControllerVersion�_RTDE__receive�_RTDE__negotiateProtocolVersion�_RTDE__setupOutput�_RTDE__sendStart� Exceptionr!�_RTDE__sendPauser��_RTDE__setupInputr4r>� notifyAll)rJ�t0s r�runzRTDE.runrsW��!��� �Y�Y�[���y�y�{�2�~�d�5�5�5�4�;L�;L�P_�Pg�Pg�;g� �N�N� � � � � � �N�N� � � '� '� )� �N�N� � � +� +�A� .� �N�N� � � � � � �N�N� � � � � � �N�N� ��y�y�{�2�~�d�5�5�5�4�;L�;L�P_�Pg�Pg�;g� � � �� 7� 7� 7� ��$�$�4�9�9�;�r�>�$�:Q�:Q�+Q� 7���� ��Y�Y�[�� �$�$�4�9�9�;�r�>�$�:Q�:Q�+Q�: ���� � � � � � � &� &� (�� ��-� 7��$�$��(?�(?�?�(7�(=�(=�D�%�� � �"��'�'�)��%�%�'��J�J�q�M��N�N�$��&�&�(��%�%�'��$�$�&��$�$��(?�(?�?��4�5��5�6��' 7��,� �s� $H5�L0�5C4L-�,L-�0L9�N)r rr�__doc__r<rr��_RTDE__isConnectedrdrrr rrr r�r�r�rfrr�r�r�r��_RTDE__listEqualsrr\rrrrr'r':s����"�H�0�@�<� �"�,,0�r�d�3�j.2��.�` � �T�*!Z�F',�g��8D"�L L� `�Q� T<�n� � !� �5)rr'c�0�eZdZgd�Zed��Zd�Zd�Zy)r�)r�r�r�r�c��t�}|r�tjd|�d|_dt t |��zdz}tj||�}dj tt|dd��}|jd�|_ d|_ nodt t |��zdz}tj||�}dj tt|dd��}|jd�|_ d|_ |jD�]'}|dk(r|xjd z c_ �|d k(r|xjd z c_ �:|d k(r|xjd z c_ �U|dk(r|xjdz c_ �p|dk(r|xjdz c_ ��|dk(r|xjdz c_ ��|dk(r|xjdz c_ ��|dk(r|xjdz c_ ��|dk(r|xjdz c_ ��|dk(r t|j�td��td|z��|S)Nr�rr�r�rtrrur�r�r��I�VECTOR6D�dddddd�VECTOR3D�ddd� VECTOR6INT32�iiiiii� VECTOR6UINT32�IIIIIIr��d�UINT64�Qr��IN_USEz%An input parameter is already in use.zUnknown data type: )r�rkr�r�r�r�rr�r��splitr�r�r4r�)r�r��rmdr�r�s rr�zRTDE_IO_Config.unpack_recipe�s������ ��'�'��c�2�1�5�C�F���C��H� �%��+�C��$�$�S�#�.�C��'�'�#�c�#�a�b�'�*�+�C�� � �#��C�I��C�G���C��H� �%��+�C��$�$�S�#�.�C��'�'�#�c�#�a�&�/�*�C�� � �#��C�I��C�G����A��'�z����3����H�����3����J�����5� ���J�����5� ���N�"����5� ���O�#����5� ���H�����3����H�����3����G�����3����H���c�f�f� � �!H�I�I� �!6��!:�;�;�/�0� rc��|j|j|j�}tj|jg|���Sr)rlr�r�rkr�)rJ�state�ls rrlzRTDE_IO_Config.pack�s2�� �J�J�t�z�z�4�:�:� .���{�{�4�8�8�(�a�(�(rc��tj|j|�}tj ||j |j �Sr)rkr�r�r0r�r�r�)rJr��lis rr�zRTDE_IO_Config.unpack�s5��� � ����4�0���$�$�R����T�Z�Z�@�@rN)r rr� __slots__� staticmethodr�rlr�rrrr�r��s%��/�I��'��'�R)�Arr�c�Z�eZdZdZdZd�Zed��Zed��Zed��Z ed��Z y)r0z� Data container for data send to or received from the Robot Controller. The Object will have attributes for each of that data tags received or send. e.g. obj.actual_digital_output_bits Nc���t|�t|�k7r td��g}|j�|j|j�t t|��D]|}|j ||�td||z��||j d�r"|j|j ||��\|j|j ||��~|S)N�List sizes are not identical.zUninitialized parameter: �VECTOR)r�r�� recipe_idrzr�r�� startswith�extend)rJr�r�r&r�s rrlzRTDEDataObject.pack�s��� �u�:��U�� #��<�=� =� �� �>�>� %� �H�H�T�^�^� $��s�5�z�"�A��}�}�U�1�X�&�.� �!<�u�Q�x�!G�H�H��Q�x�"�"�8�,�������u�Q�x�0�1�������u�Q�x�0�1� #��rc� �t|�t|�k7r td��t�}d}tt|��D]=}tj ||||�|||<|tj ||�z }�?|S)Nr-r)r�r��dictr�r0� unpack_field� get_item_size)r�r�r��obj�offsetr�s rr�zRTDEDataObject.unpack�s}�� �u�:��U�� #��<�=� =��f�����s�5�z�"�A�*�7�7��f�e�A�h�O�C��a��M� �n�2�2�5��8�<� <�F�#�� rc�~�t�}tt|��D]}d|j||<�||_|Sr)r0r�r�r�r/)r�r/r6r�s rr�zRTDEDataObject.create_emptys;������s�5�z�"�A�%)�C�L�L��q�� "�#�!�� �� rc�L�|jd�ry|jd�ryy)N�VECTOR6��VECTOR3rr)r0)� data_types rr5zRTDEDataObject.get_item_sizes'�� � � � � *�� � !� !�)� ,��rc �v�tj|�}|dk(s|dk(r;tjt |�D�cgc]}t |||z���c}�S|dk(r;tjt |�D�cgc]}t |||z���c}�S|dk(rt ||�S|dk(s|dk(rt ||�S|dk(r;tjt |�D�cgc]}t |||z���c}�S|dk(s|d k(rt ||�Std |z��cc}wcc}wcc}w) Nrrrr�r�rrr�r�z!unpack_field: unknown data type: )r0r5r�r�r�r|r�r�)r�r7r=r�r�s rr4zRTDEDataObject.unpack_fields4���+�+�I�6�� � � "� � � "��8�8�E�$�K�H�K�q�U�4��q��>�2�K�H�I� I� �/� )��8�8�%��+�F�+�Q�S��f�Q�h��0�+�F�G� G� �(� "���f��&� &� �(� "� �(� "��t�F�|�$� $� �.� (��8�8�%��+�F�+�Q�S��f�Q�h��0�+�F�G� G� �'� !� �'� !��t�F�|�$� $��<�y�H�I�I��I��F��Gs�D,�<D1�'D6) r rrrr/rlr*r�r�r5r4rrrr0r0�se��� �I� ��������������J��Jrr0)r� __author__� __copyright__� __license__r*r:rMrkr��numpyr��xml.etree.ElementTree�etree� ElementTreerwr��os.pathr5rVrrr;r'�objectr�r0rrr�<module>rHs����."� �<� �� ��� � � ��"�"� ����$�$���m )�9� � �m )�b2A�V�2A�hCJ�V�CJr

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nonead/nUR-MCP-SERVER'

If you have feedback or need assistance with the MCP directory API, please join our Discord server