@@ -27,210 +27,3 @@ terrain can be efficiently generated.
2727}
2828```
2929
30-
31- ## Usage
32-
33- ### Build
34-
35- ``` bash
36- catkin build elevation_mapping_cupy
37- catkin build convex_plane_decomposition_ros
38- ```
39-
40- #### Errors
41-
42- If you get error such as
43-
44- ```
45- Make Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
46- Could NOT find PythonInterp: Found unsuitable version "2.7.18", but
47- required is at least "3" (found /usr/bin/python)
48- ```
49-
50- Build with option.
51-
52- ``` bash
53- catkin build elevation_mapping_cupy -DPYTHON_EXECUTABLE=$( which python3)
54- ```
55-
56- ### Run
57-
58- Basic usage.
59-
60- ``` bash
61- roslaunch elevation_mapping_cupy elevation_mapping_cupy.launch
62- ```
63-
64- For the plane segmentation node
65-
66- ``` bash
67- roslaunch convex_plane_decomposition_ros convex_plane_decomposition.launch
68- ```
69-
70- #### Errors
71- If you build with the install flag under ros melodic, you might get issues with the modules not found:
72-
73- ``` bash
74- terminate called after throwing an instance of ' pybind11::error_already_set'
75- what (): ModuleNotFoundError: No module named ' elevation_mapping_cupy'
76- ```
77- This is because python3 modules are installed into a different location.
78-
79- This can be fixed by including also the python3 modules location in the ` PYTHONPATH ` by adding following line into the launch file:
80-
81- ``` xml
82- <env name =" PYTHONPATH" value =" <path_to_your_install>/lib/python3/dist-packages:$(env PYTHONPATH)" />
83- ```
84-
85- ### Run TurtleBot example
86-
87- First, install turtlebot simulation.
88-
89- ``` bash
90- sudo apt install ros-noetic-turtlebot3-gazebo ros-noetic-turtlebot3-teleop
91- ```
92-
93- Then, you can run the examples. For the basic version:
94-
95- ``` bash
96- export TURTLEBOT3_MODEL=waffle
97- roslaunch elevation_mapping_cupy turtlesim_example.launch
98- ```
99-
100- Or, for the version including plane segmentation:
101-
102- ``` bash
103- catkin build convex_plane_decomposition_ros
104- export TURTLEBOT3_MODEL=waffle
105- roslaunch elevation_mapping_cupy turtlesim_segmentation_example.launch
106- ```
107-
108- To control the robot with a keyboard, a new terminal window needs to be opened.
109- Then run
110-
111- ``` bash
112- export TURTLEBOT3_MODEL=waffle
113- roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch
114- ```
115-
116- Velocity inputs can be sent to the robot by pressing the keys ` a ` , ` w ` , ` d ` , ` x ` . To stop the robot completely, press ` s ` .
117-
118- ### Subscribed Topics
119-
120- * topics specified in ** ` pointcloud_topics ` ** in ** ` elevation_mapping_cupy/config/parameters.yaml ` ** ([ sensor_msgs/PointCloud2] )
121-
122- The distance measurements.
123-
124- * ** ` /tf ` ** ([ tf/tfMessage] )
125-
126- The transformation tree.
127-
128- * The plane segmentation node subscribes to an elevation map topic ([ grid_map_msg/GridMap] ). This can be configured in
129- ** ` convex_plane_decomposition_ros/config/parameters.yaml ` **
130-
131- ### Published Topics
132-
133- For elevation_mapping_cupy, topics are published as set in the rosparam.
134- You can specify which layers to publish in which fps.
135-
136- Under ` publishers ` , you can specify the ` topic_name ` , ` layers ` ` basic_layers ` and ` fps ` .
137-
138- ``` yaml
139- publishers :
140- your_topic_name :
141- layers : [ 'list_of_layer_names', 'layer1', 'layer2' ] # Choose from 'elevation', 'variance', 'traversability', 'time' + plugin layers
142- basic_layers : [ 'list of basic layers', 'layer1' ] # basic_layers for valid cell computation (e.g. Rviz): Choose a subset of `layers`.
143- fps : 5.0 # Publish rate. Use smaller value than `map_acquire_fps`.
144- ` ` `
145-
146- Example setting in ` config/parameters.yaml`.
147-
148- * **`elevation_map_raw`** ([grid_map_msg/GridMap])
149-
150- The entire elevation map.
151-
152- * **`elevation_map_recordable`** ([grid_map_msg/GridMap])
153-
154- The entire elevation map with slower update rate for visualization and logging.
155-
156- * **`elevation_map_filter`** ([grid_map_msg/GridMap])
157-
158- The filtered maps using plugins.
159-
160- The plane segmentation node publishes the following :
161-
162- * **`planar_terrain`** ([convex_plane_decomposition_msgs/PlanarTerrain])
163-
164- A custom message that contains the full segmentation as a map together with the boundary information.
165-
166- * **`filtered_map`** ([grid_map_msg/GridMap])
167-
168- A grid map message to visualize the segmentation and some intermediate results. This information is also part of **`planar_terrain`**.
169-
170- * **`boundaries`** ([visualization_msgs/MarkerArray])
171-
172- A set of polygons that trace the boundaries of the segmented region. Holes and boundaries of a single region are published as separate
173- markers with the same color.
174-
175- * **`insets`** ([visualization_msgs/PolygonArray])
176-
177- A set of polygons that are at a slight inward offset from **`boundaries`**. There might be more insets than boundaries since the inward
178- shift can cause a single region to break down into multiple when narrow passages exist.
179-
180- # Plugins
181-
182- You can create your own plugin to process the elevation map and publish as a layer in GridMap message.
183-
184- Let's look at the example.
185-
186- First, create your plugin file in `elevation_mapping_cupy/script/plugins/` and save as `example.py`.
187-
188- ` ` ` python
189- import cupy as cp
190- from typing import List
191- from .plugin_manager import PluginBase
192-
193-
194- class NameOfYourPlugin(PluginBase):
195- def __init__(self, add_value:float=1.0, **kwargs):
196- super().__init__()
197- self.add_value = float(add_value)
198-
199- def __call__(self, elevation_map: cp.ndarray, layer_names: List[str],
200- plugin_layers: cp.ndarray, plugin_layer_names: List[str])->cp.ndarray:
201- # Process maps here
202- # You can also use the other plugin's data through plugin_layers.
203- new_elevation = elevation_map[0] + self.add_value
204- return new_elevation
205- ` ` `
206-
207- Then, add your plugin setting to `config/plugin_config.yaml`
208-
209- ` ` ` yaml
210- example: # Name of your filter
211- type: "example" # Specify the name of your plugin (the name of your file name).
212- enable: True # weather to load this plugin
213- fill_nan: True # Fill nans to invalid cells of elevation layer.
214- is_height_layer: True # If this is a height layer (such as elevation) or not (such as traversability)
215- layer_name: "example_layer" # The layer name.
216- extra_params: # This params are passed to the plugin class on initialization.
217- add_value: 2.0 # Example param
218-
219- example_large: # You can apply same filter with different name.
220- type: "example" # Specify the name of your plugin (the name of your file name).
221- enable: True # weather to load this plugin
222- fill_nan: True # Fill nans to invalid cells of elevation layer.
223- is_height_layer: True # If this is a height layer (such as elevation) or not (such as traversability)
224- layer_name: "example_layer_large" # The layer name.
225- extra_params: # This params are passed to the plugin class on initialization.
226- add_value: 100.0 # Example param with larger value.
227- ` ` `
228-
229- Finally, add your layer name to publishers in `config/parameters.yaml`. You can create a new topic or add to existing topics.
230-
231- ` ` ` yaml
232- plugin_example: # Topic name
233- layers: [ 'elevation', 'example_layer', 'example_layer_large' ]
234- basic_layers: [ 'example_layer' ]
235- fps: 1.0 # The plugin is called with this fps.
236- ` ` `
0 commit comments