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

json_prolog ERROR: 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 file, json_prolog gives the error:

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

The file uses the code

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

to load a file '' located in the same directory as

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

I suspect the problem is that uses ensure_loaded('/home/path/my_package/prolog/') 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

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 to make sure that the package's path is added to Prolog's library search path.

edit flag offensive delete link more


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


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

Seen: 1,799 times

Last updated: Aug 22 '13