Ask Your Question

Begginer Tutorial Publisher/Subscriber Server/Client in C++ boost assertion failed

asked 2013-03-14 00:53:01 -0500

Juan gravatar image

updated 2013-03-14 07:23:18 -0500

felix k gravatar image

When I run the beginner tutorials for publisher/suscriber or service/client I get the following error:

add_two_ints_server: /usr/include/boost/smart_ptr/shared_ptr.hpp:418: boost::shared_ptr<t>::reference boost::shared_ptr<t>::operator*() const [with T = boost::regex_traits_wrapper<boost::regex_traits<char> >; boost::shared_ptr<t>::reference = boost::regex_traits_wrapper<boost::regex_traits<char> >&]: Assertion `px != 0' failed. Aborted (core dumped)

It seems to me that the code is exactly the same as those in the tutorial, I am not sure if there is a configuration problem.

The files were made correctly by make.

edit retag flag offensive close merge delete


What Ubuntu and ROS version are you using?

Oier gravatar image Oier  ( 2013-03-14 01:01:00 -0500 )edit

Can you post the CMake file?

yigit gravatar image yigit  ( 2013-03-14 06:24:09 -0500 )edit

Are they exactly the same or do they just seem like that? You can easily check with tools like meld or diffuse. Looks like a pointer mistake for me.

felix k gravatar image felix k  ( 2013-03-14 07:18:34 -0500 )edit


Added the following lines in CMake.. rosbuild_add_executable(talker src/talker.cpp) rosbuild_add_executable(listener src/listener.cpp) rosbuild_add_executable(add_two_ints_server src/add_two_ints_server.cpp) rosbuild_add_executable(add_two_ints_client src/add_two_ints_client.cpp)

Juan gravatar image Juan  ( 2013-03-14 18:17:25 -0500 )edit

I tried running it in different ways and I am not sure sometimes no exceptions come along. I did notice however, a difference between the c++ produced code and python produced code.

In cpp pub/sub: [${severity}] [${time}]: ${message} In python: INFO] [WallTime: 1363321815.771314] hello world 136

Juan gravatar image Juan  ( 2013-03-14 18:31:27 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-03-15 04:19:14 -0500

yigit gravatar image

updated 2013-03-15 04:19:51 -0500

I am sorry Juan, I don't know how it works for groovy yet, but a similar error is caused in fuerte too, when you don't link boost libraries in CMakeLists.txt. Here is an example

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


Asked: 2013-03-14 00:53:01 -0500

Seen: 773 times

Last updated: Mar 14 '13