Skip to content

Commit d0ab791

Browse files
committed
color fix in stream_segmentation; also rviz change
1 parent dcc97a6 commit d0ab791

File tree

2 files changed

+90
-56
lines changed

2 files changed

+90
-56
lines changed

spot/ros_ws/src/rbd_spot_perception/scripts/stream_segmentation.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,13 @@ def publish_result(self, pred, visual_img, depth_img, caminfo):
181181
continue # we won't have points for this mask
182182
x = x[keep_indices]
183183
y = y[keep_indices]
184-
rgb = [struct.unpack('I', struct.pack('BBBB',
185-
mask_visual[i][0],
186-
mask_visual[i][1],
187-
mask_visual[i][2], 255))[0]
184+
color = [struct.unpack('I', struct.pack('BBBB',
185+
mask_visual[i][2],
186+
mask_visual[i][1],
187+
mask_visual[i][0], 255))[0]
188188
for i in keep_indices]
189189
# The points for a single detection mask
190-
mask_points = [[x[i], y[i], z[i], rgb[i]]
190+
mask_points = [[x[i], y[i], z[i], color[i]]
191191
for i in range(len(x))]
192192
points.extend(mask_points)
193193
try:
@@ -302,6 +302,7 @@ def main():
302302
if args.camera != "hand":
303303
# grayscale image; make it 3 channels
304304
image = cv2.merge([image, image, image])
305+
305306
depth_image = rbd_spot.image.imgarray_from_imgmsg(depth_msg)
306307

307308
image_input = torch.tensor(image)

spot/ros_ws/src/rbd_spot_perception/viz/object_segmentation.rviz

Lines changed: 84 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ Panels:
66
Expanded:
77
- /Global Options1
88
- /Status1
9+
- /PointCloud21
910
- /TF1/Frames1
11+
- /map1
1012
Splitter Ratio: 0.5
1113
Tree Height: 560
1214
- Class: rviz/Selection
@@ -194,13 +196,13 @@ Visualization Manager:
194196
Unreliable: false
195197
Value: true
196198
- Class: rviz/MarkerArray
197-
Enabled: true
199+
Enabled: false
198200
Marker Topic: /spot/segmentation/hand/result_boxes_viz
199201
Name: MarkerArray
200202
Namespaces:
201-
"": true
203+
{}
202204
Queue Size: 100
203-
Value: true
205+
Value: false
204206
- Alpha: 1
205207
Autocompute Intensity Bounds: true
206208
Autocompute Value Bounds:
@@ -274,6 +276,8 @@ Visualization Manager:
274276
Value: false
275277
gpe:
276278
Value: false
279+
graphnav_map:
280+
Value: true
277281
gripper_color_camera_z_forward:
278282
Value: true
279283
hand:
@@ -305,57 +309,86 @@ Visualization Manager:
305309
Show Axes: true
306310
Show Names: true
307311
Tree:
308-
body:
309-
base_link:
310-
arm0.link_sh0:
311-
arm0.link_sh1:
312-
arm0.link_el0:
313-
arm0.link_el1:
314-
arm0.link_wr0:
315-
arm0.link_wr1:
316-
arm0.link_fngr:
317-
{}
318-
flat_body:
319-
{}
320-
front_left_hip:
321-
front_left_upper_leg:
322-
front_left_lower_leg:
323-
{}
324-
front_rail:
325-
{}
326-
front_right_hip:
327-
front_right_upper_leg:
328-
front_right_lower_leg:
329-
{}
330-
hand:
331-
PicoFlexx_HAND:
332-
PicoFlexx_HAND_z_forward:
333-
gripper_color_camera_z_forward:
312+
graphnav_map:
313+
body:
314+
base_link:
315+
arm0.link_sh0:
316+
arm0.link_sh1:
317+
arm0.link_el0:
318+
arm0.link_el1:
319+
arm0.link_wr0:
320+
arm0.link_wr1:
321+
arm0.link_fngr:
322+
{}
323+
flat_body:
324+
{}
325+
front_left_hip:
326+
front_left_upper_leg:
327+
front_left_lower_leg:
334328
{}
335-
link_wr1:
336-
{}
337-
odom:
338-
gpe:
329+
front_rail:
339330
{}
340-
rear_left_hip:
341-
rear_left_upper_leg:
342-
rear_left_lower_leg:
343-
{}
344-
rear_rail:
345-
{}
346-
rear_right_hip:
347-
rear_right_upper_leg:
348-
rear_right_lower_leg:
331+
front_right_hip:
332+
front_right_upper_leg:
333+
front_right_lower_leg:
334+
{}
335+
hand:
336+
PicoFlexx_HAND:
337+
PicoFlexx_HAND_z_forward:
338+
gripper_color_camera_z_forward:
339+
{}
340+
link_wr1:
341+
{}
342+
odom:
343+
gpe:
349344
{}
350-
vision:
351-
{}
345+
rear_left_hip:
346+
rear_left_upper_leg:
347+
rear_left_lower_leg:
348+
{}
349+
rear_rail:
350+
{}
351+
rear_right_hip:
352+
rear_right_upper_leg:
353+
rear_right_lower_leg:
354+
{}
355+
vision:
356+
{}
352357
Update Interval: 0
353358
Value: true
359+
- Alpha: 1
360+
Autocompute Intensity Bounds: true
361+
Autocompute Value Bounds:
362+
Max Value: 10
363+
Min Value: -10
364+
Value: true
365+
Axis: Z
366+
Channel Name: intensity
367+
Class: rviz/PointCloud2
368+
Color: 255; 255; 255
369+
Color Transformer: Intensity
370+
Decay Time: 0
371+
Enabled: true
372+
Invert Rainbow: false
373+
Max Color: 255; 255; 255
374+
Min Color: 0; 0; 0
375+
Name: map
376+
Position Transformer: XYZ
377+
Queue Size: 10
378+
Selectable: true
379+
Size (Pixels): 3
380+
Size (m): 0.009999999776482582
381+
Style: Flat Squares
382+
Topic: /graphnav_map_publisher/graphnav_points
383+
Unreliable: false
384+
Use Fixed Frame: true
385+
Use rainbow: true
386+
Value: true
354387
Enabled: true
355388
Global Options:
356389
Background Color: 48; 48; 48
357390
Default Light: true
358-
Fixed Frame: body
391+
Fixed Frame: graphnav_map
359392
Frame Rate: 30
360393
Name: root
361394
Tools:
@@ -379,25 +412,25 @@ Visualization Manager:
379412
Views:
380413
Current:
381414
Class: rviz/Orbit
382-
Distance: 2.7659404277801514
415+
Distance: 3.061720609664917
383416
Enable Stereo Rendering:
384417
Stereo Eye Separation: 0.05999999865889549
385418
Stereo Focal Distance: 1
386419
Swap Stereo Eyes: false
387420
Value: false
388421
Field of View: 0.7853981852531433
389422
Focal Point:
390-
X: 0.9057747721672058
391-
Y: 0.13793638348579407
392-
Z: 0.3799246847629547
423+
X: 1.2879971265792847
424+
Y: 2.22208309173584
425+
Z: 0.8581368923187256
393426
Focal Shape Fixed Size: true
394427
Focal Shape Size: 0.05000000074505806
395428
Invert Z Axis: false
396429
Name: Current View
397430
Near Clip Distance: 0.009999999776482582
398-
Pitch: 0.27539899945259094
431+
Pitch: 0.6753986477851868
399432
Target Frame: <Fixed Frame>
400-
Yaw: 1.5485773086547852
433+
Yaw: 3.3035805225372314
401434
Saved: ~
402435
Window Geometry:
403436
Displays:

0 commit comments

Comments
 (0)