0
$\begingroup$

Rosanswers logo

Dear all,

I correctly installed knowrob and knowrob tutorials. (No warning and errors!) Following this question, http://answers.ros.org/question/47289/how-to-add-statements-through-json_prolog/, I tried to run tutoria.launch, because I'm interested in quering ontology using Ros services. So I computed

roslaunch tutorial.launch 

and I get

started roslaunch server http://192.168.10.11:40049/

SUMMARY
========

PARAMETERS
 * /rosdistro
 * /rosversion

NODES
  /
    json_prolog (rosprolog/run_with_prolog_env)

ROS_MASTER_URI=http://192.168.10.10:11311

core service [/rosout] found
process[json_prolog-1]: started with pid [12253]
[FATAL ERROR:
    Not a SWI-Prolog saved state]
[json_prolog-1] process has died [pid 12253, exit code 2, cmd /opt/ros/fuerte/stacks/knowrob/rosprolog/scripts/run_with_prolog_env ias_semantic_map /opt/ros/fuerte/stacks/knowrob/json_prolog/bin/json_prolog __name:=json_prolog __log:=/home/nearlab/.ros/log/ba155972-a2b4-11e3-a500-00e08170ece8/json_prolog-1.log].
log file: /home/nearlab/.ros/log/ba155972-a2b4-11e3-a500-00e08170ece8/json_prolog-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done

I don't know if it could help but this is the list of libraries that I get when I install KnowRob under /usr/lib/swi-prolog/lib/amd64. As you can see, libswipl is only .a version!

archive4pl.so        libswipl.a      process.so    socket.so      uid.so
cgi.so               memfile.so      protobufs.so  ssl4pl.so      unicode4pl.so
crypt.so             mime.so         rdf_db.so     streaminfo.so  unix.so
double_metaphone.so  ntriples.so     readutil.so   syslog.so      uri.so
files.so             odbc4pl.so      rlimit.so     table.so       uuid.so
http_stream.so       pdt_console.so  sgml2pl.so    time.so        zlib4pl.so
isub.so              pl2xpce.so      sha4pl.so     tipc.so
json.so              porter_stem.so  snowball.so   turtle.so

This Is what I get when I launch roslaunch tutorial.launch With this option in .bashrc

export SWI_HOME_DIR=/usr/lib/swi-prolog
export LD_PRELOAD=libswipl.so


SUMMARY
========

PARAMETERS
 * /rosdistro
 * /rosversion

NODES
  /
    json_prolog (rosprolog/run_with_prolog_env)

ROS_MASTER_URI=http://192.168.10.10:11311

core service [/rosout] found
process[json_prolog-1]: started with pid [23771]
% /home/nearlab/.plrc compiled 0.00 sec, 2 clauses
%     library(error) compiled into error 0.00 sec, 81 clauses
%     library(pairs) compiled into pairs 0.00 sec, 22 clauses
%    library(lists) compiled into lists 0.01 sec, 205 clauses
%   library(shlib) compiled into shlib 0.01 sec, 246 clauses
%   library(option) compiled into swi_option 0.00 sec, 32 clauses
%  library(process) compiled into process 0.01 sec, 320 clauses
% /opt/ros/fuerte/stacks/knowrob/rosprolog/prolog/init.pl compiled 0.01 sec, 334 clauses
%     library(jpl) compiled into jpl 0.02 sec, 542 clauses
%         library(sgml) compiled into sgml 0.01 sec, 168 clauses
%           library(quintus) compiled into quintus 0.00 sec, 54 clauses
%          rewrite compiled into rewrite 0.00 sec, 81 clauses
%          library(uri) compiled into uri 0.00 sec, 36 clauses
%          library(record) compiled into record 0.00 sec, 69 clauses
%         rdf_parser compiled into rdf_parser 0.01 sec, 342 clauses
%          library(gensym) compiled into gensym 0.00 sec, 9 clauses
%         rdf_triple compiled into rdf_triple 0.00 sec, 80 clauses
%        library(rdf) compiled into rdf 0.03 sec, 664 clauses
%         library(debug) compiled into prolog_debug 0.00 sec, 54 clauses
%         library(assoc) compiled into assoc 0.00 sec, 103 clauses
%        library(sgml_write) compiled into sgml_write 0.01 sec, 321 clauses
%        library(nb_set) compiled into nb_set 0.00 sec, 13 clauses
%         library(utf8) compiled into utf8 0.00 sec, 9 clauses
%        library(url) compiled into url 0.01 sec, 325 clauses
%        rdf_cache compiled into rdf_cache 0.00 sec, 38 clauses
Warning: /opt/ros/fuerte/stacks/knowrob/semweb/prolog/semweb/rdf_db.pl:425:
    Redefined foreign procedure rdf_db:rdf_has/3
