How to rosmake and run roslisp talker and listener successfully?
I followed roslisp/Overview/Installation and Roslisp Basic Usage.
I run:
roscreate-pkg sam_begin_lisp roslisp roslisp_runtime
cd sam_begin_lisp/
mkdir src
y src/talker.lisp:
(in-package :sam_begin_lisp)
(defun talker ()
"Periodically print a string message on the /chatter topic"
(with-ros-node ("talker")
(let ((i 0) (pub (advertise "chatter" "std_msgs/String")))
(loop-at-most-every .1
(publish-msg pub :data (format nil "foo ~a" (incf i)))
)
)
)
)
My src/listener.lisp
(in-package :sam_begin_lisp)
(defun listener ()
(with-ros-node ("listener" :spin t)
(subscribe "chatter" "std_msgs/String" #'print)
)
)
My CMakeLists.txt:
cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
# Set the build type. Options are:
# Coverage : w/ debug symbols, w/o optimization, w/ code-coverage
# Debug : w/ debug symbols, w/o optimization
# Release : w/o debug symbols, w/ optimization
# RelWithDebInfo : w/ debug symbols, w/ optimization
# MinSizeRel : w/o debug symbols, w/ optimization, stripped binaries
#set(ROS_BUILD_TYPE RelWithDebInfo)
rosbuild_init()
#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
#set the default path for built libraries to the "lib" directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
#uncomment if you have defined messages
#rosbuild_genmsg()
#uncomment if you have defined services
#rosbuild_gensrv()
#common commands for building c++ executables and libraries
#rosbuild_add_library(${PROJECT_NAME} src/example.cpp)
#target_link_libraries(${PROJECT_NAME} another_library)
#rosbuild_add_boost_directories()
#rosbuild_link_boost(${PROJECT_NAME} thread)
#rosbuild_add_executable(example examples/example.cpp)
#target_link_libraries(example ${PROJECT_NAME})
rospack_add_lisp_executable(bin/talker sam_begin_lisp sam_begin_lisp:talker)
rospack_add_lisp_executable(bin/listener sam_begin_lisp sam_begin_lisp:listener)
When I rosmake, it shows:
sam@/home/sam/code/ros/lisp/sam_begin_lisp$ rosmake
[ rosmake ] No package specified. Building ['sam_begin_lisp']
[ rosmake ] Packages requested are: ['sam_begin_lisp']
[ rosmake ] Logging to directory/home/sam/.ros/rosmake/rosmake_output-20120813-214948
[ rosmake ] Expanded args ['sam_begin_lisp'] to:
['sam_begin_lisp']
[ rosmake ] Checking rosdeps compliance for packages sam_begin_lisp. This may take a few seconds.
[ rosmake ] rosdep check passed all system dependencies in packages
[rosmake-0] Starting >>> roslib [ make ]
[rosmake-0] Finished <<< roslib ROS_NOBUILD in package roslib
[rosmake-1] Starting >>> rosbuild [ make ]
[rosmake-1] Finished <<< rosbuild ROS_NOBUILD in package rosbuild
No Makefile in package rosbuild
[rosmake-2] Starting >>> std_srvs [ make ]
[rosmake-2] Finished <<< std_srvs ROS_NOBUILD in package std_srvs
[rosmake-3] Starting >>> sbcl [ make ]
[rosmake-1] Starting >>> roslang [ make ]
[rosmake-3] Finished <<< sbcl ROS_NOBUILD in package sbcl
[rosmake-1] Finished <<< roslang ROS_NOBUILD in package roslang
No Makefile in package roslang
[rosmake-0] Starting >>> std_msgs [ make ]
[rosmake-0] Finished <<< std_msgs ROS_NOBUILD in package std_msgs
[rosmake-1] Starting >>> roslisp [ make ]
[rosmake-1] Finished <<< roslisp ROS_NOBUILD in package roslisp
[rosmake-1] Starting >>> roslisp_runtime [ make ]
[rosmake-1] Finished <<< roslisp_runtime ROS_NOBUILD in package roslisp_runtime
[rosmake-1] Starting >>> sam_begin_lisp [ make ]
[ rosmake ] Last 40 linesm_begin_lisp: 1.1 sec ] [ 1 Active 9/10 Complete ]
{-------------------------------------------------------------------------------
make[3]: Entering directory `/home/sam/code/ros/lisp/sam_begin_lisp/build'
Scanning dependencies of target rospack_genmsg_libexe
make[3]: Leaving directory `/home/sam/code/ros/lisp/sam_begin_lisp/build'
[ 0%] Built target rospack_genmsg_libexe
make[3]: Entering directory `/home/sam/code/ros/lisp/sam_begin_lisp/build'
Scanning dependencies of target rosbuild_precompile
make[3]: Leaving directory `/home/sam/code/ros/lisp/sam_begin_lisp/build'
[ 0%] Built target rosbuild_precompile
make[3]: Entering directory `/home/sam/code/ros/lisp/sam_begin_lisp/build'
Scanning dependencies of target _roslisp_bin_talker
make[3]: Leaving directory `/home/sam/code/ros/lisp/sam_begin_lisp/build'
make[3]: Entering directory `/home/sam/code/ros/lisp/sam_begin_lisp/build'
[ 0%] Generating ../bin/talker ...
I don't see what causes the problem, maybe you can first try out rosmake for the tutorial source code, by checking out from svn: svn checkout https://code.ros.org/svn/ros/stacks/roslisp_support/trunk/roslisp_tutorials
To be able to help we will need a little more information: can you please add the contents of your .asd file and your package definition (usually in the file package.lisp)?
I revised my original post to add few src. And roslisp_tutorials package is pass the rosmake.
You still have sam_begin_lisp somewhere in in-package. It should be (in-package :sam-begin-lisp)
Thank you~I find it. It is in CMakeLists.txt.