o
    wi=	                     @   s   d Z ddlZddlZddlmZ ddlmZmZmZ e	ej
Zd\ZZdeed d  d	  Zejd
dejdddZejeefeed eedZG dd dZe ZdS )z/Grabbable puck with ArUco marker configuration.    N)aruco   )BLENDER_STL_DIRSO100_MODEL_DIRBOARD_IMG_DIR)   r   g      @
   d         )dtype)sizeZmarkerLengthZmarkerSeparation
dictionaryidsc                   @   sh   e Zd ZdZdZeZeg dd Z	edej
d dgZdZeg dd Zed	efd
dZdS )
PuckConfigz3Configuration for grabbable puck with ArUco marker.ZGrabbable_Puck)g=
ףp=?r   g(\OI@i  r      g
ףp=
?)g"@g@gfffffL@returnc              	   C   s   dt  dt  dt  dt d	S )z%Get XML snippet to add puck to scene.z;
          <asset>
            <mesh name="puck_top" file="zj/grabbable_puck_simpler_cube_top.stl" scale=".001 .001 .001"/>
            <mesh name="puck_bottom" file="zo/grabbable_puck_simpler_cube_bot.stl" scale=".001 .001 .001"/>
            <mesh name="aruco_plane_puck" file="zp/plane.obj" scale="0.15 0.15 .001" inertia="shell"/>
            <texture name="puck_aruco_tex" type="2d" file="a  /grabbable_plane.png"/>
            <material name="puck_aruco_mat" texture="puck_aruco_tex" rgba="1 1 1 1"/>
          </asset>

          <worldbody>
            <body mocap="true" name="grabbable_puck" pos="0 -0.25 0" quat="0 0 0 1">
              <geom name="puck_top_geom" type="mesh" mesh="puck_top" contype="1" conaffinity="1" rgba="0.8 0.2 0.2 0.8"/>
              <geom name="puck_bottom_geom" type="mesh" mesh="puck_bottom" contype="1" conaffinity="1" rgba="0.8 0.2 0.2 0.8"/>
            </body>
            <body mocap="true" name="grabbable_aruco_plane">
              <geom type="mesh" mesh="aruco_plane_puck" contype="0" conaffinity="0" material="puck_aruco_mat"/>
            </body>
          </worldbody>
        )r   r   )cls r   G/data/cameron/para/panda_streaming/hand_eye_calib/../ExoConfigs/puck.pyget_xml_addition   s   zPuckConfig.get_xml_additionN)__name__
__module____qualname____doc__name
puck_boardZaruco_boardnparrayaruco_offset_pospiaruco_offset_rotboard_lengthZgrasp_offsetclassmethodstrr   r   r   r   r   r      s    r   )r   numpyr   cv2r   exoskeletonr   r   r   getPredefinedDictionaryDICT_6X6_250
aruco_dictn_aruco_rown_aruco_colxarangeint32reshapeZboard_ids_puck	GridBoardr   r   PUCK_CONFIGr   r   r   r   <module>   s    
'