Warning: /opt/ros/fuerte/stacks/knowrob/semweb/prolog/semweb/rdf_db.pl:580:
    Redefined foreign procedure rdf_db:rdf_current_predicate/1
ERROR: /opt/ros/fuerte/stacks/knowrob/ias_prolog_addons/prolog/comp_similarity.pl:40:
    Exported procedure rdf_db:rdf_subject/1 is not defined
ERROR: /opt/ros/fuerte/stacks/knowrob/ias_prolog_addons/prolog/comp_similarity.pl:40:
    Exported procedure rdf_db:rdf_quote_uri/2 is not defined
%       library(semweb/rdf_db) compiled into rdf_db 0.06 sec, 1,755 clauses
%      library(comp_similarity) compiled into comp_similarity 0.07 sec, 1,809 clauses
%      library(plunit) compiled into plunit 0.02 sec, 283 clauses
%     /opt/ros/fuerte/stacks/knowrob/ias_prolog_addons/prolog/init.pl compiled 0.08 sec, 2,099 clauses
%      library(broadcast) compiled into broadcast 0.00 sec, 13 clauses
Warning: /opt/ros/fuerte/stacks/knowrob/semweb/prolog/semweb/rdf_edit.pl:889:41: Deprecated ... \<newline><white>*.  Use \c
Warning: /opt/ros/fuerte/stacks/knowrob/semweb/prolog/semweb/rdf_edit.pl:890:25: Deprecated ... \<newline><white>*.  Use \c
Warning: /opt/ros/fuerte/stacks/knowrob/semweb/prolog/semweb/rdf_edit.pl:891:68: Deprecated ... \<newline><white>*.  Use \c
Warning: /opt/ros/fuerte/stacks/knowrob/semweb/prolog/semweb/rdf_edit.pl:892:26: Deprecated ... \<newline><white>*.  Use \c
Warning: /opt/ros/fuerte/stacks/knowrob/semweb/prolog/semweb/rdf_edit.pl:898:12: Deprecated ... \<newline><white>*.  Use \c
Warning: /opt/ros/fuerte/stacks/knowrob/semweb/prolog/semweb/rdf_edit.pl:899:25: Deprecated ... \<newline><white>*.  Use \c
%     library(semweb/rdf_edit) compiled into rdf_edit 0.01 sec, 167 clauses
%     library(semweb/rdfs) compiled into rdfs 0.00 sec, 52 clauses
%     library(semweb/owl) compiled into t20_owl 0.01 sec, 139 clauses
%       library(socket) compiled into socket 0.00 sec, 28 clauses
%       library(base64) compiled into base64 0.00 sec, 79 clauses
%      library(http/http_open.pl) compiled into http_open 0.01 sec, 277 clauses
%     library(thea/owl_parser) compiled into owl_parser 0.02 sec, 390 clauses
%      library(odbc) compiled into odbc 0.00 sec, 99 clauses
Warning: /opt/ros/fuerte/stacks/knowrob/semweb/prolog/semweb/rdfs_computable.pl:542:
    Singleton variable in branch: OneOfList
