Overview Schemas Index

KINEMATIC_STRUCTURE_SCHEMA (jsdai.SKinematic_structure_schema)


FUNCTION unique_link_usage
          (link : kinematic_link) : BOOLEAN;

LOCAL
    mechs  : SET  OF  mechanism;
    joints : SET OF kinematic_joint;
    struct : kinematic_structure;
  END_LOCAL;
  joints := bag_to_set
              (USEDIN (link,
                 'KINEMATIC_STRUCTURE_SCHEMA.KINEMATIC_JOINT.FIRST_LINK') +
               USEDIN (link,
                 'KINEMATIC_STRUCTURE_SCHEMA.KINEMATIC_JOINT.SECOND_LINK'));
  struct := joints[1].structure;
  REPEAT i := 2 TO SIZEOF (joints);
    IF  (joints[i].structure :<>: struct) THEN
      RETURN  (FALSE);
    END_IF;
  END_REPEAT;
  mechs := bag_to_set
             (USEDIN (struct,
                'KINEMATIC_STRUCTURE_SCHEMA.MECHANISM.STRUCTURE_DEFINITION'));
  IF (SIZEOF (mechs) <> 1) THEN
    RETURN  (FALSE);
  END_IF;

  RETURN (TRUE);

END_FUNCTION; -- unique_link_usage

public class FUnique_link_usage
          public static Value run(SdaiContext _context, Value link)