Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 2012-08-07 04:38:30 -0600

sam gravatar image

How to run knowrob without shell but using prolog language?

If I want to load knowrob system to run prolog src to do the following thing:

  owl_parser:owl_parse('/home/sam/code/ros/ai/owl/sam_world.owl', false, false, true).

How to run knowrob just loading pl file without login to a shell?

Thank you~

How to run knowrob without shell but using prolog language?

If I want to load knowrob system to run prolog src to do the following thing:

  owl_parser:owl_parse('/home/sam/code/ros/ai/owl/sam_world.owl', false, false, true).

How to run knowrob just loading pl file without login to a shell?

Thank you~


I follow @Lorenz answer.

I create ros package: sam_knowrob_test

my init.pl

  register_ros_package(mod_vis).
  register_ros_package(ias_semantic_map).
  visualisation_canvas(C).

I run rosrun command,but it couldn't show Semantic map:

  sam@sam:~/code/ros/ai$ rosrun rosprolog rosprolog sam_knowrob_test
  % library(swi_hooks) compiled into pce_swi_hooks 0.00 sec, 3,616 bytes
  %     library(error) compiled into error 0.00 sec, 17,688 bytes
  %    library(lists) compiled into lists 0.01 sec, 41,424 bytes
  %   library(shlib) compiled into shlib 0.01 sec, 62,200 bytes
  %   library(option) compiled into swi_option 0.00 sec, 15,080 bytes
  %  library(process) compiled into process 0.01 sec, 93,400 bytes
  % /opt/ros/electric/stacks/knowrob/rosprolog/prolog/init.pl compiled 0.01 sec, 100,848 bytes
  Warning: /home/sam/code/ros/ai/knowrob/sam_knowrob_test/prolog/init.pl:1:
    Redefined static procedure register_ros_package/1
  Warning: /home/sam/code/ros/ai/knowrob/sam_knowrob_test/prolog/init.pl:3:
    Singleton variables: [C]
  % /home/sam/code/ros/ai/knowrob/sam_knowrob_test/prolog/init.pl compiled 0.00 sec, 960 bytes
  ?-

It also show warning:

 Singleton variables: [C]

I try to run by input but nothing happened:

  ?- register_ros_package(mod_vis).
  true .

  ?- register_ros_package(ias_semantic_map).
  true.

  ?- visualisation_canvas(C).
  true.

  ?-

Why it couldn't show semantic map?

How to fixed it?

Thank you~

How to run knowrob without shell but using prolog language?

If I want to load knowrob system to run prolog src to do the following thing:

  owl_parser:owl_parse('/home/sam/code/ros/ai/owl/sam_world.owl', false, false, true).

How to run knowrob just loading pl file without login to a shell?

Thank you~


I follow @Lorenz answer.

I create ros package: sam_knowrob_test

my init.pl

  register_ros_package(mod_vis).
  register_ros_package(ias_semantic_map).
  visualisation_canvas(C).

I run rosrun command,but it couldn't show Semantic map:

  sam@sam:~/code/ros/ai$ rosrun rosprolog rosprolog sam_knowrob_test
  % library(swi_hooks) compiled into pce_swi_hooks 0.00 sec, 3,616 bytes
  %     library(error) compiled into error 0.00 sec, 17,688 bytes
  %    library(lists) compiled into lists 0.01 sec, 41,424 bytes
  %   library(shlib) compiled into shlib 0.01 sec, 62,200 bytes
  %   library(option) compiled into swi_option 0.00 sec, 15,080 bytes
  %  library(process) compiled into process 0.01 sec, 93,400 bytes
  % /opt/ros/electric/stacks/knowrob/rosprolog/prolog/init.pl compiled 0.01 sec, 100,848 bytes
  Warning: /home/sam/code/ros/ai/knowrob/sam_knowrob_test/prolog/init.pl:1:
    Redefined static procedure register_ros_package/1
  Warning: /home/sam/code/ros/ai/knowrob/sam_knowrob_test/prolog/init.pl:3:
    Singleton variables: [C]
  % /home/sam/code/ros/ai/knowrob/sam_knowrob_test/prolog/init.pl compiled 0.00 sec, 960 bytes
  ?-

It also show warning:

 Singleton variables: [C]

