Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rosjava_actionlib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Ebert
rosjava_actionlib
Commits
b865a703
Commit
b865a703
authored
9 years ago
by
Ernesto Corbellini
Browse files
Options
Downloads
Patches
Plain Diff
Fixed string compare in goal id.
Made private most of the properties in ActionClient class.
parent
5aaded2f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/rosjava_actionlib/rosjava_actionlib/src/main/java/com/github/ekumen/rosjava_actionlib/ActionClient.java
+25
-15
25 additions, 15 deletions
...ava/com/github/ekumen/rosjava_actionlib/ActionClient.java
with
25 additions
and
15 deletions
src/rosjava_actionlib/rosjava_actionlib/src/main/java/com/github/ekumen/rosjava_actionlib/ActionClient.java
+
25
−
15
View file @
b865a703
...
...
@@ -46,21 +46,21 @@ public class ActionClient<T_ACTION_GOAL extends Message,
T_ACTION_GOAL
actionGoal
;
ClientGoalManager
<
T_ACTION_GOAL
>
goalManager
;
String
actionGoalType
;
String
actionResultType
;
String
actionFeedbackType
;
Publisher
<
T_ACTION_GOAL
>
goalPublisher
=
null
;
Publisher
<
GoalID
>
cancelPublisher
=
null
;
Subscriber
<
T_ACTION_RESULT
>
serverResult
=
null
;
Subscriber
<
T_ACTION_FEEDBACK
>
serverFeedback
=
null
;
Subscriber
<
GoalStatusArray
>
serverStatus
=
null
;
ConnectedNode
node
=
null
;
String
actionName
;
ActionClientListener
callbackTarget
=
null
;
private
String
actionGoalType
;
private
String
actionResultType
;
private
String
actionFeedbackType
;
private
Publisher
<
T_ACTION_GOAL
>
goalPublisher
=
null
;
private
Publisher
<
GoalID
>
cancelPublisher
=
null
;
private
Subscriber
<
T_ACTION_RESULT
>
serverResult
=
null
;
private
Subscriber
<
T_ACTION_FEEDBACK
>
serverFeedback
=
null
;
private
Subscriber
<
GoalStatusArray
>
serverStatus
=
null
;
private
ConnectedNode
node
=
null
;
private
String
actionName
;
private
ActionClientListener
callbackTarget
=
null
;
GoalIDGenerator
goalIdGenerator
=
null
;
volatile
boolean
statusReceivedFlag
=
false
;
volatile
boolean
feedbackPublisherFlag
=
false
;
volatile
boolean
resultPublisherFlag
=
false
;
private
volatile
boolean
statusReceivedFlag
=
false
;
private
volatile
boolean
feedbackPublisherFlag
=
false
;
private
volatile
boolean
resultPublisherFlag
=
false
;
private
Log
log
=
LogFactory
.
getLog
(
ActionClient
.
class
);
/**
...
...
@@ -263,6 +263,10 @@ public class ActionClient<T_ACTION_GOAL extends Message,
* depends on the application.
*/
public
void
gotFeedback
(
T_ACTION_FEEDBACK
message
)
{
ActionFeedback
<
T_ACTION_FEEDBACK
>
af
=
new
ActionFeedback
(
message
);
if
(
af
.
getGoalStatusMessage
().
getGoalId
().
getId
().
equals
(
goalManager
.
actionGoal
.
getGoalId
()))
{
goalManager
.
updateStatus
(
af
.
getGoalStatusMessage
().
getStatus
());
}
// Propagate the callback
if
(
callbackTarget
!=
null
)
{
callbackTarget
.
feedbackReceived
(
message
);
...
...
@@ -281,6 +285,8 @@ public class ActionClient<T_ACTION_GOAL extends Message,
if
(
gstat
!=
null
)
{
// update the goal status tracking
goalManager
.
updateStatus
(
gstat
.
getStatus
());
}
else
{
log
.
info
(
"Status update is not for our goal!"
);
}
// Propagate the callback
if
(
callbackTarget
!=
null
)
{
...
...
@@ -300,7 +306,8 @@ public class ActionClient<T_ACTION_GOAL extends Message,
GoalStatus
gstat
=
null
;
List
<
GoalStatus
>
statusList
=
statusMessage
.
getStatusList
();
for
(
GoalStatus
s
:
statusList
)
{
if
(
s
.
getGoalId
().
getId
()
==
goalManager
.
actionGoal
.
getGoalId
())
{
log
.
info
(
"Found >> "
+
s
.
getGoalId
().
getId
()
+
" when searching for >> "
+
goalManager
.
actionGoal
.
getGoalId
());
if
(
s
.
getGoalId
().
getId
().
equals
(
goalManager
.
actionGoal
.
getGoalId
()))
{
// this is the goal we are interested in
gstat
=
s
;
}
...
...
@@ -347,6 +354,9 @@ public class ActionClient<T_ACTION_GOAL extends Message,
}
}
public
int
getGoalState
()
{
return
goalManager
.
getGoalState
();
}
/**
* Finish the action client. Unregister publishers and listeners.
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment