ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

How to create a valid semantic map owl file and visualize the map in knowrob visualization tool?

asked 2012-10-23 18:15:31 -0600

updated 2012-10-23 21:23:35 -0600

Hello, I am writing a semantic map application to learn how it works.

My process is

Perception : 
    use kinect to get point cloud data of a scene
Recognition: 
    send service request to /object_detection to get object_id, 
    send service request to /objects_database_node/get_model_description to get object name
Create semantic map :
    use OWL API to store the data in a semantic map file
Visualization:
    use visualization module provided by knowrob to check the result
    (so my semantic map file format must fit what this tool need)

Now I already finish the perception part and recognition part, and I want to store the data I got in a semantic map file(For example, if I got only one object perceived, I will store class, individual name, position, size in my semantic map).

In my understanding, the object name I got from /objects_database_node/get_model_description is the class of this object, and this may not be a valid type for visualization module.(Actually I am not familiar with OWL API right now, and I haven't create a semantic map by OWL API that can be visualized in knowrob visualization tool, I traced the code of SemanticMapEditor in mod_semantic_map package, but it's kind of difficult for me.)

My question is, how to store the object name as a class in semantic map (along with name, position and size, of course) and visualize the map correctly?

Any help is welcomed, Thanks.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2012-10-23 18:28:20 -0600

moritz gravatar image

updated 2012-10-23 18:28:42 -0600

The probably easiest way to get a valid OWL file is to use the SemanticMapToOWL ROS service described here: http://ias.in.tum.de/kb/wiki/index.php/Mod_semantic_map#SemanticMapToOWL If you do not want to use the service, you can still have a look at how the OWL is generated using the OWLAPI, but since the internal object representation is quite a complex thing, I'd recommend to start with that service.

The object type that you get from the perception system indeed corresponds to the object class in KnowRob. If the identifiers do not match, you need to create a mapping at some point; if you use the conversion service, the easiest place would be to have the mapping in your code for now. You can get a list of all object classes in KnowRob using the following command:

$ rosrun mod_semantic_map SemanticMapToOWL list

The visualization module only supports a subset of these classes. We currently have two ways to define how an item is to be visualized: the legacy version used custom Java classes that draw the item to the visualization, see here:

$ roscd mod_vis/src/de/tum/in/fipm/kipm/gui/visualisation/items

We are currently switching to a more flexible system based on CAD models (e.g. Collada). To make this work, you need to specify the path to the model as a property of the respective instance or class, see the lower part of this file for an example:

knowrob_cad_models/owl/knowrob_cad_models.owl.in

edit flag offensive delete link more

Comments

Thanks!I think I need some time to try out~

Po-Jen Lai gravatar image Po-Jen Lai  ( 2012-10-23 18:31:32 -0600 )edit

I ran $rosrun mod_semantic_map SemanticMapToOWL list (I also tried the launch file in mod_semantic_map), but I wait over 10 mins and I haven't got the list. Is this situation normal?
I already know the classes in mod_vis/src/.../items, so this is not a big problem, just curious.Thanks!

Po-Jen Lai gravatar image Po-Jen Lai  ( 2012-10-23 19:04:18 -0600 )edit

You did run it without the dollar sign, right? That just indicates "run in a terminal as normal user". It should return quickly, i.e. in a few seconds max.

moritz gravatar image moritz  ( 2012-10-23 19:15:03 -0600 )edit

I ran "roscore" in first terminal and "rosrun mod_semantic_map SemanticMapToOWL list" in second terminal.I'll try on my another computer.

Po-Jen Lai gravatar image Po-Jen Lai  ( 2012-10-23 23:04:21 -0600 )edit

Thank you! I created the map successfully and visualized it in knowrob visualization canvas.

Po-Jen Lai gravatar image Po-Jen Lai  ( 2012-10-24 02:38:02 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2012-10-23 18:15:31 -0600

Seen: 1,101 times

Last updated: Oct 23 '12