|
From: <vij...@us...> - 2009-08-21 01:24:42
|
Revision: 22515
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=22515&view=rev
Author: vijaypradeep
Date: 2009-08-21 01:24:36 +0000 (Fri, 21 Aug 2009)
Log Message:
-----------
SimpleActionClient can now never return a NULL result. Thus, user never needs to do NULL check on result
Modified Paths:
--------------
pkg/trunk/stacks/common/actionlib/include/actionlib/client/simple_action_client.h
Modified: pkg/trunk/stacks/common/actionlib/include/actionlib/client/simple_action_client.h
===================================================================
--- pkg/trunk/stacks/common/actionlib/include/actionlib/client/simple_action_client.h 2009-08-21 01:23:44 UTC (rev 22514)
+++ pkg/trunk/stacks/common/actionlib/include/actionlib/client/simple_action_client.h 2009-08-21 01:24:36 UTC (rev 22515)
@@ -134,7 +134,7 @@
/**
* \brief Get the Result of the current goal
- * \return shared pointer to the result
+ * \return shared pointer to the result. Note that this pointer will NEVER be NULL
*/
//ResultConstPtr getResult();
ResultConstPtr getResult();
@@ -337,7 +337,11 @@
{
if (gh_.isExpired())
ROS_ERROR("Trying to getResult() when no goal is running. You are incorrectly using SimpleActionClient");
- return gh_.getResult();
+
+ if (gh_.getResult())
+ return gh_.getResult();
+
+ return ResultConstPtr(new Result);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|