|
FUNCTION suitably_based_mechanism (mbp : mechanism_base_placement, mech : mechanism) : BOOLEAN; LOCAL kprop : kinematic_property_definition ; kgrep : kinematic_ground_representation ; klrep : kinematic_link_representation ; klnk : kinematic_link ; kjnts : BAG OF kinematic_joint ; nmechs : BAG OF mechanism ; nmbps : BAG OF mechanism_base_placement ; END_LOCAL ; kprop := mech . containing_property ; IF ( 'kinematic_structure_schema.kinematic_ground_representation' IN TYPEOF ( mbp \ representation_relationship . rep_1 ) ) THEN kgrep := mbp \ representation_relationship . rep_1 ; IF ( kgrep . property \ property_definition_representation . definition :=: kprop ) THEN RETURN ( TRUE ) ; ELSE RETURN ( FALSE ) ; END_IF ; ELSE klrep := mbp \ representation_relationship . rep_1 ; klnk := klrep . link_representation_relation . topological_aspects ; kjnts := USEDIN ( klnk , 'kinematic_structure_schema.kinematic_joint.first_link' ) + USEDIN ( klnk , 'kinematic_structure_schema.kinematic_joint.second_link' ) ; nmechs := USEDIN ( kjnts [ 1 ] . structure , 'kinematic_structure_schema.mechanism.structure_definition' ) ; IF ( nmechs [ 1 ] :=: mech ) THEN RETURN ( FALSE ) ; ELSE IF ( nmechs [ 1 ] . containing_property :<>: kprop ) THEN RETURN ( FALSE ) ; ELSE nmbps := USEDIN ( nmechs [ 1 ] , 'kinematic_structure_schema.' + 'mechanism_base_placement.base_of_mechanism' ) ; IF ( SIZEOF ( nmbps ) = 0 ) THEN RETURN ( FALSE ) ; ELSE RETURN ( suitably_based_mechanism ( nmbps [ 1 ] , mech ) ) ; END_IF ; END_IF ; END_IF ; END_IF ; END_FUNCTION; -- suitably_based_mechanism |
|
public class FSuitably_based_mechanism public static Value run(SdaiContext _context, Value mbp, Value mech) |