ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

boost assertion in service callback

asked 2011-03-11 12:50:04 -0500

mkrainin gravatar image

updated 2011-03-18 07:46:54 -0500

tfoote gravatar image

I have a node which offers 3 services: add_view, clear_views, and next_best_view. Using rosservice call, I can call add_view and clear_views without any problems, but calling next_best_view, I run into the following on the node's end (gdb output):

Program received signal SIGILL, Illegal instruction.
0x000000000042b32a in next_best_view::ViewGeneratorODE::processNBVRequest (
    this=0x7fffffffdd70, request=..., response=<value optimized out>)
    at /usr/include/boost/smart_ptr/shared_ptr.hpp:418
418             BOOST_ASSERT(px != 0);
(gdb) bt
#0  0x000000000042b32a in next_best_view::ViewGeneratorODE::processNBVRequest (
    this=0x7fffffffdd70, request=..., response=<value optimized out>)
    at /usr/include/boost/smart_ptr/shared_ptr.hpp:418
#1  0x000000000043c92b in operator() (this=0x7fffc835d150, params=...)
    at /usr/include/boost/function/function_template.hpp:1013
#2  call (this=0x7fffc835d150, params=...)
    at /opt/ros/diamondback/stacks/ros_comm/clients/cpp/roscpp/include/ros/service_callback_helper.h:136
#3  ros::ServiceCallbackHelperT<ros::ServiceSpec<next_best_view::NextBestViewRequest_<std::allocator<void> >, next_best_view::NextBestViewResponse_<std::allocator<void> > > >::call (this=0x7fffc835d150, params=...)
    at /opt/ros/diamondback/stacks/ros_comm/clients/cpp/roscpp/include/ros/service_callback_helper.h:194
#4  0x00007fffe4232938 in ros::ServiceCallback::call (this=0x725710)
    at /tmp/buildd/ros-diamondback-ros-comm-1.4.5/debian/ros-diamondback-ros-comm/opt/ros/diamondback/stacks/ros_comm/clients/cpp/roscpp/src/libros/service_publication.cpp:123
#5  0x00007fffe4245771 in ros::CallbackQueue::callOneCB (this=0x707150, 
    at /tmp/buildd/ros-diamondback-ros-comm-1.4.5/debian/ros-diamondback-ros-comm/opt/ros/diamondback/stacks/ros_comm/clients/cpp/roscpp/src/libros/callback_queue.cpp:381
#6  0x00007fffe4245deb in ros::CallbackQueue::callAvailable (this=0x707150, 
    timeout=<value optimized out>)
    at /tmp/buildd/ros-diamondback-ros-comm-1.4.5/debian/ros-diamondback-ros-comm/opt/ros/diamondback/stacks/ros_comm/clients/cpp/roscpp/src/libros/callback_queue.cpp:333
#7  0x00007fffe424a2d9 in ros::SingleThreadedSpinner::spin (
    this=<value optimized out>, queue=0x707150)
    at /tmp/buildd/ros-diamondback-ros-comm-1.4.5/debian/ros-diamondback-ros-comm/opt/ros/diamondback/stacks/ros_comm/clients/cpp/roscpp/src/libros/spinner.cpp:49
#8  0x00007fffe41d2d7b in ros::spin ()
    at /tmp/buildd/ros-diamondback-ros-comm-1.4.5/debian/ros-diamondback-ros-comm/opt/ros/diamondback/stacks/ros_comm/clients/cpp/roscpp/src/libros/init.cpp:488
#9  0x0000000000427560 in next_best_view::ViewGeneratorODE::start (
    at /home/marvin/extra-stacks/rgbd-ros-pkg/object_modeling/next_best_view/src/next_best_view/view_generator_ode_node.cpp:145
#10 0x0000000000427b19 in main (argc=1, argv=0x7fffffffe198)
    at /home/marvin/extra-stacks/rgbd-ros-pkg/object_modeling/next_best_view/src/next_best_view/view_generator_ode_node.cpp:491

Any thoughts on where the problem might lie? It doesn't seem to get as far as running the code within the callback, so I'm a bit confused why this service should fail while the other two work fine. Also, this is code that was working in cturtle but is no longer running under diamondback (to the best of my knowledge, the code hasn't changed inbetween).

Some additional information if it's useful.

Service definition:
string ply_file # object model with confidences
float32[] joint_angles
geometry_msgs/Vector3 object_center #in the coords of the ply
geometry_msgs/Transform object_to_end_effector
geometry_msgs/Transform camera_pose
int32 num_candidates
float32 min_quality #min quality to be worthwhile
float32 time_weight #how much extra quality is needed to justify an extra second of trajectory
float32 velocity
float32 total_entropy
float32 best_quality
geometry_msgs/Transform view_camera_pose # in the coords of the ply
float32[] view_joint_angles
geometry_msgs/Vector3 view_dir #camera to object ...


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2011-03-14 06:03:02 -0500

mkrainin gravatar image

Found the problem. It did end up being in my callback function (though why it showed up in the backtrace as a boost assertion is beyond me).

The problem was simply that I had added an extra ROS_INFO at some point with a '%s' argument. I forgot the .c_str() on the string, and apparently gdb doesn't give useful output in this scenario. Sorry for all the noise.


edit flag offensive delete link more

Question Tools


Asked: 2011-03-11 12:50:04 -0500

Seen: 439 times

Last updated: Mar 18 '11