%     library(semweb/rdfs_computable) compiled into rdfs_computable 0.01 sec, 167 clauses
%    /opt/ros/fuerte/stacks/knowrob/semweb/prolog/init.pl compiled 0.16 sec, 3,620 clauses
%        library(tf_prolog) compiled into tf_prolog 0.00 sec, 25 clauses
%       /opt/ros/fuerte/stacks/knowrob/tf_prolog/prolog/init.pl compiled 0.00 sec, 29 clauses
%         library(crypt) compiled into crypt 0.00 sec, 5 clauses
%        library(knowrob_owl) compiled into knowrob_owl 0.00 sec, 48 clauses
%        library(knowrob_perception) compiled into knowrob_perception 0.00 sec, 16 clauses
ERROR: /opt/ros/fuerte/stacks/knowrob/knowrob_objects/prolog/knowrob_objects.pl:87:
    rdf_db:rdf_transaction/2: Undefined procedure: rdf_db:rdf_transaction_/2
      However, there are definitions for:
            rdf_db:rdf_transaction/1
            rdf_db:rdf_transaction/2
            rdf_db:rdf_transaction/3
            rdf_transaction/1
            rdf_transaction/2
Warning: /opt/ros/fuerte/stacks/knowrob/knowrob_objects/prolog/knowrob_objects.pl:87:
    Goal (directive) failed: knowrob_objects:owl_parser:owl_parse(../owl/knowrob_objects.owl,false,false,true)
%       library(knowrob_objects) compiled into knowrob_objects 0.03 sec, 222 clauses
%        library(owl_export) compiled into owl_export 0.00 sec, 27 clauses
%       library(knowrob_coordinates) compiled into knowrob_coordinates 0.00 sec, 52 clauses
%      /opt/ros/fuerte/stacks/knowrob/knowrob_objects/prolog/init.pl compiled 0.03 sec, 317 clauses
%     /opt/ros/fuerte/stacks/knowrob/knowrob_common/prolog/init.pl compiled 0.04 sec, 325 clauses
%     library(knowrob_actions) compiled into knowrob_actions 0.00 sec, 28 clauses
%    /opt/ros/fuerte/stacks/knowrob/knowrob_actions/prolog/init.pl compiled 0.04 sec, 362 clauses
%     library(util) compiled into util 0.00 sec, 71 clauses
%    library(classifiers) compiled into classifiers 0.00 sec, 100 clauses
%    library(jython) compiled into jython 0.00 sec, 31 clauses
ERROR: /opt/ros/fuerte/stacks/knowrob/ias_knowledge_base/prolog/init.pl:35:
    rdf_db:rdf_transaction/2: Undefined procedure: rdf_db:rdf_transaction_/2
      However, there are definitions for:
            rdf_db:rdf_transaction/1
            rdf_db:rdf_transaction/2
            rdf_db:rdf_transaction/3
            rdf_transaction/1
            rdf_transaction/2
Warning: /opt/ros/fuerte/stacks/knowrob/ias_knowledge_base/prolog/init.pl:35:
    Goal (directive) failed: user:owl_parser:owl_parse(/opt/ros/fuerte/stacks/knowrob/ias_knowledge_base/owl/owl.owl,false,false,true)
ERROR: /opt/ros/fuerte/stacks/knowrob/ias_knowledge_base/prolog/init.pl:36:
    rdf_db:rdf_transaction/2: Undefined procedure: rdf_db:rdf_transaction_/2
      However, there are definitions for:
            rdf_db:rdf_transaction/1
            rdf_db:rdf_transaction/2
            rdf_db:rdf_transaction/3
            rdf_transaction/1
            rdf_transaction/2
Warning: /opt/ros/fuerte/stacks/knowrob/ias_knowledge_base/prolog/init.pl:36:
    Goal (directive) failed: user:owl_parser:owl_parse(/opt/ros/fuerte/stacks/knowrob/ias_knowledge_base/owl/knowrob.owl,false,false,true)
%   /opt/ros/fuerte/stacks/knowrob/ias_knowledge_base/prolog/init.pl compiled 0.21 sec, 4,131 clauses
ERROR: /opt/ros/fuerte/stacks/knowrob/comp_temporal/prolog/comp_temporal.pl:74:
    rdf_db:rdf_transaction/2: Undefined procedure: rdf_db:rdf_transaction_/2
      However, there are definitions for:
            rdf_db:rdf_transaction/1
            rdf_db:rdf_transaction/2
            rdf_db:rdf_transaction/3
            rdf_transaction/1
            rdf_transaction/2
