0
$\begingroup$

Rosanswers logo

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


Originally posted by Amal on ROS Answers with karma: 229 on 2012-11-29

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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).


Originally posted by moritz with karma: 2673 on 2012-11-29

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by Amal on 2012-11-29:
do you want to say that it is not necessary to create a package and can call what I need from KnowRob ?!

Comment by moritz on 2012-11-29:
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).

Comment by Amal on 2012-11-29:
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 ?!

Comment by moritz on 2012-11-29:
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.

Comment by Amal on 2012-11-29:
Thank for Ur help, I will start from It. :)

Comment by Amal on 2013-01-29:
What is difference between module.pl and module.pl.in ?!

Comment by moritz on 2013-01-29:
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.

Comment by Amal on 2013-01-30:
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?

Comment by moritz on 2013-01-30:
The prolog files like comp_spatial.pl contain predicate definitions (~ 'program code'). To understand these programs, you will need to learn some Prolog, for example using the tutorials I've recommended to you in earlier answers or in the KnowRob documentation.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.