I try to run by input but nothing happened:

  ?- register_ros_package(mod_vis).
  true .

  ?- register_ros_package(ias_semantic_map).
  true.

  ?- visualisation_canvas(C).
  true.

  ?-

Why it couldn't show semantic map?

How to fixed it?

Thank you~


  sam@sam:~/code/ros/ai$ rosrun rosprolog rosprolog sam_knowrob_test
  % library(swi_hooks) compiled into pce_swi_hooks 0.00 sec, 3,616 bytes
  %     library(error) compiled into error 0.00 sec, 17,688 bytes
  %    library(lists) compiled into lists 0.00 sec, 41,424 bytes
  %   library(shlib) compiled into shlib 0.00 sec, 62,200 bytes
  %   library(option) compiled into swi_option 0.01 sec, 15,080 bytes
  %  library(process) compiled into process 0.01 sec, 93,400 bytes
  % /opt/ros/electric/stacks/knowrob/rosprolog/prolog/init.pl compiled 0.01 sec, 100,848 bytes
  %     library(jpl) compiled into jpl 0.02 sec, 285,496 bytes
  %         library(sgml) compiled into sgml 0.01 sec, 38,464 bytes
  %           library(quintus) compiled into quintus 0.00 sec, 21,384 bytes
  %          rewrite compiled into rewrite 0.00 sec, 34,736 bytes
  %          library(uri) compiled into uri 0.00 sec, 10,880 bytes
  %          library(record) compiled into record 0.00 sec, 31,072 bytes
  %         rdf_parser compiled into rdf_parser 0.01 sec, 145,344 bytes
  %          library(gensym) compiled into gensym 0.00 sec, 4,432 bytes
  %         rdf_triple compiled into rdf_triple 0.00 sec, 37,168 bytes
  %        library(rdf) compiled into rdf 0.02 sec, 271,184 bytes
  %         library(debug) compiled into prolog_debug 0.00 sec, 21,320 bytes
  %         library(assoc) compiled into assoc 0.00 sec, 22,640 bytes
  %        library(sgml_write) compiled into sgml_write 0.01 sec, 105,192 bytes
  %        library(nb_set) compiled into nb_set 0.00 sec, 5,968 bytes
  %         library(utf8) compiled into utf8 0.00 sec, 14,112 bytes
  %        library(url) compiled into url 0.00 sec, 113,536 bytes
  %        rdf_cache compiled into rdf_cache 0.00 sec, 15,904 bytes
  %       library(semweb/rdf_db) compiled into rdf_db 0.04 sec, 680,768 bytes
  %      comp_similarity compiled into comp_similarity 0.04 sec, 708,256 bytes
  %     /opt/ros/electric/stacks/knowrob/ias_prolog_addons/prolog/init.pl compiled 0.04 sec, 709,136 bytes
  %      library(broadcast) compiled into broadcast 0.00 sec, 7,344 bytes
  %     library(semweb/rdf_edit) compiled into rdf_edit 0.01 sec, 86,712 bytes
  %     library(semweb/rdfs) compiled into rdfs 0.00 sec, 25,992 bytes
  %     library(semweb/owl) compiled into t20_owl 0.01 sec, 68,496 bytes
  %       library(socket) compiled into socket 0.00 sec, 10,232 bytes
  %       library(base64) compiled into base64 0.00 sec, 17,400 bytes
  %      library(http/http_open.pl) compiled into http_open 0.00 sec, 77,056 bytes
  %     library(thea/owl_parser) compiled into owl_parser 0.01 sec, 155,976 bytes
  %      library(odbc) compiled into odbc 0.00 sec, 37,344 bytes
  %     library(semweb/rdfs_computable) compiled into rdfs_computable 0.00 sec, 87,488 bytes
  %    /opt/ros/electric/stacks/knowrob/semweb/prolog/init.pl compiled 0.09 sec, 1,463,728 bytes
  %        library(tf_prolog) compiled into tf_prolog 0.00 sec, 19,296 bytes
  %       /opt/ros/electric/stacks/knowrob/tf_prolog/prolog/init.pl compiled 0.00 sec, 20,424 bytes
  %        library(knowrob_owl) compiled into knowrob_owl 0.00 sec, 13,512 bytes
  %        library(knowrob_perception) compiled into knowrob_perception 0.01 sec, 22,128 bytes
  %       library(knowrob_objects) compiled into knowrob_objects 0.01 sec, 79,728 bytes
  %       library(knowrob_coordinates) compiled into knowrob_coordinates 0.00 sec, 18,048 bytes
  %      /opt/ros/electric/stacks/knowrob/knowrob_objects/prolog/init.pl compiled 0.01 sec, 128,752 bytes
  %      library(knowrob_actions) compiled into knowrob_actions 0.00 sec, 12,600 bytes
  %     /opt/ros/electric/stacks/knowrob/knowrob_actions/prolog/init.pl compiled 0.01 sec, 151,400 bytes
  %      library(util) compiled into util 0.01 sec, 27,328 bytes
  %     library(classifiers) compiled into classifiers 0.01 sec, 47,880 bytes
  %     library(jython) compiled into jython 0.00 sec, 24,256 bytes
  % Parsed "owl.owl" in 0.00 sec; 169 triples
  % Parsed "rdf-schema.xml" in 0.00 sec; 87 triples
  % Parsed "knowrob.owl" in 0.07 sec; 3,721 triples
  %    /opt/ros/electric/stacks/knowrob/ias_knowledge_base/prolog/init.pl compiled 0.63 sec, 1,988,552 bytes
  %    library(owl_export) compiled into owl_export 0.00 sec, 22,520 bytes
  %   /opt/ros/electric/stacks/knowrob/knowrob_common/prolog/init.pl compiled 0.73 sec, 3,490,280 bytes
  %   library(mod_vis) compiled into mod_vis 0.00 sec, 44,184 bytes
  %  /opt/ros/electric/stacks/knowrob/mod_vis/prolog/init.pl compiled 0.73 sec, 3,543,048 bytes
  % Parsed "comp_temporal.owl" in 0.01 sec; 164 triples
  %     library(comp_temporal) compiled into comp_temporal 0.59 sec, 328,520 bytes
  %    /opt/ros/electric/stacks/knowrob/comp_temporal/prolog/init.pl compiled 0.75 sec, 479,384 bytes
  % Parsed "comp_spatial.owl" in 0.01 sec; 459 triples
  %    library(comp_spatial) compiled into comp_spatial 0.21 sec, 371,056 bytes
  %   /opt/ros/electric/stacks/knowrob/comp_spatial/prolog/init.pl compiled 1.13 sec, 1,008,568 bytes
  %    library(semweb/actionmodel) compiled into actionmodel 0.01 sec, 106,696 bytes
  % Parsed "ccrl2_semantic_map.owl" in 0.03 sec; 2,226 triples
  %   ccrl2_semantic_map compiled 0.58 sec, 1,042,856 bytes
  %   semantic_map_utils compiled into ias_semantic_map 0.00 sec, 15,136 bytes
  %  /opt/ros/electric/stacks/knowrob/ias_semantic_map/prolog/init.pl compiled 1.72 sec, 2,077,408 bytes
  Warning: /home/sam/code/ros/ai/knowrob/sam_knowrob_test/prolog/init.pl:3:
    Singleton variables: [C]
  ControlP5 0.5.4 infos, comments, questions at http://www.sojamo.de/libraries/controlP5
  PeasyCam v105
  2012/8/8 下午 11:35:47 controlP5.ControlWindow init
  資訊: You are using renderer processing.core.PGraphics3D.
  In order to render controlP5 elements you need to call the ControlP5's draw() manually.
  Suggestion is to put controlP5.draw(); at the bottom of the draw function of your sketch.
  ERROR: /home/sam/code/ros/ai/knowrob/sam_knowrob_test/prolog/init.pl:3:
    Java exception: java.lang.UnsatisfiedLinkError: no jpl in java.library.path
  Warning: /home/sam/code/ros/ai/knowrob/sam_knowrob_test/prolog/init.pl:3:
    Goal (directive) failed: user:visualisation_canvas(_G209)
  % /home/sam/code/ros/ai/knowrob/sam_knowrob_test/prolog/init.pl compiled 3.88 sec, 6,740,064 bytes
  ?-

How to fix this error?

  ERROR: /home/sam/code/ros/ai/knowrob/sam_knowrob_test/prolog/init.pl:3:
    Java exception: java.lang.UnsatisfiedLinkError: no jpl in java.library.path

Thank you~