Ask Your Question
0

How to load KnowRob to My package ?!

asked 2012-11-29 06:08:21 -0600

آمال gravatar image

Hi,

I create a Test package and want to load KnowRob system to it. So ((1)) How to do this?!!

((2)) What dependencies I have to define, I define
std_msgs roslang rospy roscpp


My system: I work in Ubuntu 12.o4 and install fuerte. In home I have a ros which contain KnowRob, RoboEarth, and ccny_vision . I add to it sandbox and create my test package in this sandbox

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
3

answered 2012-11-29 14:24:13 -0600

moritz gravatar image

The answer depends on which kind of package you would like to create:

(1) If the package implements new Prolog functionality or contains custom OWL files, you should create a package similar to e.g. comp_spatial. It should be a normal ROS package that, in addition, contains the following files:

|- owl
|  \- your_file.owl
|- prolog
   |- init.pl
   \- your_module.pl

The init.pl should initialize the package, which may include loading dependencies, parsing OWL files, and registering RDF namespaces. Have a look at e.g. comp_spatial for an example. The owl.in or pl.in files you will find in some packages are required since the RDF parser needs global paths for loading files referenced by an OWL file. owl.in files therefore contain a placeholder that is replaced during compilation as specified in your CMakeLists.txt. Once you have set up your package like this, you can launch the system using rosrun rosprolog rosprolog your_package

(2) If you would just like to use existing packages in your program, e.g. to send queries via jpl or to call Java methods in one of the packages, it's enough to just depend on the KnowRob package.

Regarding which package to depend on, this depends on which functionality you would like to use. You just need to list the direct dependencies in your manifest, their dependencies are automatically included as well. Common candidates could be to depend on mod_vis (if you would like to use the visualization somewhere) or on ias_semantic_map (if you would like to use that map).

edit flag offensive delete link more

Comments

do you want to say that it is not necessary to create a package and can call what I need from KnowRob ?!

آمال gravatar imageآمال ( 2012-11-29 19:09:46 -0600 )edit
1

I am saying that, depending on what you would like to do, you either create a KnowRob-like package (option 1, when you'd like to extend KnowRob) or put your code into a normal ROS package, depend on KnowRob packages, and call methods from those (option 2, if you just want to use parts of KnowRob).

moritz gravatar imagemoritz ( 2012-11-29 19:16:31 -0600 )edit

OK at first stage I want to just use existing packages but not to query in terminal, I want to write a program that call nodes. where can write this program ?!

آمال gravatar imageآمال ( 2012-11-29 19:24:15 -0600 )edit
1

You mean you'd like to send queries via ROS instead of interactively at the terminal? Then have a look at http://ros.org/wiki/json_prolog and especially the example clients in that package.

moritz gravatar imagemoritz ( 2012-11-29 19:27:05 -0600 )edit

Thank for Ur help, I will start from It. :)

آمال gravatar imageآمال ( 2012-11-29 19:28:46 -0600 )edit

What is difference between module.pl and module.pl.in ?!

آمال gravatar imageآمال ( 2013-01-29 07:14:48 -0600 )edit

Quoting from my anshwer: "owl.in files therefore contain a placeholder that is replaced during compilation as specified in your CMakeLists.txt.". If you need to have global paths in your .pl file, you can create a .pl.in file with a placeholder and generate the .pl from it.

moritz gravatar imagemoritz ( 2013-01-29 07:49:30 -0600 )edit

Local Path if will use the owl of the package but Global if need owl from other package, and the same in parsing ?that is right

what is the justification of module.pl ?! I open the comp_spatial.pl in in comp_spacial package I think that is like a steps of processing, how to understand this file?

آمال gravatar imageآمال ( 2013-01-30 12:28:43 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2012-11-29 06:08:21 -0600

Seen: 205 times

Last updated: Nov 29 '12