Skip to content

Commit ea19094

Browse files
committed
Flexitino : final behaviour change with fixed gripping states
1 parent c4d1133 commit ea19094

File tree

1 file changed

+37
-20
lines changed

1 file changed

+37
-20
lines changed

caro_skills_flexbe_behaviors/caro_skills_flexbe_behaviors/Gripper_whole_process_sm.py

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646

4747

4848
from caro_skills_flexbe_states.Calibrate_state import CalibratetoOrigin
49+
from caro_skills_flexbe_states.gripper_close_gigatino_state import GripperCloseState
4950
from caro_skills_flexbe_states.gripper_gigatino_state import GripperState
5051
from caro_skills_flexbe_states.home_state import BackToOrigin
5152
from caro_skills_flexbe_states.move_gripper_state import GripperMove
@@ -106,7 +107,8 @@ def create(self):
106107
_state_machine.userdata.use_gripper = False
107108
_state_machine.userdata.target_frame = 'robotinobase1/end_effector_home'
108109
_state_machine.userdata.relative = False
109-
_state_machine.userdata.open = False
110+
_state_machine.userdata.open = True
111+
_state_machine.userdata.close = False
110112

111113
# Additional creation code can be added inside the following tags
112114
# [MANUAL_CREATE]
@@ -119,24 +121,39 @@ def create(self):
119121
OperatableStateMachine.add('calibrate',
120122
CalibratetoOrigin(timeout=10,
121123
action_topic='robotinobase1/gigatino/calibrate'),
122-
transitions={'pose_reached': 'move_above' # 314 98 -1 -1 -1 -1
123-
, 'failed': 'failed' # 143 272 -1 -1 -1 -1
124-
, 'canceled': 'failed' # 143 272 -1 -1 -1 -1
125-
, 'timeout': 'failed' # 143 272 -1 -1 -1 -1
124+
transitions={'pose_reached': 'move_above' # 314 10 -1 -1 -1 -1
125+
, 'failed': 'move_above' # 314 10 -1 -1 -1 -1
126+
, 'canceled': 'move_above' # 314 10 -1 -1 -1 -1
127+
, 'timeout': 'move_above' # 314 10 -1 -1 -1 -1
126128
},
127129
autonomy={'pose_reached': Autonomy.Off,
128130
'failed': Autonomy.Off,
129131
'canceled': Autonomy.Off,
130132
'timeout': Autonomy.Off})
131133

132-
# x:616 y:51
134+
# x:891 y:155
135+
OperatableStateMachine.add('close_gripper',
136+
GripperCloseState(timeout=10,
137+
action_topic='robotinobase1/gigatino/gripper'),
138+
transitions={'success': 'up' # 943 266 -1 -1 -1 -1
139+
, 'failed': 'failed' # 514 301 -1 -1 -1 -1
140+
, 'canceled': 'failed' # 514 301 -1 -1 -1 -1
141+
, 'timeout': 'failed' # 514 301 -1 -1 -1 -1
142+
},
143+
autonomy={'success': Autonomy.Off,
144+
'failed': Autonomy.Off,
145+
'canceled': Autonomy.Off,
146+
'timeout': Autonomy.Off},
147+
remapping={'close': 'close'})
148+
149+
# x:790 y:38
133150
OperatableStateMachine.add('down',
134151
GripperMove(timeout=10,
135152
action_topic='robotinobase1/gigatino/move'),
136-
transitions={'reached': 'grip' # 782 129 -1 -1 -1 -1
137-
, 'failed': 'failed' # 380 255 -1 -1 -1 -1
138-
, 'canceled': 'failed' # 380 255 -1 -1 -1 -1
139-
, 'timeout': 'failed' # 380 255 -1 -1 -1 -1
153+
transitions={'reached': 'close_gripper' # 873 95 -1 -1 -1 -1
154+
, 'failed': 'failed' # 470 250 -1 -1 -1 -1
155+
, 'canceled': 'failed' # 470 250 -1 -1 -1 -1
156+
, 'timeout': 'failed' # 470 250 -1 -1 -1 -1
140157
},
141158
autonomy={'reached': Autonomy.Off,
142159
'failed': Autonomy.Off,
@@ -150,14 +167,14 @@ def create(self):
150167
'gripper_state': 'gripper_state',
151168
'use_gripper': 'use_gripper'})
152169

153-
# x:797 y:122
170+
# x:529 y:37
154171
OperatableStateMachine.add('grip',
155172
GripperState(timeout=10,
156173
action_topic='robotinobase1/gigatino/gripper'),
157-
transitions={'success': 'up' # 889 272 -1 -1 -1 -1
158-
, 'failed': 'failed' # 467 287 -1 -1 -1 -1
159-
, 'canceled': 'failed' # 467 287 -1 -1 -1 -1
160-
, 'timeout': 'failed' # 467 287 -1 -1 -1 -1
174+
transitions={'success': 'down' # 706 38 -1 -1 -1 -1
175+
, 'failed': 'failed' # 332 252 -1 -1 -1 -1
176+
, 'canceled': 'failed' # 332 252 -1 -1 -1 -1
177+
, 'timeout': 'failed' # 332 252 -1 -1 -1 -1
161178
},
162179
autonomy={'success': Autonomy.Off,
163180
'failed': Autonomy.Off,
@@ -179,14 +196,14 @@ def create(self):
179196
'canceled': Autonomy.Off,
180197
'timeout': Autonomy.Off})
181198

182-
# x:342 y:72
199+
# x:342 y:25
183200
OperatableStateMachine.add('move_above',
184201
GripperMoveUp(timeout=10,
185202
action_topic='robotinobase1/gigatino/move'),
186-
transitions={'reached': 'down' # 563 91 -1 -1 -1 -1
187-
, 'failed': 'failed' # 240 262 -1 -1 -1 -1
188-
, 'canceled': 'failed' # 240 262 -1 -1 -1 -1
189-
, 'timeout': 'failed' # 240 262 -1 -1 -1 -1
203+
transitions={'reached': 'grip' # 516 28 -1 -1 -1 -1
204+
, 'failed': 'failed' # 240 242 -1 -1 -1 -1
205+
, 'canceled': 'failed' # 240 242 -1 -1 -1 -1
206+
, 'timeout': 'failed' # 240 242 -1 -1 -1 -1
190207
},
191208
autonomy={'reached': Autonomy.Off,
192209
'failed': Autonomy.Off,

0 commit comments

Comments
 (0)