Skip to content

Commit 8e9550e

Browse files
committed
Support object index (symbol) as part of action messages
1 parent 05b5abf commit 8e9550e

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

robot_executor_interface/robot_executor_interface/src/robot_executor_interface/action_descriptions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class Gaze:
2121
frame: str
2222
robot_point: np.ndarray
2323
gaze_point: np.ndarray
24+
object_id: str
2425
stow_after: bool = False
2526

2627

@@ -30,6 +31,7 @@ class Pick:
3031
object_class: str
3132
robot_point: np.ndarray
3233
object_point: np.ndarray
34+
object_id: str
3335

3436

3537
@dataclass
@@ -38,3 +40,4 @@ class Place:
3840
object_class: str
3941
robot_point: np.ndarray
4042
object_point: np.ndarray
43+
object_id: str

robot_executor_interface/robot_executor_interface_ros/src/robot_executor_interface_ros/action_descriptions_ros.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,14 @@ def gaze_from_msg(msg):
153153
robot_point = np.array([msg.robot_point.x, msg.robot_point.y, msg.robot_point.z])
154154
gaze_point = np.array([msg.gaze_point.x, msg.gaze_point.y, msg.gaze_point.z])
155155
stow_after = msg.place_frame == "STOW"
156+
object_id = msg.object_id
156157

157158
return Gaze(
158159
frame=msg.gaze_frame,
159160
robot_point=robot_point,
160161
gaze_point=gaze_point,
161162
stow_after=stow_after,
163+
object_id=object_id,
162164
)
163165

164166

@@ -167,8 +169,6 @@ def _(action: Gaze):
167169
msg = ActionMsg()
168170
msg.action_type = msg.GAZE
169171

170-
print(action.robot_point[0])
171-
print(type(action.robot_point[0]))
172172
msg.robot_point.x = action.robot_point[0]
173173
msg.robot_point.y = action.robot_point[1]
174174
msg.robot_point.z = action.robot_point[2]
@@ -179,6 +179,8 @@ def _(action: Gaze):
179179

180180
msg.place_frame = "STOW" if action.stow_after else "NO_STOW"
181181

182+
msg.object_id = action.object_id
183+
182184
return msg
183185

184186

@@ -223,6 +225,7 @@ def pick_from_msg(msg):
223225
object_class=msg.object_class,
224226
robot_point=robot_point,
225227
object_point=object_point,
228+
object_id=msg.object_id,
226229
)
227230

228231

@@ -240,6 +243,7 @@ def _(action: Pick):
240243
msg.object_point.z = action.object_point[2]
241244

242245
msg.object_class = action.object_class
246+
msg.object_id = action.object_id
243247

244248
return msg
245249

@@ -285,6 +289,7 @@ def place_from_msg(msg):
285289
object_class=msg.object_class,
286290
robot_point=robot_point,
287291
object_point=object_point,
292+
obejct_id=msg.object_id,
288293
)
289294

290295

@@ -301,6 +306,8 @@ def _(action: Place):
301306
msg.object_point.y = action.object_point[1]
302307
msg.object_point.z = action.object_point[2]
303308

309+
msg.object_id = action.object_id
310+
304311
return msg
305312

306313

robot_executor_interface/robot_executor_msgs/msg/ActionMsg.msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ geometry_msgs/Point gaze_point
2424
string pick_frame
2525
string object_class
2626
geometry_msgs/Point object_point
27+
string object_id
2728

2829
# Definition for PLACE
2930
string place_frame

0 commit comments

Comments
 (0)