Describe your environment
There is no place like 127.0.0.1
Describe your object
Now that we have a CAD model, we have to make all the information about it available to all our components, and especially to Overworld. In the same way we did for the robot, we will describe the object using the ontology.
Create the ontology
Here we will not describe an entire environment which will be too long but we will just create four frames using the meshes we created before. The idea here is to see how to link the meshes to instantiated entities and how to apply colors on.
Let's create a new ontology file called "env.owl" in the "ontologies" folder. Then paste the following in.
Once again, the file begins with some namespaces declaration and some imports. The only difference with the agents one is that we will use the "CG_objects" which is the subpart of the common ground ontology dedicated to objects' description.
The following is the description of the classes of our ontology. The common ground ontology already provides several objects like tables, boxes, and mugs. Looking at the CG_building part, you can also find some descriptions of building parts like floor, door, or window. Nevertheless, here we do not use one of these and we create a new class named "Frame" inheriting directly from the "Object" class.
The important thing to be noticed with our "Frame" class is the relation applied to it. We use the data property hasMesh to attach our OBJ mesh directly to the class. This means that any frame entity will have a default mesh being this one.
In the following, we describe our individuals with four frame instances. The frame_obj is just declared as a Frame and will thus use the mesh defined by the class. The frame_stl overwrites the hasMesh relation by using the STL mesh. When it will be loaded, this will thus be the STL mesh which will be used instead of the OBJ one.
With the frame_green and frame_redindividuals, we do the same as the previous ones but we add to them a new relation using the object property hasColor. If a color is defined, Overworld will use it to apply it to the mesh. If needed you can define several color to an object but Overworld will only apply one of them.
Creating new colors
The common ground ontology already defines several colors in the "CG_entities" part but you can use new ones if needed. Here bellow you can find a color description example.
The only important thing to notice if you want to define additional colors, is the use of the hexRgbValue data property. Overworld does not have any hard-coded information about color and thus uses the ontology. With the hexRgbValue, we thus provide the RGB color code of each color allowing Overworld to apply this color code when we apply a semantic color to an object.