Skip to content

Commit

Permalink
init downsampling
Browse files Browse the repository at this point in the history
Signed-off-by: ismetatabay <[email protected]>
  • Loading branch information
ismetatabay committed Oct 5, 2023
1 parent fd18cc3 commit b9d84ba
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ nav:
- index.md
- Open-source SLAM algorithms: open-source-slam
- Converting UTM map to MGRS map: convert-utm-to-mgrs-map
- Pointcloud map downsampling: pointcloud-map-downsampling
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,44 @@ longitude and altitude values in the navsatfix message from your GNSS/INS sensor

After that, you need to convert latitude and longitude values to northing and easting values.
You can use any converter on the internet for converting latitude longitude values to UTM.
(i.e., [UTM converter](https://www.latlong.net/lat-long-utm.html))
(i.e., [UTMconverter](https://www.latlong.net/lat-long-utm.html))

Now, we are ready to update `pc_utm_to_mgrs_converter.param.yaml`,
example for our navsatfix message:

```diff
/**:
ros__parameters:
# Northing of local origin
- Northing: 4520550.0
+ Northing: 4542871.33

# Easting of local origin
- Easting: 698891.0
+ Easting: 658659.84

# Elipsoid Height of local origin
- ElipsoidHeight: 47.62
+ ElipsoidHeight: 74.28
```

Lastly, we will update input and pointcloud the map path in `pc_utm_to_mgrs_converter.launch.xml`:

```diff
...
- <arg name="input_file_path" default="/home/melike/projects/autoware_data/gebze_pospac_map/pointcloud_map.pcd"/>
+ <arg name="input_file_path" default="<PATH-TO-YOUR-INPUT-PCD-MAP>"/>
- <arg name="output_file_path" default="/home/melike/projects/autoware_data/gebze_pospac_map/pointcloud_map_mgrs_orto.pcd"/>
+ <arg name="output_file_path" default="<PATH-TO-YOUR-OUTPUT-PCD-MAP>"/>
...
```

After the setting of the package, we will launch pc_utm_to_mgrs_converter:

```bash
ros2 launch pc_utm_to_mgrs_converter pc_utm_to_mgrs_converter.launch.xml
```

The conversion process will be started,
you should see `Saved <YOUR-MAP-POINTS-SIZE> data points saved to <YOUR-OUTPUT-MAP-PATH>` message on your terminal.
So, MGRS format pointcloud map saved on your output map directory.
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ Here is the video for demonstration of LIO-SAM mapping in our campus environment

![type:video](https://youtube.com/embed/0EX9U95oecw)

The output map format is local UTM,
we will change local UTM map to MGRS format for tutorial_vehicle.
Also, if you want change UTM to MGRS for autoware,
please follow [convert-utm-to-mgrs-map](../../convert-utm-to-mgrs-map) page.

## Example Result

<figure markdown>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nav:
- index.md
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Pointcloud map downsampling

## Overview

In some cases, for example,
when your created point cloud map is either too dense or too large (i.e., exceeding 300 MB),
you may want to downsample it for improved computational and memory efficiency.
Also, you can consider using dynamic map loading with partial loading,
please check [map_loader package](https://github.com/autowarefoundation/autoware.universe/tree/main/map/map_loader) for more information.

At tutorial_vehicle implementation we will use the whole map,
so we will downsample it with using [CloudCompare](https://www.cloudcompare.org/main.html).

## Installing CloudCompare

You can install it by snap:

```bash
sudo snap install cloudcompare
```

Please check the [official page](https://www.cloudcompare.org/release/index.html#CloudCompare)
for installing options.

## Downsampling a pointcloud map

There are three [subsampling methods on CloudCompare](https://www.cloudcompare.org/doc/wiki/index.php/Edit%5CSubsample),
we are using `Space` method for subsampling, but you can use other methods if you want.

1. Please open CloudCompare and drag your pointcloud to here, then you can select your pointcloud map by just clicking on the map at the DB tree panel.
2. Then you can click `subsample` button on the top panel.

<figure markdown>
![db-tree-panel](images/select-map.png){ align=center }
<figcaption>
CloudCompare
</figcaption>
</figure>

0 comments on commit b9d84ba

Please sign in to comment.