-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add get_goal_status_text method to proxy_action_client; add user_data…
…_state to flexbe_states
- Loading branch information
David Conner
committed
Apr 30, 2023
1 parent
c3d521c
commit ae7289e
Showing
4 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env python | ||
|
||
from flexbe_core import EventState, Logger | ||
|
||
''' | ||
Created on 14-Feb-2018 | ||
@author: David Conner | ||
''' | ||
|
||
class UserDataState(EventState): | ||
''' | ||
Implements a state that defines user data | ||
-- data type Data for given user data | ||
#> data User data | ||
<= done Created the user data | ||
''' | ||
|
||
|
||
def __init__(self, data ): | ||
''' | ||
Constructor | ||
''' | ||
super(UserDataState, self).__init__( output_keys=["data"], outcomes=["done"]) | ||
|
||
self._my_data = data | ||
self._return_code = None | ||
|
||
def execute(self, userdata): | ||
''' | ||
Execute this state | ||
''' | ||
return self._return_code | ||
|
||
|
||
def on_enter(self, userdata): | ||
|
||
try: | ||
# Add the user data | ||
userdata.data = self._my_data | ||
self._return_code = 'done' | ||
except: | ||
raise ValueError('UserDataState %s - invalid data ' % self.name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
path: flexbe_states.user_data_state | ||
class: UserDataState | ||
|
||
params: | ||
data: "Test data" | ||
|
||
output: | ||
data: "Test data" | ||
|
||
outcome: done |