Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tsbertalan
Last active March 24, 2020 23:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsbertalan/da2914f5c6a5ce2ab2a8ca9436460e80 to your computer and use it in GitHub Desktop.
Save tsbertalan/da2914f5c6a5ce2ab2a8ca9436460e80 to your computer and use it in GitHub Desktop.
undefined reference to ros::init
-- Using CATKIN_DEVEL_PREFIX: /home/tsbertalan/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/tsbertalan/catkin_ws/devel;/opt/ros/kinetic
-- This workspace overlays: /home/tsbertalan/catkin_ws/devel;/opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/tsbertalan/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/local/bin/nosetests-2.7
-- catkin 0.7.4
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 6 packages in topological order:
-- ~~ - ros_arduino_bridge (metapackage)
-- ~~ - ros_arduino_firmware
-- ~~ - ros_arduino_python
-- ~~ - ros_arduino_msgs
-- ~~ - beginner_tutorials
-- ~~ - gunnar
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin metapackage: 'ros_arduino_bridge'
-- ==> add_subdirectory(ros_arduino_bridge/ros_arduino_bridge)
-- +++ processing catkin package: 'ros_arduino_firmware'
-- ==> add_subdirectory(ros_arduino_bridge/ros_arduino_firmware)
-- +++ processing catkin package: 'ros_arduino_python'
-- ==> add_subdirectory(ros_arduino_bridge/ros_arduino_python)
-- +++ processing catkin package: 'ros_arduino_msgs'
-- ==> add_subdirectory(ros_arduino_bridge/ros_arduino_msgs)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- ros_arduino_msgs: 5 messages, 7 services
-- +++ processing catkin package: 'beginner_tutorials'
-- ==> add_subdirectory(beginner_tutorials)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- +++ processing catkin package: 'gunnar'
-- ==> add_subdirectory(Gunnar)
-- Configuring done
CMake Warning (dev) at beginner_tutorials/CMakeLists.txt:21 (add_dependencies):
Policy CMP0046 is not set: Error on non-existent dependency in
add_dependencies. Run "cmake --help-policy CMP0046" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
The dependency target "beginner_tutorials_generate_messages_cpp" of target
"talker" does not exist.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at beginner_tutorials/CMakeLists.txt:25 (add_dependencies):
Policy CMP0046 is not set: Error on non-existent dependency in
add_dependencies. Run "cmake --help-policy CMP0046" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
The dependency target "beginner_tutorials_generate_messages_cpp" of target
"listener" does not exist.
This warning is for project developers. Use -Wno-dev to suppress it.
-- Generating done
-- Build files have been written to: /home/tsbertalan/catkin_ws/build
[ 0%] Built target std_msgs_generate_messages_py
[ 0%] Built target _ros_arduino_msgs_generate_messages_check_deps_DigitalSetDirection
[ 0%] Built target _ros_arduino_msgs_generate_messages_check_deps_ArduinoConstants
[ 0%] Built target _ros_arduino_msgs_generate_messages_check_deps_Digital
[ 0%] Built target _ros_arduino_msgs_generate_messages_check_deps_Analog
[ 0%] Built target _ros_arduino_msgs_generate_messages_check_deps_DigitalWrite
[ 0%] Built target _ros_arduino_msgs_generate_messages_check_deps_AnalogFloat
[ 0%] Built target _ros_arduino_msgs_generate_messages_check_deps_ServoRead
[ 0%] Built target std_msgs_generate_messages_lisp
[ 0%] Built target std_msgs_generate_messages_nodejs
[ 0%] Built target _ros_arduino_msgs_generate_messages_check_deps_DigitalRead
[ 0%] Built target _ros_arduino_msgs_generate_messages_check_deps_AnalogRead
[ 0%] Built target std_msgs_generate_messages_cpp
[ 0%] Built target std_msgs_generate_messages_eus
[ 0%] Built target _ros_arduino_msgs_generate_messages_check_deps_SensorState
[ 0%] Built target _ros_arduino_msgs_generate_messages_check_deps_AnalogWrite
[ 1%] Linking CXX executable /home/tsbertalan/catkin_ws/devel/lib/beginner_tutorials/talker
[ 2%] Built target _ros_arduino_msgs_generate_messages_check_deps_ServoWrite
[ 2%] Linking CXX executable /home/tsbertalan/catkin_ws/devel/lib/beginner_tutorials/listener
[ 20%] Built target ros_arduino_msgs_generate_messages_nodejs
[ 38%] Built target ros_arduino_msgs_generate_messages_lisp
[ 56%] Built target ros_arduino_msgs_generate_messages_cpp
[ 77%] Built target ros_arduino_msgs_generate_messages_py
[ 97%] Built target ros_arduino_msgs_generate_messages_eus
[ 97%] Built target ros_arduino_msgs_generate_messages
CMakeFiles/talker.dir/src/talker.cpp.o: In function `main':
talker.cpp:(.text+0x70): undefined reference to `ros::init(int&, char**, std::string const&, unsigned int)'
talker.cpp:(.text+0xcc): undefined reference to `ros::NodeHandle::NodeHandle(std::string const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&)'
talker.cpp:(.text+0x29a): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
CMakeFiles/talker.dir/src/talker.cpp.o: In function `void ros::Publisher::publish<std_msgs::String_<std::allocator<void> > >(std_msgs::String_<std::allocator<void> > const&) const':
talker.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0xa0): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
talker.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x1a3): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
talker.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x29e): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
talker.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x3c1): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
CMakeFiles/talker.dir/src/talker.cpp.o:talker.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x4c4): more undefined references to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' follow
collect2: error: ld returned 1 exit status
CMakeFiles/listener.dir/src/listener.cpp.o: In function `chatterCallback(boost::shared_ptr<std_msgs::String_<std::allocator<void> > const> const&)':
listener.cpp:(.text+0x78): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
CMakeFiles/listener.dir/src/listener.cpp.o: In function `main':
listener.cpp:(.text+0x1dc): undefined reference to `ros::init(int&, char**, std::string const&, unsigned int)'
listener.cpp:(.text+0x238): undefined reference to `ros::NodeHandle::NodeHandle(std::string const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&)'
CMakeFiles/listener.dir/src/listener.cpp.o: In function `ros::SubscriptionCallbackHelperT<boost::shared_ptr<std_msgs::String_<std::allocator<void> > const> const&, void>::deserialize(ros::SubscriptionCallbackHelperDeserializeParams const&)':
listener.cpp:(.text._ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN8std_msgs7String_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE[_ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN8std_msgs7String_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE]+0xba): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
collect2: error: ld returned 1 exit status
beginner_tutorials/CMakeFiles/talker.dir/build.make:113: recipe for target '/home/tsbertalan/catkin_ws/devel/lib/beginner_tutorials/talker' failed
make[2]: *** [/home/tsbertalan/catkin_ws/devel/lib/beginner_tutorials/talker] Error 1
CMakeFiles/Makefile2:1468: recipe for target 'beginner_tutorials/CMakeFiles/talker.dir/all' failed
make[1]: *** [beginner_tutorials/CMakeFiles/talker.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
beginner_tutorials/CMakeFiles/listener.dir/build.make:113: recipe for target '/home/tsbertalan/catkin_ws/devel/lib/beginner_tutorials/listener' failed
make[2]: *** [/home/tsbertalan/catkin_ws/devel/lib/beginner_tutorials/listener] Error 1
CMakeFiles/Makefile2:1601: recipe for target 'beginner_tutorials/CMakeFiles/listener.dir/all' failed
make[1]: *** [beginner_tutorials/CMakeFiles/listener.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Base path: /home/tsbertalan/catkin_ws
Source space: /home/tsbertalan/catkin_ws/src
Build space: /home/tsbertalan/catkin_ws/build
Devel space: /home/tsbertalan/catkin_ws/devel
Install space: /home/tsbertalan/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/tsbertalan/catkin_ws/build"
####
####
#### Running command: "make -j8 -l8" in "/home/tsbertalan/catkin_ws/build"
####
Invoking "make -j8 -l8" failed
cmake_minimum_required(VERSION 2.8.3)
project(beginner_tutorials)
## Find catkin and any catkin packages
find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs genmsg)
## Declare ROS messages and services
#add_message_files(DIRECTORY msg FILES Num.msg)
#add_service_files(DIRECTORY srv FILES AddTwoInts.srv)
## Generate added messages and services
#generate_messages(DEPENDENCIES std_msgs)
## Declare a catkin package
catkin_package()
include_directories(include ${catkin_INCLUDE_DIRS})
add_executable(talker src/talker.cpp)
target_link_libraries(talker ${catkin_LIBRARIES})
add_dependencies(talker beginner_tutorials_generate_messages_cpp)
add_executable(listener src/listener.cpp)
target_link_libraries(listener ${catkin_LIBRARIES})
add_dependencies(listener beginner_tutorials_generate_messages_cpp)
XDG_VTNR=7
MANPATH=:/usr/brlcad/share/man
XDG_SESSION_ID=c4
CLUTTER_IM_MODULE=xim
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/tsbertalan
COMP_WORDBREAKS=
"'><;|&(:
GIO_LAUNCHED_DESKTOP_FILE_PID=5283
SESSION=ubuntu
GPG_AGENT_INFO=/home/tsbertalan/.gnupg/S.gpg-agent:0:1
TERM=xterm
SHELL=/bin/bash
XDG_MENU_PREFIX=gnome-
ROS_ROOT=/opt/ros/kinetic/share/ros
DERBY_HOME=/usr/lib/jvm/java-8-oracle/db
KONSOLE_DBUS_SERVICE=:1.73
ROS_PACKAGE_PATH=/home/tsbertalan/catkin_ws/src:/opt/ros/kinetic/share
GOBIN=/home/tsbertalan/gobin
KONSOLE_PROFILE_NAME=Shell
QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
ROS_MASTER_URI=http://10.8.0.1:11311
WINDOWID=62914581
UPSTART_SESSION=unix:abstract=/com/ubuntu/upstart-session/1000/4622
GNOME_KEYRING_CONTROL=
SHELL_SESSION_ID=577abf063aaa4000a4ac4378287acdae
GTK_MODULES=gail:atk-bridge:unity-gtk-module
LC_ALL=C
ZSH=/home/tsbertalan/.oh-my-zsh
CUDA_HOME=/usr/local/cuda-8.0
USER=tsbertalan
LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:/home/tsbertalan/catkin_ws/devel/lib:/opt/ros/kinetic/lib
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
QT_ACCESSIBILITY=1
DESKTOP_AUTOSTART_ID=107051209a2b9f497148590996084456700000049760008
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
ROS_IP_REMOTE=10.8.0.2
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
KICAD_PATH=/usr/share/kicad
SESSION_MANAGER=local/Sigurd:@/tmp/.ICE-unix/4976,unix/Sigurd:/tmp/.ICE-unix/4976
DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path
GIO_LAUNCHED_DESKTOP_FILE=/home/tsbertalan/.config/autostart/yakuake.desktop
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg
KIGITHUB=https://github.com/KiCad
DESKTOP_SESSION=ubuntu
PATH=/usr/local/cuda-8.0/bin:/opt/ros/kinetic/bin:/home/tsbertalan/auto/07p/cmds:/home/tsbertalan/auto/07p/bin:/home/tsbertalan/bin:/home/tsbertalan/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/brlcad/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/home/tsbertalan/.rvm/bin/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/tsbertalan/gobin:/home/tsbertalan/.rvm/bin:/usr/local/spark/bin
QT_QPA_PLATFORMTHEME=appmenu-qt5
QT_IM_MODULE=ibus
JOB=dbus
XDG_SESSION_TYPE=x11
PWD=/home/tsbertalan/catkin_ws
GOARCH=amd64
XMODIFIERS=@im=ibus
JAVA_HOME=/usr/lib/jvm/java-8-oracle
LANG=en_US.UTF-8
GNOME_KEYRING_PID=
AUTO_DIR=/home/tsbertalan/auto/07p
MANDATORY_PATH=/usr/share/gconf/ubuntu.mandatory.path
GDM_LANG=en_US
COMPIZ_CONFIG_PROFILE=ubuntu
IM_CONFIG_PHASE=1
ROSLISP_PACKAGE_DIRECTORIES=/home/tsbertalan/catkin_ws/devel/share/common-lisp
KONSOLE_DBUS_SESSION=/Sessions/21
GDMSESSION=ubuntu
GTK2_MODULES=overlay-scrollbar
SESSIONTYPE=gnome-session
COLORFGBG=15;0
SHLVL=1
XDG_SEAT=seat0
HOME=/home/tsbertalan
ROS_DISTRO=kinetic
GOROOT=/home/tsbertalan/gosource
LANGUAGE=en_US
GOOS=linux
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
MATHEMATICA_HOME=/usr/local/Wolfram/Mathematica/10.1
PYTHONPATH=/home/tsbertalan/catkin_ws/devel/lib/python2.7/dist-packages:/opt/ros/kinetic/lib/python2.7/dist-packages:/home/tsbertalan/.pythonpath
XDG_SESSION_DESKTOP=ubuntu
LOGNAME=tsbertalan
ROS_IP=10.8.0.1
J2SDKDIR=/usr/lib/jvm/java-8-oracle
QT4_IM_MODULE=ibus
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-xinOKgx60p
XDG_DATA_DIRS=/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/
PKG_CONFIG_PATH=/home/tsbertalan/catkin_ws/devel/lib/pkgconfig:/opt/ros/kinetic/lib/pkgconfig
LESSOPEN=| /usr/bin/lesspipe %s
INSTANCE=
CMAKE_PREFIX_PATH=/home/tsbertalan/catkin_ws/devel:/opt/ros/kinetic
PROFILEHOME=
XDG_RUNTIME_DIR=/run/user/1000
DISPLAY=:0
CUDA_ROOT=/usr/local/cuda-8.0
J2REDIR=/usr/lib/jvm/java-8-oracle/jre
XDG_CURRENT_DESKTOP=Unity
GTK_IM_MODULE=ibus
LESSCLOSE=/usr/bin/lesspipe %s %s
ROS_ETC_DIR=/opt/ros/kinetic/etc/ros
XAUTHORITY=/home/tsbertalan/.Xauthority
OLDPWD=/home/tsbertalan/catkin_ws/src
_=/usr/bin/env
tsbertalan@Sigurd:~$ sudo aptitude search '~i gcc'
i gcc - GNU C compiler
i gcc-4.8 - GNU C compiler
i gcc-4.8-base - GCC, the GNU Compiler Collection (base package)
i A gcc-4.8-multilib - GNU C compiler (multilib support)
i A gcc-4.9 - GNU C compiler
i gcc-4.9-base - GCC, the GNU Compiler Collection (base package)
i A gcc-4.9-base:i386 - GCC, the GNU Compiler Collection (base package)
i gcc-5 - GNU C compiler
i gcc-5-base - GCC, the GNU Compiler Collection (base package)
i A gcc-5-base:i386 - GCC, the GNU Compiler Collection (base package)
i A gcc-5-multilib - GNU C compiler (multilib support)
i gcc-6-base - GCC, the GNU Compiler Collection (base package)
i A gcc-6-base:i386 - GCC, the GNU Compiler Collection (base package)
i gcc-arm-none-eabi - GCC cross compiler for ARM Cortex-A/R/M processors
i A gcc-multilib - GNU C compiler (multilib files)
i A lib32gcc-4.8-dev - GCC support library (32 bit development files)
i A lib32gcc-5-dev - GCC support library (32 bit development files)
i lib32gcc1 - GCC support library (32 bit Version)
i libgcc-4.8-dev - GCC support library (development files)
i A libgcc-4.9-dev - GCC support library (development files)
i libgcc-5-dev - GCC support library (development files)
i libgcc1 - GCC support library
i A libgcc1:i386 - GCC support library
i A libx32gcc-4.8-dev - GCC support library (x32 development files)
i A libx32gcc-5-dev - GCC support library (x32 development files)
i libx32gcc1 - GCC support library (x32)
tsbertalan@Sigurd:~$ update-alternatives --get-selections | grep gcc
c89 auto /usr/bin/c89-gcc
c99 auto /usr/bin/c99-gcc
cc manual /usr/bin/gcc
gcc auto /usr/bin/gcc-4.9
gcc-arm-none-eabi-include auto /usr/include/newlib
gcc-arm-none-eabi-lib auto /usr/lib/arm-none-eabi/newlib
<?xml version="1.0"?>
<package>
<name>beginner_tutorials</name>
<version>0.0.0</version>
<description>The beginner_tutorials package</description>
<maintainer email="tom@tomsb.net">tsbertalan</maintainer>
<license>TODO</license>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<build_depend>std_msgs</build_depend>
<run_depend>roscpp</run_depend>
<run_depend>rospy</run_depend>
<run_depend>std_msgs</run_depend>
<export>
<!-- Other tools can request additional information be placed here -->
</export>
</package>
/*
* Copyright (C) 2008, Morgan Quigley and Willow Garage, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the names of Stanford University or Willow Garage, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
// %Tag(FULLTEXT)%
#include "ros/ros.h"
#include "std_msgs/String.h"
/**
* This tutorial demonstrates simple receipt of messages over the ROS system.
*/
// %Tag(CALLBACK)%
void chatterCallback(const std_msgs::String::ConstPtr& msg)
{
ROS_INFO("I heard: [%s]", msg->data.c_str());
}
// %EndTag(CALLBACK)%
int main(int argc, char **argv)
{
/**
* The ros::init() function needs to see argc and argv so that it can perform
* any ROS arguments and name remapping that were provided at the command line.
* For programmatic remappings you can use a different version of init() which takes
* remappings directly, but for most command-line programs, passing argc and argv is
* the easiest way to do it. The third argument to init() is the name of the node.
*
* You must call one of the versions of ros::init() before using any other
* part of the ROS system.
*/
ros::init(argc, argv, "listener");
/**
* NodeHandle is the main access point to communications with the ROS system.
* The first NodeHandle constructed will fully initialize this node, and the last
* NodeHandle destructed will close down the node.
*/
ros::NodeHandle n;
/**
* The subscribe() call is how you tell ROS that you want to receive messages
* on a given topic. This invokes a call to the ROS
* master node, which keeps a registry of who is publishing and who
* is subscribing. Messages are passed to a callback function, here
* called chatterCallback. subscribe() returns a Subscriber object that you
* must hold on to until you want to unsubscribe. When all copies of the Subscriber
* object go out of scope, this callback will automatically be unsubscribed from
* this topic.
*
* The second parameter to the subscribe() function is the size of the message
* queue. If messages are arriving faster than they are being processed, this
* is the number of messages that will be buffered up before beginning to throw
* away the oldest ones.
*/
// %Tag(SUBSCRIBER)%
ros::Subscriber sub = n.subscribe("chatter", 1000, chatterCallback);
// %EndTag(SUBSCRIBER)%
/**
* ros::spin() will enter a loop, pumping callbacks. With this version, all
* callbacks will be called from within this thread (the main one). ros::spin()
* will exit when Ctrl-C is pressed, or the node is shutdown by the master.
*/
// %Tag(SPIN)%
ros::spin();
// %EndTag(SPIN)%
return 0;
}
// %EndTag(FULLTEXT)%
/*
* Copyright (C) 2008, Morgan Quigley and Willow Garage, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the names of Stanford University or Willow Garage, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
// %Tag(FULLTEXT)%
// %Tag(ROS_HEADER)%
#include "ros/ros.h"
// %EndTag(ROS_HEADER)%
// %Tag(MSG_HEADER)%
#include "std_msgs/String.h"
// %EndTag(MSG_HEADER)%
#include <sstream>
/**
* This tutorial demonstrates simple sending of messages over the ROS system.
*/
int main(int argc, char **argv)
{
/**
* The ros::init() function needs to see argc and argv so that it can perform
* any ROS arguments and name remapping that were provided at the command line.
* For programmatic remappings you can use a different version of init() which takes
* remappings directly, but for most command-line programs, passing argc and argv is
* the easiest way to do it. The third argument to init() is the name of the node.
*
* You must call one of the versions of ros::init() before using any other
* part of the ROS system.
*/
// %Tag(INIT)%
ros::init(argc, argv, "talker");
// %EndTag(INIT)%
/**
* NodeHandle is the main access point to communications with the ROS system.
* The first NodeHandle constructed will fully initialize this node, and the last
* NodeHandle destructed will close down the node.
*/
// %Tag(NODEHANDLE)%
ros::NodeHandle n;
// %EndTag(NODEHANDLE)%
/**
* The advertise() function is how you tell ROS that you want to
* publish on a given topic name. This invokes a call to the ROS
* master node, which keeps a registry of who is publishing and who
* is subscribing. After this advertise() call is made, the master
* node will notify anyone who is trying to subscribe to this topic name,
* and they will in turn negotiate a peer-to-peer connection with this
* node. advertise() returns a Publisher object which allows you to
* publish messages on that topic through a call to publish(). Once
* all copies of the returned Publisher object are destroyed, the topic
* will be automatically unadvertised.
*
* The second parameter to advertise() is the size of the message queue
* used for publishing messages. If messages are published more quickly
* than we can send them, the number here specifies how many messages to
* buffer up before throwing some away.
*/
// %Tag(PUBLISHER)%
ros::Publisher chatter_pub = n.advertise<std_msgs::String>("chatter", 1000);
// %EndTag(PUBLISHER)%
// %Tag(LOOP_RATE)%
ros::Rate loop_rate(10);
// %EndTag(LOOP_RATE)%
/**
* A count of how many messages we have sent. This is used to create
* a unique string for each message.
*/
// %Tag(ROS_OK)%
int count = 0;
while (ros::ok())
{
// %EndTag(ROS_OK)%
/**
* This is a message object. You stuff it with data, and then publish it.
*/
// %Tag(FILL_MESSAGE)%
std_msgs::String msg;
std::stringstream ss;
ss << "hello world " << count;
msg.data = ss.str();
// %EndTag(FILL_MESSAGE)%
// %Tag(ROSCONSOLE)%
ROS_INFO("%s", msg.data.c_str());
// %EndTag(ROSCONSOLE)%
/**
* The publish() function is how you send messages. The parameter
* is the message object. The type of this object must agree with the type
* given as a template parameter to the advertise<>() call, as was done
* in the constructor above.
*/
// %Tag(PUBLISH)%
chatter_pub.publish(msg);
// %EndTag(PUBLISH)%
// %Tag(SPINONCE)%
ros::spinOnce();
// %EndTag(SPINONCE)%
// %Tag(RATE_SLEEP)%
loop_rate.sleep();
// %EndTag(RATE_SLEEP)%
++count;
}
return 0;
}
// %EndTag(FULLTEXT)%
@gochaudhari
Copy link

I am getting the same error

@phenix1983
Copy link

Me too.

@gpgvl
Copy link

gpgvl commented Feb 4, 2019

Did anyone solve it? I get the same error.

@darrahts
Copy link

Getting it on a fresh ubuntu 16 install with kinetic, however on my ubuntu 18 machine with melodic it is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment