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

json_prolog ERROR: init.pl: source_sink `library(my_lib)' does not exist

asked 2013-08-22 00:12:40 -0600

zsaigol gravatar image

Trying to load a library of functions from a ROS package's init.pl file, json_prolog gives the error:

ERROR: /home/path/my_package/prolog/init.pl:19:
 source_sink `library(my_lib)' does not exist 
Warning: /home/path/my_package/prolog/init.pl:19:
 Goal (directive) failed: user:use_module(library(my_lib))

The init.pl file uses the code

:- use_module(library('my_lib')).

to load a file 'my_lib.pl' located in the same directory as init.pl.

When starting the package using rosrun rosprolog rosprolog my_package the module gets compiled and loaded fine.

I suspect the problem is that JSONPrologNode.java uses ensure_loaded('/home/path/my_package/prolog/init.pl') instead of register_ros_package(my_package) which is what rosprolog uses.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-08-22 21:30:20 -0600

moritz gravatar image

Normally, the register_ros_package(my_package) statement should be in that package's init.pl to make sure that the package's path is added to Prolog's library search path.

edit flag offensive delete link more

Comments

Thanks Moritz, that works fine! Although it does seem a bit inconsistent that "rosrun rosprolog rosprolog my_package" and "rosrun json_prolog json_prolog _initial_package:=my_package" work differently.

zsaigol gravatar image zsaigol  ( 2013-08-23 02:58:05 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2013-08-22 00:12:40 -0600

Seen: 1,830 times

Last updated: Aug 22 '13