Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
labrobotica
ros
iri_core
iri_ros_tools
Commits
a21321f7
Commit
a21321f7
authored
Oct 10, 2017
by
Sergi Hernandez
Browse files
Changes to avoid checking the action state when the action is not active.
parent
0b655d6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/iri_ros_tools/module_action.h
View file @
a21321f7
...
...
@@ -665,10 +665,13 @@ template<class action_ros>
void
CModuleAction
<
action_ros
>::
cancel
(
void
)
{
actionlib
::
SimpleClientGoalState
action_state
(
actionlib
::
SimpleClientGoalState
::
PENDING
);
action_state
=
action_client
->
getState
();
if
(
action_state
==
actionlib
::
SimpleClientGoalState
::
ACTIVE
)
this
->
action_client
->
cancelGoal
();
if
(
this
->
status
==
ACTION_RUNNING
)
{
action_state
=
action_client
->
getState
();
if
(
action_state
==
actionlib
::
SimpleClientGoalState
::
ACTIVE
)
this
->
action_client
->
cancelGoal
();
}
}
template
<
class
action_ros
>
...
...
@@ -676,9 +679,14 @@ bool CModuleAction<action_ros>::is_finished(void)
{
actionlib
::
SimpleClientGoalState
action_state
(
actionlib
::
SimpleClientGoalState
::
PENDING
);
action_state
=
action_client
->
getState
();
if
(
action_state
==
actionlib
::
SimpleClientGoalState
::
ACTIVE
)
return
false
;
if
(
this
->
status
==
ACTION_RUNNING
)
{
action_state
=
action_client
->
getState
();
if
(
action_state
==
actionlib
::
SimpleClientGoalState
::
ACTIVE
)
return
false
;
else
return
true
;
}
else
return
true
;
}
...
...
@@ -688,9 +696,9 @@ action_status CModuleAction<action_ros>::get_state(void)
{
actionlib
::
SimpleClientGoalState
action_state
(
actionlib
::
SimpleClientGoalState
::
PENDING
);
action_state
=
action_client
->
getState
();
if
(
this
->
status
==
ACTION_RUNNING
)
{
action_state
=
action_client
->
getState
();
if
(
this
->
use_timeout
&&
this
->
is_timeout_active
())
this
->
status
=
ACTION_TIMEOUT
;
if
(
this
->
is_watchdog_active
())
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment