File size: 4,995 Bytes
2d6bfa0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
.. _object_segmentation:

Object Segmentation
===================

.. _3d_object_segmentation:

3D object segmentation
-------------------------

Our scene segmentation works with the assumption that the table has to be parallel 
to the ground as we use 
`SampleConsensusModelPerpendicularPlane <https://pointclouds.org/documentation/classpcl_1_1_sample_consensus_model_perpendicular_plane.html>`_
from PCL library. We keep points which are perpendicular to `z` axis.

There are two packages you can launch in order to segment table top point clouds:

*mir_object_segmentation* package 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

`mir_object_segmentation <https://github.com/b-it-bots/mas_industrial_robotics/tree/melodic/mir_perception/mir_object_segmentation>`_ 
package can be used to accumulate clouds from different views (if necessary),
register them, and then segment the objects above the table.

**Usage**

* Find plane height

  To find the object height, you have to send the following messages to `event_in`
  topic:

  .. code-block:: bash

    rostopic pub /mir_perception/scene_segmentation/event_in std_msgs/String e_start
    rostopic pub /mir_perception/scene_segmentation/event_in std_msgs/String e_add_cloud_start
    rostopic pub /mir_perception/scene_segmentation/event_in std_msgs/String e_find_plane

  The plane height will be published to `workspace_height` topic:

  .. code-block:: bash
    
    /mir_perception/scene_segmentation/output/workspace_height


* Segment objects from one view point

  .. code-block:: bash

    rostopic pub /mir_perception/scene_segmentation/event_in std_msgs/String e_start
    rostopic pub /mir_perception/scene_segmentation/event_in std_msgs/String e_add_cloud_start
    rostopic pub /mir_perception/scene_segmentation/event_in std_msgs/String e_segment
    rostopic pub /mir_perception/scene_segmentation/event_in std_msgs/String e_stop

* Segment objects from one view point

  You can segment table top objects from multiple viewpoints. You can do this by 
  manually moving the camera position to a new view point, and then register 
  the cloud with the existing ones.

  .. code-block:: bash

    # accumulate point cloud from the 1st view point
    rostopic pub /mir_perception/scene_segmentation/event_in std_msgs/String e_start
    rostopic pub /mir_perception/scene_segmentation/event_in std_msgs/String e_add_cloud_start
    rostopic pub /mir_perception/scene_segmentation/event_in std_msgs/String e_add_cloud_stop

    # accumulate point cloud from the 2nd view point
    rostopic pub /mir_perception/scene_segmentation/event_in std_msgs/String e_add_cloud_start
    rostopic pub /mir_perception/scene_segmentation/event_in std_msgs/String e_add_cloud_stop

    # segment accumulated cloud and stop segmentation
    rostopic pub /mir_perception/scene_segmentation/event_in std_msgs/String e_segment
    rostopic pub /mir_perception/scene_segmentation/event_in std_msgs/String e_stop


.. hint:: Published msgs from mir_object_segmentation

  * Object list
    
    .. code-block:: bash

      /mir_perception/scene_segmentation/output/object_list

  * Bounding Boxes (for visualization in Rviz)

    .. code-block:: bash

      /mir_perception/scene_segmentation/output/bounding_boxes
    
  * Object labels (for visualization in Rviz)

    .. code-block:: bash
      
      /mir_perception/scene_segmentation/output/labels

  * Debug pointcloud (shows filtered input to plane segmentation)

    .. code-block:: bash

      /mir_perception/scene_segmentation/output/debug_cloud
      
  * Object clusters: segmented point clouds

    .. code-block:: bash

      /mir_perception/scene_segmentation/output/tabletop_clusters

  * Workspace height:

    .. code-block:: bash
      
      /mir_perception/scene_segmentation/output/workspace_height


*mir_object_recognition* package
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

`mir_object_recognition` uses the same `scene_segmentation` method 
as in `mir_object_segmentation`, but it does not accumulate point clouds. It only 
takes one view and then segment table top objects.

**Usage**

* Segment objects

  .. code-block:: bash

    rostopic pub /mir_perception/multimodal_object_recognition/event_in std_msgs/String e_start

**Published messages**

  .. code-block:: bash

    /mcr_perception/object_detector/object_list
    /mir_perception/multimodal_object_recognition/output/bounding_boxes
    /mir_perception/multimodal_object_recognition/output/debug_cloud_plane
    /mir_perception/multimodal_object_recognition/output/pc_labels
    /mir_perception/multimodal_object_recognition/output/pc_object_pose_array
    /mir_perception/multimodal_object_recognition/output/rgb_labels
    /mir_perception/multimodal_object_recognition/output/rgb_object_pose_array
    /mir_perception/multimodal_object_recognition/output/tabletop_cluster_pc
    /mir_perception/multimodal_object_recognition/output/tabletop_cluster_rgb
    /mir_perception/multimodal_object_recognition/output/workspace_height