You want to call subscriber.shutdown(), not ros::shutdown().
Another possibility is to use waitForMessage this:
https://code.ros.org/trac/ros/ticket/2084
It gets you a single message from a topic.
On 6/24/10, Prasad Dixit <
prasad.dixit@fennecfoxtech.com> wrote:
> Hi,
>
> Thanks for the information.
> Sorry from my side for not giving full information.
> I have a main program which is doing some processes before getting robot
> initial position (amcl_pose) and also some processes are being executed
> after that.
> I tried shutdown() function already but it does not return control to the
> main program.
> So my post processes are not being called.
>
> -Thanks
> Prasad
>
>
>