Warning: /opt/ros/fuerte/stacks/knowrob/comp_temporal/prolog/comp_temporal.pl:74:
    Goal (directive) failed: comp_temporal:owl_parser:owl_parse(../owl/comp_temporal.owl,false,false,true)
%    library(comp_temporal) compiled into comp_temporal 0.00 sec, 48 clauses
ERROR: /opt/ros/fuerte/stacks/knowrob/comp_temporal/prolog/init.pl:30:
    rdf_db:rdf_transaction/2: Undefined procedure: rdf_db:rdf_transaction_/2
      However, there are definitions for:
            rdf_db:rdf_transaction/1
            rdf_db:rdf_transaction/2
            rdf_db:rdf_transaction/3
            rdf_transaction/1
            rdf_transaction/2
Warning: /opt/ros/fuerte/stacks/knowrob/comp_temporal/prolog/init.pl:30:
    Goal (directive) failed: user:owl_parser:owl_parse(/opt/ros/fuerte/stacks/knowrob/comp_temporal/owl/comp_temporal.owl,false,false,true)
%   /opt/ros/fuerte/stacks/knowrob/comp_temporal/prolog/init.pl compiled 0.01 sec, 52 clauses
ERROR: /opt/ros/fuerte/stacks/knowrob/comp_spatial/prolog/comp_spatial.pl:51:
    rdf_db:rdf_transaction/2: Undefined procedure: rdf_db:rdf_transaction_/2
      However, there are definitions for:
            rdf_db:rdf_transaction/1
            rdf_db:rdf_transaction/2
            rdf_db:rdf_transaction/3
            rdf_transaction/1
            rdf_transaction/2
Warning: /opt/ros/fuerte/stacks/knowrob/comp_spatial/prolog/comp_spatial.pl:51:
    Goal (directive) failed: comp_spatial:owl_parser:owl_parse(../owl/comp_spatial.owl,false,false,true)
%   library(comp_spatial) compiled into comp_spatial 0.01 sec, 44 clauses
ERROR: /opt/ros/fuerte/stacks/knowrob/comp_spatial/prolog/init.pl:32:
    rdf_db:rdf_transaction/2: Undefined procedure: rdf_db:rdf_transaction_/2
      However, there are definitions for:
            rdf_db:rdf_transaction/1
            rdf_db:rdf_transaction/2
            rdf_db:rdf_transaction/3
            rdf_transaction/1
            rdf_transaction/2
Warning: /opt/ros/fuerte/stacks/knowrob/comp_spatial/prolog/init.pl:32:
    Goal (directive) failed: user:owl_parser:owl_parse(/opt/ros/fuerte/stacks/knowrob/comp_spatial/owl/comp_spatial.owl,false,false,true)
%  /opt/ros/fuerte/stacks/knowrob/comp_spatial/prolog/init.pl compiled 0.24 sec, 4,241 clauses
%   library(semweb/actionmodel) compiled into actionmodel 0.01 sec, 134 clauses
ERROR: /opt/ros/fuerte/stacks/knowrob/ias_semantic_map/prolog/ccrl2_semantic_map.pl:27:
    rdf_db:rdf_transaction/2: Undefined procedure: rdf_db:rdf_transaction_/2
      However, there are definitions for:
            rdf_db:rdf_transaction/1
            rdf_db:rdf_transaction/2
            rdf_db:rdf_transaction/3
            rdf_transaction/1
            rdf_transaction/2
Warning: /opt/ros/fuerte/stacks/knowrob/ias_semantic_map/prolog/ccrl2_semantic_map.pl:27:
    Goal (directive) failed: user:owl_parser:owl_parse(/opt/ros/fuerte/stacks/knowrob/ias_semantic_map/owl/ccrl2_semantic_map.owl,false,false,true)
%  ccrl2_semantic_map compiled 0.02 sec, 147 clauses
%  semantic_map_utils compiled into semantic_map_utils 0.01 sec, 42 clauses
% /opt/ros/fuerte/stacks/knowrob/ias_semantic_map/prolog/init.pl compiled 0.28 sec, 5,884 clauses

Originally posted by Noah on ROS Answers with karma: 15 on 2014-03-03

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Have you set the SWI_HOME_DIR environment variable?

Googling the error message indicates that a second SWI prolog installation could have produced the error: http://www.codecompiling.net/node/137 You should be able to use the version of SWI Prolog that comes with Ubuntu (at least on Precise and Raring). Other versions of Prolog may be incompatible (I cannot test all of them, but the default ones in Ubuntu do work).

libswipl.so is not supposed to be in the folder you listed, but in /usr/lib, as I said above. The LD_PRELOAD should not be in the .bashrc since it can cause problems for other programs; you should only export this variable before launching the program.


Originally posted by moritz with karma: 2673 on 2014-03-03

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Noah on 2014-03-03:
Thank you Moritz, Yes, I set the SWI_HOME_DIR.

However I used another version of SWI Prolog, because in the default one, the shared library libswipl.so was missing (better, there is only the static version libswipl.a). How do you get the .so version? Thank you

Comment by moritz on 2014-03-03:
Which Ubuntu version are you using? I haven't seen that issue so far, maybe you need to create a symlink to e.g. /usr/lib/libswipl.so.5.10.4 ?

Comment by Noah on 2014-03-04:
Dear @moritz , I'm running Ubuntu 12.04. When I'm searching in the SWI prolog installation I can only find libswipl.a and not libswipl.so. That is why I installed also the swipl-5.10.3. Where should I add this link and to what? Thank you,

Comment by moritz on 2014-03-04:
I'm also running Ubuntu 12.04 and have recently installed a new system without problems. Do you have all of these packages installed? swi-prolog-nox swi-prolog-x swi-prolog-odbc swi-prolog? If the .so file is not present, but the .so.5.10.4 is, create a link using sudo ln -s /usr/lib/libswipl.so.5.10.4 /usr/lib/libswipl.so

Comment by Noah on 2014-03-05:
That is very strange: I tried to re-install the system, but we had the same problem. I tried also to create a link as you said but then, we got bad errors related to other libraries, and then the overall system is no more usable.

Comment by moritz on 2014-03-05:
Hmm, sorry, then I'm out of ideas. It seems to be a problem related to the underlying SWI Prolog, not KnowRob itself, and we haven't had problems with using the default Ubuntu installation in a number of installations during the past years.

Comment by Noah on 2014-03-06:
@moritz, I edited the question maybe it could help. Thank you anyway for you support

Comment by rperro88 on 2014-03-06:
Ok, Thank you @moritz and what about the last error? ERROR: /opt/ros/fuerte/stacks/knowrob/comp_temporal/prolog/comp_temporal.pl:74: rdf_db:rdf_transaction/2: Undefined procedure: rdf_db:rdf_transaction_/2 However, there are definitions for: rdf_db:rdf_transaction/1

Comment by moritz on 2014-03-06:
The last error shows that you use the .deb packages for fuerte. They are broken, as stated in the installation instructions, and since they are not built any more, there's no way for me to fix this. Please install KnowRob as described here http://www.knowrob.org/installation#installation_from_source

Comment by Noah on 2014-03-07:
That is not true, I did source installation!

Comment by Noah on 2014-03-07:
I re-did source installation, during rosmake knowrob I get: Finished <<< srldb [PASS] [ 22.95 seconds ] -- WARNING: 4 compiler warnings and Finished <<< jpl [PASS] [ 8.92 seconds ] -- WARNING: 6 compiler warnings

Comment by moritz on 2014-03-07:
Hey, I won't argue how you installed it. The error message mentions /opt/ros/fuerte/stacks/knowrob, which means that you are using the installation from .deb packages. It seems your ROS setup is broken, please check your ROS_PACKAGE_PATH and try if 'roscd knowrob' brings you into the right folder.

Comment by Noah on 2014-03-07:
Thank you @moritz for you patience, actually Knowrob is in /opt/ros/fuerte/ because I compiled it there, for sake of clearness. Is this a wrong procedure? roscd knowrob brings me to the correct path

Comment by Noah on 2014-03-07:
Greetings from us! We did it!

$\endgroup$

Your Answer

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