ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
boost::shared_ptr
are explicitly designed to be shared between threads; the function prototype for your callback seems fine.
I would run your program through a debugger (gdb) to determine the location of the segfault.
(It's also odd that you're calling _nh.shutdown()
when you want to unsubscribe from a single topic, because this will shut down your entire process; not just a single subscriber).