[ros-users] Problem with tutorial 11: Writing a Simple Publisher and Subscriber (C++)
#TAN ZHI PING#
TANZ0066 at e.ntu.edu.sg
Sun Aug 15 09:55:07 UTC 2010
Hi to all,
I tried to create an additional file, test.cpp, and wrote another executable line in CMakeList.txt as shown below:
rosbuild_add_executable(talker src/talker.cpp)
rosbuild_add_executable(listener src/listener.cpp)
rosbuild_add_executable(test src/test.cpp)
-----------------------------------------------------------test.cpp ------------------------------------------------
#include <ros/console.h>
int main(int argc, char **argv)
ros::init(argc, argv, "test");
ros::NodeHandle n;
int count = 0;
while (ros::ok())
{
ROS_DEBUG("Hello %s", "World");
ROS_DEBUG_STREAM("Hello " << "World");
}
}
-----------------------------------------------------------End ------------------------------------------------
But according to the Build output, there is no build target test. Why is that so?
-----------------------------------------------------------Build Output ---------------------------------------------------
mkdir -p bin
cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=`rospack find rosbuild`/rostoolchain.cmake ..
[rosbuild] Building package beginner_tutorials
[rosbuild] Including /opt/ros/cturtle/ros/core/rospy/cmake/rospy.cmake
[rosbuild] Including /opt/ros/cturtle/ros/core/roslisp/cmake/roslisp.cmake
[rosbuild] Including /opt/ros/cturtle/ros/core/roscpp/cmake/roscpp.cmake
-- Configuring done
-- Generating done
-- Build files have been written to: /home/snoopy/beginner_tutorials/build
cd build && make
make[1]: Entering directory `/home/snoopy/beginner_tutorials/build'
make[2]: Entering directory `/home/snoopy/beginner_tutorials/build'
make[3]: Entering directory `/home/snoopy/beginner_tutorials/build'
make[3]: Leaving directory `/home/snoopy/beginner_tutorials/build'
[ 0%] Built target rospack_genmsg_libexe
make[3]: Entering directory `/home/snoopy/beginner_tutorials/build'
make[3]: Leaving directory `/home/snoopy/beginner_tutorials/build'
[ 0%] Built target rosbuild_precompile
make[3]: Entering directory `/home/snoopy/beginner_tutorials/build'
make[3]: Leaving directory `/home/snoopy/beginner_tutorials/build'
[ 50%] Built target listener
make[3]: Entering directory `/home/snoopy/beginner_tutorials/build'
make[3]: Leaving directory `/home/snoopy/beginner_tutorials/build'
[100%] Built target talker
make[2]: Leaving directory `/home/snoopy/beginner_tutorials/build'
make[1]: Leaving directory `/home/snoopy/beginner_tutorials/build'
snoopy at ubuntu:~/beginner_tutorials$
--------------------------------------------------------- End ------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/ros-users/attachments/20100815/0c0fe24d/attachment-0003.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CMakeLists.txt
URL: <http://lists.osuosl.org/pipermail/ros-users/attachments/20100815/0c0fe24d/attachment-0004.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.cpp
Type: text/x-c++src
Size: 239 bytes
Desc: test.cpp
URL: <http://lists.osuosl.org/pipermail/ros-users/attachments/20100815/0c0fe24d/attachment-0004.cpp>
More information about the ros-users
mailing list