0
$\begingroup$

Rosanswers logo

I'm using catkin ros. Now I'm trying to make a lisp script executable with "rosrun xxx".

The roslisp tutorial is kind of out of date, so I tried different approaches with information I got from different places.

Now in the CMakeList.txt, I have

install(PROGRAMS
  src/beckon.lisp
  DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

At the head of the .lisp script, I add

#!/usr/bin/env sh
"true" ; exec /usr/bin/env sbcl --noinform --script "$0" "$@"

To make it executable

My code snippet is

(defpackage :lisp_interpreter
(:use :roslisp :cl))

However, when I actually run it, I got error messages

Unhandled SB-KERNEL:SIMPLE-PACKAGE-ERROR in thread #<SB-THREAD:THREAD
                                                 "main thread" RUNNING
                                                  {1002A8B3A3}>:
The name "ROSLISP" does not designate any package.

Besides that, the following hello world code seems to be problematic

(with-ros-node ("lisp_interpreter")
(sleep 1)
)

with error

; in: WITH-ROS-NODE ("lisp_interpreter")
;     ("lisp_interpreter")
; 
; caught ERROR:
;   illegal function call
; 
; compilation unit finished
;   Undefined function:
;     WITH-ROS-NODE
;   caught 1 ERROR condition
Unhandled SB-INT:COMPILED-PROGRAM-ERROR in thread #<SB-THREAD:THREAD
                                                "main thread" RUNNING
                                                 {1002A8B3A3}>:
  Execution of a form compiled with errors.
Form:
  ("lisp_interpreter")    
Compile-time error:
  illegal function call

How to make it works?


Originally posted by firstprayer on ROS Answers with karma: 21 on 2015-04-21

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Small comment first: your beckon.lisp is actually a shell script, so at least call it beckon.lisp.sh or something.

But your problem has nothing to do with executables themselves I think, even if you tried your function in the lisp command line (repl) it probably wouldn't work. It seems that your *.asd file is not set up properly. You need a dependency on roslisp, it seems to not have been loaded. The setup of ROS Lisp packages is also described in the tutorial: http://wiki.ros.org/roslisp/Tutorials/OrganizingFiles#Setting_up_a_new_roslisp_ROS_package


Originally posted by gaya with karma: 311 on 2015-04-22

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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