Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
srdl_extensions [2013/02/12 17:41] – external edit 127.0.0.1srdl_extensions [2014/06/05 11:38] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== SRDL extensions ====== +#REDIRECT doc:srdl_extensions
- +
-This page describes work in progress by P. Freyer on extensions of SRDL towards matching based on continuous values and towards selection among multiple matching solutions. +
- +
-===== Defining requirements on attributes of components or component types ===== +
- +
-In order to define requirements that not only check the existence of a specific component but also check, if a component of a specific type is available and if it meets a specific set of requirements (e.g. a laser scanner with a minimum range of 0.01 metres), some new SRDL2 Prolog methods and schema additions got introduced. +
- +
-==== Defining an attribute requirement in *.owl files ==== +
- +
-SRDL2 so far only knows restrictions on the existence of some components, as can be seen below: +
- +
-    <owl:Class rdf:about="http://ias.cs.tum.edu/kb/srdl2-cap.owl#ArmCollisionCheckCapability"> +
-        <rdfs:subClassOf rdf:resource="http://ias.cs.tum.edu/kb/srdl2-cap.owl#CollisionCheckCapability"/> +
-        <rdfs:subClassOf> +
-            <owl:Restriction> +
-                <owl:onProperty rdf:resource="&srdl2-comp;dependsOnComponent"/> +
-                <owl:someValuesFrom rdf:resource="&srdl2-comp;CollisionMap"/> +
-            </owl:Restriction> +
-        </rdfs:subClassOf> +
-    </owl:Class> +
- +
-If a requirement on a components or component types attributes is made, the <owl:allValuesFrom>-tag is used along an anonymous data type with a value range. The following example shows a capability which requires a laser scanner with a specific range: +
- +
-    <owl:Class rdf:about="http://ias.cs.tum.edu/kb/srdl2-cap.owl#RangeTestCapability"> +
-        <rdfs:subClassOf rdf:resource="http://ias.cs.tum.edu/kb/srdl2-cap.owl#BodyMotionCapability"/> +
-        <rdfs:subClassOf> +
-            <owl:Restriction> +
-                <owl:onProperty> +
-                    <owl:DatatypeProperty rdf:resource="&srdl2-comp;LaserScanner#maxRange" /> +
-                </owl:onProperty> +
-                <owl:allValuesFrom> +
-                    <rdfs:Datatype> +
-                        <xsd:restriction base="&xsd;integer" /> +
-                        <xsd:min-inclusive value="9.0" /> +
-                        <xsd:max-inclusive value="11.0" /> +
-                    </rdfs:Datatype> +
-                </owl:allValuesFrom> +
-            </owl:Restriction> +
-        </rdfs:subClassOf> +
-        <rdfs:subClassOf> +
-            <owl:Restriction> +
-                <owl:onProperty> +
-                    <owl:DatatypeProperty rdf:resource="&srdl2-comp;LaserScanner#minRange" /> +
-                </owl:onProperty> +
-                <owl:allValuesFrom> +
-                    <rdfs:Datatype> +
-                        <xsd:restriction base="&xsd;integer" /> +
-                        <xsd:min-inclusive value="0.05" /> +
-                        <xsd:max-inclusive value="0.1" /> +
-                    </rdfs:Datatype> +
-                </owl:allValuesFrom> +
-            </owl:Restriction> +
-        </rdfs:subClassOf> +
-    </owl:Class> +
- +
-Please notice, that the attributes name is appended with a '#' to the component name or type in the <owl:onProperty>-section. If the long URL is used, there are two '#'-signs in the name (e.g. 'http://ias.cs.tum.edu/kb/srdl2-comp.owl#LaserScanner#minRange'), which may look unusual at first. +
- +
-The allowed range on the requirement attribute is then defined in the <owl:allValuesFrom>-section as an anonymous data type (named data types are also possible but can then contain only one min and max deinition). Data values can be restricted using the following tags: +
-  * <xsd:min-inclusive> +
-  * <xsd:min-exclusive> +
-  * <xsd:max-exclusive> +
-  * <xsd:max-inclusive> +
- +
-All of these tags are optional, so a range with only a minimum or a maximum value can also be defined. +
- +
-==== Defining requirements on pose and size attributes of components or component types in *.owl-files ==== +
- +
-Not only the attributes of a components requirement are of interest for requirement definition. +
-Sometimes the size or position of a robot or its components can also be of interest. +
- +
-A map of a room, for example, can look very different, depending on the height, it is created at. If a big robot creates a map using a laser scanner 1 meter above the ground, this map should not be used for a robot, that is only 0.2 meter high. This robot may have problems with obstacles much smaller than 1 meter and thus not in the previously created map. Instead, the small robot should use a different map, that was created at a much lower level of height. On the other hand, a map, that was created 0.02 meters above the ground may contain obstacles, such as door stoppers, which simply are of no interest to a big robot, which would just roll over it. +
- +
-In order to define requirements on the pose and size of a component, special robot attributes got introduced. They can be defined and used same as the normal component attributes. The prolog routines branch these attributes to a different mechanism which analyses the pose matrices that are saved with a robot to get information on the X, Y and Z position and dimension of components or the robot itself. +
- +
-These attributes are: +
-  * 3DPoseXPosition +
-    * Checks, if the position of a component on the robot is within a specific range on the X axis +
-  * 3DPoseYPosition +
-    * Checks, if the position of a component on the robot is within a specific range on the Y axis +
-  * 3DPoseZPosition +
-  * 3DPoseHeightAboveGround ''(Alternative Name)'' +
-    * Checks, if the position of a component on the robot is within a specific range on the Z axis +
-  * 3DPoseXLength +
-  * 3DPoseWidth ''(Alternative Name)'' +
-    * Checks, if the size of a component along the X axis is within a specified range +
-  * 3DPoseYLength +
-  * 3DPoseDepth ''(Alternative Name)'' +
-    * Checks, if the size of a component along the Y axis is within a specified range +
-  * 3DPoseZLength +
-  * 3DPoseHeight ''(Alternative Name)'' +
-    * Checks, if the size of a component along the Z axis is within a specified range +
-  * IsTiltable +
-    * Is 1, if any of the preceeding joints is a RevoluteUrdfJoint or a ContinuousUrdfJoint, otherwise, it is 0 +
-  * 3DOrientationX +
-    * Rotation around the X axis. 0 is at the Z axis. Rotation is CCW along the axis, values are in range [0;360[ +
-  * 3DOrientationY +
-    * Rotation around the Y axis. 0 is at the X axis. Rotation is CCW along the axis, values are in range [0;360[ +
-  * 3DOrientationZ +
-    * Rotation around the Z axis. 0 is at the Y axis. Rotation is CCW along the axis, values are in range [0;360[ +
- +
-==== Example OWL specifications ==== +
- +
-=== Example: Pose test using an alternative name === +
- +
-    <owl:Class rdf:about="http://ias.cs.tum.edu/kb/srdl2-cap.owl#HeightTestCapability"> +
-        <rdfs:subClassOf rdf:resource="http://ias.cs.tum.edu/kb/srdl2-cap.owl#BodyMotionCapability"/> +
-        <rdfs:subClassOf> +
-            <owl:Restriction> +
-                <owl:onProperty> +
-                    <owl:DatatypeProperty rdf:resource="&srdl2-comp;LaserScanner#3DPoseHeightAboveGround" /> +
-                </owl:onProperty> +
-                <owl:allValuesFrom> +
-                    <rdfs:Datatype> +
-                        <xsd:restriction base="&xsd;double" /> +
-                        <xsd:min-inclusive value="0.2" /> +
-                        <xsd:max-inclusive value="0.4" /> +
-                    </rdfs:Datatype> +
-                </owl:allValuesFrom> +
-            </owl:Restriction> +
-        </rdfs:subClassOf> +
-    </owl:Class> +
- +
-=== Example: Pose test === +
- +
-    <owl:Class rdf:about="http://ias.cs.tum.edu/kb/srdl2-cap.owl#PoseTestCapability"> +
-        <rdfs:subClassOf rdf:resource="http://ias.cs.tum.edu/kb/srdl2-cap.owl#BodyMotionCapability"/> +
-        <rdfs:subClassOf> +
-            <owl:Restriction> +
-                <owl:onProperty> +
-                    <owl:DatatypeProperty rdf:resource="&srdl2-comp;LaserScanner#3DPoseXPosition" /> +
-                </owl:onProperty> +
-                <owl:allValuesFrom> +
-                    <rdfs:Datatype> +
-                        <xsd:restriction base="&xsd;double" /> +
-                        <xsd:min-inclusive value="0.2" /> +
-                        <xsd:max-inclusive value="0.3" /> +
-                    </rdfs:Datatype> +
-                </owl:allValuesFrom> +
-            </owl:Restriction> +
-        </rdfs:subClassOf> +
-        <rdfs:subClassOf> +
-            <owl:Restriction> +
-                <owl:onProperty> +
-                    <owl:DatatypeProperty rdf:resource="&srdl2-comp;LaserScanner#3DPoseYPosition" /> +
-                </owl:onProperty> +
-                <owl:allValuesFrom> +
-                    <rdfs:Datatype> +
-                        <xsd:restriction base="&xsd;double" /> +
-                        <xsd:min-inclusive value="-0.1" /> +
-                        <xsd:max-inclusive value="0.1" /> +
-                    </rdfs:Datatype> +
-                </owl:allValuesFrom> +
-            </owl:Restriction> +
-        </rdfs:subClassOf> +
-        <rdfs:subClassOf> +
-            <owl:Restriction> +
-                <owl:onProperty> +
-                    <owl:DatatypeProperty rdf:resource="&srdl2-comp;LaserScanner#3DPoseZPosition" /> +
-                </owl:onProperty> +
-                <owl:allValuesFrom> +
-                    <rdfs:Datatype> +
-                        <xsd:restriction base="&xsd;double" /> +
-                        <xsd:min-inclusive value="0.2" /> +
-                        <xsd:max-inclusive value="0.4" /> +
-                    </rdfs:Datatype> +
-                </owl:allValuesFrom> +
-            </owl:Restriction> +
-        </rdfs:subClassOf> +
-    </owl:Class> +
- +
-=== Example: Size test === +
- +
-    <owl:Class rdf:about="http://ias.cs.tum.edu/kb/srdl2-cap.owl#SizeTestCapability"> +
-        <rdfs:subClassOf rdf:resource="http://ias.cs.tum.edu/kb/srdl2-cap.owl#BodyMotionCapability"/> +
-        <rdfs:subClassOf> +
-            <owl:Restriction> +
-                <owl:onProperty> +
-                    <owl:DatatypeProperty rdf:resource="http://ias.cs.tum.edu/kb/PR2.owl#PR2#3DPoseWidth" /> +
-                </owl:onProperty> +
-                <owl:allValuesFrom> +
-                    <rdfs:Datatype> +
-                        <xsd:restriction base="&xsd;double" /> +
-                        <xsd:min-inclusive value="0.4" /> +
-                        <xsd:max-inclusive value="0.6" /> +
-                    </rdfs:Datatype> +
-                </owl:allValuesFrom> +
-            </owl:Restriction> +
-        </rdfs:subClassOf> +
-        <rdfs:subClassOf> +
-            <owl:Restriction> +
-                <owl:onProperty> +
-                    <owl:DatatypeProperty rdf:resource="http://ias.cs.tum.edu/kb/PR2.owl#PR2#3DPoseDepth" /> +
-                </owl:onProperty> +
-                <owl:allValuesFrom> +
-                    <rdfs:Datatype> +
-                        <xsd:restriction base="&xsd;double" /> +
-                        <xsd:min-inclusive value="0.5" /> +
-                        <xsd:max-inclusive value="0.7" /> +
-                    </rdfs:Datatype> +
-                </owl:allValuesFrom> +
-            </owl:Restriction> +
-        </rdfs:subClassOf> +
-        <rdfs:subClassOf> +
-            <owl:Restriction> +
-                <owl:onProperty> +
-                    <owl:DatatypeProperty rdf:resource="http://ias.cs.tum.edu/kb/PR2.owl#PR2#3DPoseHeight" /> +
-                </owl:onProperty> +
-                <owl:allValuesFrom> +
-                    <rdfs:Datatype> +
-                        <xsd:restriction base="&xsd;double" /> +
-                        <xsd:min-inclusive value="0.7" /> +
-                        <xsd:max-inclusive value="0.9" /> +
-                    </rdfs:Datatype> +
-                </owl:allValuesFrom> +
-            </owl:Restriction> +
-        </rdfs:subClassOf> +
-    </owl:Class> +
- +
-=== Example: Orientation test === +
- +
-    <owl:Class rdf:about="http://ias.cs.tum.edu/kb/srdl2-cap.owl#OrientationTestCapability"> +
-        <rdfs:subClassOf rdf:resource="http://ias.cs.tum.edu/kb/srdl2-cap.owl#BodyMotionCapability"/> +
-        <rdfs:subClassOf> +
-            <owl:Restriction> +
-                <owl:onProperty> +
-                    <owl:DatatypeProperty rdf:resource="&srdl2-comp;LaserScanner#3DOrientationX" /> +
-                </owl:onProperty> +
-                <owl:allValuesFrom> +
-                    <rdfs:Datatype> +
-                        <xsd:restriction base="&xsd;double" /> +
-                        <xsd:min-inclusive value="0.0" /> +
-                        <xsd:max-inclusive value="0.0" /> +
-                    </rdfs:Datatype> +
-                </owl:allValuesFrom> +
-            </owl:Restriction> +
-        </rdfs:subClassOf> +
-        <rdfs:subClassOf> +
-            <owl:Restriction> +
-                <owl:onProperty> +
-                    <owl:DatatypeProperty rdf:resource="&srdl2-comp;LaserScanner#3DOrientationY" /> +
-                </owl:onProperty> +
-                <owl:allValuesFrom> +
-                    <rdfs:Datatype> +
-                        <xsd:restriction base="&xsd;double" /> +
-                        <xsd:min-inclusive value="0.0" /> +
-                        <xsd:max-inclusive value="0.0" /> +
-                    </rdfs:Datatype> +
-                </owl:allValuesFrom> +
-            </owl:Restriction> +
-        </rdfs:subClassOf> +
-        <rdfs:subClassOf> +
-            <owl:Restriction> +
-                <owl:onProperty> +
-                    <owl:DatatypeProperty rdf:resource="&srdl2-comp;LaserScanner#3DOrientationZ" /> +
-                </owl:onProperty> +
-                <owl:allValuesFrom> +
-                    <rdfs:Datatype> +
-                        <xsd:restriction base="&xsd;double" /> +
-                        <xsd:min-inclusive value="300.0" /> +
-                        <xsd:max-inclusive value="310.0" /> +
-                    </rdfs:Datatype> +
-                </owl:allValuesFrom> +
-            </owl:Restriction> +
-        </rdfs:subClassOf> +
-    </owl:Class> +
- +
-==== Testing requirements on attributes and a components pose and size in prolog ==== +
- +
-Testing, if a capability is available on a robot did not change at all. The method just got extended and now tests attribute and pose requirements, too. +
- +
-=== Attribute test === +
- +
-  srdl2:cap_available_on_robot('http://ias.cs.tum.edu/kb/srdl2-cap.owl#RangeTestCapability',  +
-                               'http://ias.cs.tum.edu/kb/PR2.owl#PR2_robot1'). +
- +
-=== Pose test === +
- +
-  srdl2:cap_available_on_robot('http://ias.cs.tum.edu/kb/srdl2-cap.owl#PoseTestCapability',  +
-                               'http://ias.cs.tum.edu/kb/PR2.owl#PR2_robot1'). +
- +
-  srdl2:cap_available_on_robot('http://ias.cs.tum.edu/kb/srdl2-cap.owl#HeightTestCapability',  +
-                               'http://ias.cs.tum.edu/kb/PR2.owl#PR2_robot1'). +
- +
-=== Size test === +
- +
-  srdl2:cap_available_on_robot('http://ias.cs.tum.edu/kb/srdl2-cap.owl#SizeTestCapability',  +
-                               'http://ias.cs.tum.edu/kb/PR2.owl#PR2_robot1'). +
- +
-=== Orientation test === +
- +
-  srdl2:cap_available_on_robot('http://ias.cs.tum.edu/kb/srdl2-cap.owl#OrientationTestCapability',  +
-                               'http://ias.cs.tum.edu/kb/PR2.owl#PR2_robot1'). +
- +
-If the files of Philipps SVN branch are being used, all of these lines should return "True". If a "2" is being appended on a tests name, "False" should be the result. +
- +
-E.g.: +
- +
-  srdl2:cap_available_on_robot('http://ias.cs.tum.edu/kb/srdl2-cap.owl#RangeTestCapability2',  +
-                               'http://ias.cs.tum.edu/kb/PR2.owl#PR2_robot1'). +
- +
- +
- +
-Some new methods got introduced for detailed checks: +
- +
-  * subcomponent_list(Object, FullList) +
-    * Determines a full list of subcomponents for a given object. This list is determined recursively over all subcomponents with the given object as the root. +
- +
-  * component_list_to_dimension_list_X(ComponentList, DimensionList) +
-  * component_list_to_dimension_list_Y(ComponentList, DimensionList) +
-  * component_list_to_dimension_list_Z(ComponentList, DimensionList) +
-    * Converts a list of components to a list of dimension informations (position), the components have +
- +
-  * maxdim(DimensionList, dimension(Min, Max)) +
-  * maxdim(dimension(Min1, Max1), dimension(Min2, Max2), dimension(MinResult, MaxResult)) +
-    * determines the global maximum and minimum of the given dimensions +
- +
-  * object_pose_X(Object, X) +
-  * object_pose_Y(Object, Y) +
-  * object_pose_Z(Object, Z) +
-  * object_pose_Point(Object, [x, y, z]) +
-    * Determines the (X/Y/Z) position of a given Component +
- +
-  * object_angle_X(Object, X) +
-  * object_angle_Y(Object, Y) +
-  * object_angle_Z(Object, Z) +
-    * Determines the rotation around the (X/Y/Z) axis of a given Component +
- +
-  * object_pose_X_dim(Object, dimension(Min, Max)) +
-  * object_pose_Y_dim(Object, dimension(Min, Max)) +
-  * object_pose_Z_dim(Object, dimension(Min, Max)) +
-    * Determines the size of an object as dimension(Min, Max)-values +
- +
-  * object_pose_X_length(Object, Length) +
-  * object_pose_Y_length(Object, Length) +
-  * object_pose_Z_length(Object, Length) +
-    * Determines the size of an object as length value +
- +
-===== Tool changes by P. Freyer ===== +
- +
-In addition to the changes, that are done on SRDL itself, some tools along SRDL got changed, too. +
- +
-==== Changes in the URDF->SRDL importer ==== +
- +
-The URDL2SRDL importer converts *.urdf-files to the *.owl-file format. This tool was originally developed by Alexander Perzylo. In order to be able to define requirements on a components attributes, it had to also convert these attributes into the SRDL files. +
- +
-These attributes are not a part of the URDL description files as such but are added there by [[http://www.ros.org/wiki/gazebo|Gazebo]] in order to use the URDF file to create a functional robot model for simulations. +
- +
-Gazebo adds these additional attributes in its own <gazebo>...</gazebo>-Tags, which get parsed by the converter, if they are available. The <gazebo>-Tags hold one or more sub-Tags of the form <name>Value</name>, which contain the attributes for a component. They may also contain <controller:...>...</controller:...>-tags or <sensor:...>...</sensor:...>-tags which contain additional information on a specific components function. The <sensor:...>-tags are also used to specify a components type, a <sensor:ray>-Tag for example shows that the according component may be a laser scanner. +
- +
-New features of the URDF2SRDL importer: +
- +
-  * Read the content of the <gazebo>-tags for a components attributes +
-  * Use the <sensor:...>-tags to determine a components type +
-  * Use the appearance of a value to define its datatype +
-  * Use the name or part of the name of some attributes to determine the datatype of its value +
-  * Include all of these informations into the *.owl output file+