ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org
Ask Your Question
0

Create Executable roslisp script

asked 2015-04-21 17:22:00 -0500

firstprayer gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2015-04-22 06:35:50 -0500

gaya gravatar image

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...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-04-21 17:22:00 -0500

Seen: 112 times

Last updated: Apr 22 '15