[ros-users] actionlib cancel message lost on shutdown

Axelrod, Benjamin baxelrod at irobot.com
Thu Feb 17 14:10:45 UTC 2011


Just a quick follow up.  I was simply polling for rospy.is_shutdown().  So no publications were getting out once this flag was True.  Now, I added a handler to: rospy.on_shutdown() which sends the cancel request.  The wiki says that messages sent from this handler are not guaranteed to be sent, but it has worked fine for me so far.

I'll direct future questions to http://answers.ros.org.  it looks very helpful.

Thanks,
-Ben

-----Original Message-----
From: ros-users-bounces at code.ros.org [mailto:ros-users-bounces at code.ros.org] On Behalf Of Blaise Gassend
Sent: Wednesday, February 16, 2011 12:22 PM
To: User discussions
Subject: Re: [ros-users] actionlib cancel message lost on shutdown

Not sure how you are intercepting the CTRL+C, but if you are waiting
for is_shutdown to become true then ROS has been shut down before you
take action.

I believe that to do what you are trying to do, you need to set up
your own CTRL-C handler that publishes, waits a bit to let the message
get out (ideally wait until the server confirms that the action is
cancelled), and then tells rospy to shut down (I forget the exact
call).

Blaise

On Wed, Feb 16, 2011 at 8:44 AM, Axelrod, Benjamin <baxelrod at irobot.com> wrote:
> I am trying to set up my actionlib server so that when I CTRL-C on the
> server, it sends a cancel goal message to the client.  (The client was
> started via separate terminal / launch script so will continue to run).  I
> am finding that the "/my_action_server/cancel" message never gets
> published.  I have so far only tested in python.  I am wondering if this is
> a limitation of rospy or bug/feature in actionlib.
>
>
>
> Thanks,
>
> -Ben
>
>
>
> Ben Axelrod
>
> Research Scientist
>
> iRobot Corporation
>
> 8 Crosby Drive, Mail Stop 8-1
>
> Bedford, MA 01730
>
> (781) 430-3315 (Tel)
>
> (781) 960-2628 (Fax)
>
> baxelrod at irobot.com
>
>
>
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
>
_______________________________________________
ros-users mailing list
ros-users at code.ros.org
https://code.ros.org/mailman/listinfo/ros-users



More information about the ros-users mailing list