Skip to content

Commit

Permalink
Cleaning things
Browse files Browse the repository at this point in the history
Signed-off-by: Anh Nguyen <[email protected]>
  • Loading branch information
anhnv3991 committed Feb 24, 2025
1 parent 5ae7f78 commit 42f1ec4
Show file tree
Hide file tree
Showing 11 changed files with 453 additions and 453 deletions.
48 changes: 0 additions & 48 deletions map/autoware_tp_collector/README.md

This file was deleted.

48 changes: 0 additions & 48 deletions map/autoware_tp_collector/schema/pointcloud_merger.schema.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ project(autoware_tp_manager)
find_package(autoware_cmake REQUIRED)
autoware_package()

# Enable support for C++17
if (${CMAKE_VERSION} VERSION_LESS "3.1.0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
else ()
set(CMAKE_CXX_STANDARD 17)
endif ()

# Find packages
find_package(yaml-cpp REQUIRED)
find_package(PCL REQUIRED)
Expand Down
File renamed without changes.
78 changes: 78 additions & 0 deletions map/autoware_tp_manager/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# autoware_tp_manager

Here are some tools for collecting average TPs of PCD maps. Currently, we consider the decrease of TPs as a sign of map decay. However, we don't know what TPs are 'abnormal', e.g. in some areas the TPs range around 2.0 ~ 3.0, while in others TPs float around 5.0. This package provides some tools to check it, including:
- TP collector: collect the average TPs per segment of a PCD map
- TP checker: compare a rosbag's TPs with a map's TPs and highlight the map areas where the rosbag's TPs differ significantly from the map's TPs.

## Installation

```bash
cd <PATH_TO_pilot-auto.*> # OR <PATH_TO_autoware>
cd src/
git clone [email protected]:autowarefoundation/autoware_tools.git
cd ..
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --catkin-skip-building-tests --symlink-install --packages-up-to autoware_pointcloud_merger
```

## Usage

- Collect the average TPs per segment from a map by TP_collector

```bash
ros2 run autoware_tp_manager tp_collector.py <path_to_pcd_dir> <path_to_rosbag> <path_to_output_dir> [--resolution:=<resolution>] [--pose_topic:=<topic_of_poses>] [--tp_topic:=<topic_of_TPs>] [--scan_topic:=<topic_of_scans>]
```

| Name | Description |
| ----------------- | ------------------------------------------- |
| path_to_pcd_dir | Directory that contains the input PCD files |
| path_to_rosbag | Path to the input rosbag |
| path_to_output_dir| Path to the output directory |
| resolution | Resolution to segment the input PCD. The TPs are collected on these segments|
| topic_of_poses | Topic of poses messages in the input rosbag|
| topic_of_TPs | Topic of TPs in the input rosbag|
| topic_of_scans | Topic of downsampled scans in the input rosbag|

Paths to folders should be specified as **absolute paths**.

The rosbag should contain the following topics
- /localization/pose_twist_fusion_filter/pose_with_covariance_without_yawbias
- /localization/pose_estimator/transform_probability
- /localization/util/downsample/pointcloud

The average TPs can be visualized on Rviz2 by running the following command
```bash
python3 install/autoware_tp_manager/lib/autoware_tp_manager/tp_visualizer.py <path_to_output_dir>
```
| Name | Description |
| ----------------- | ------------------------------------------- |
| path_to_output_dir| Path to the output directory of TP_collector|

then open another terminal to launch Rviz2 and add the topic /autoware_tp_visualizer.

- Compare a rosbags' TPs with a map's TPs by TP_checker
```bash
ros2 run autoware_tp_manager tp_checker.py <path_to_score_dir> <path_to_rosbag> [--pose_topic:=<topic_of_poses>] [--tp_topic:=<topic_of_TPs>] [--scan_topic:=<topic_of_scans>]
```

| Name | Description |
| ----------------- | ------------------------------------------- |
| path_to_score_dir | Directory that contains the TP file (.csv) and the downsampled PCD map. This is the output directory of the tp_collector. |
| path_to_rosbag | Path to the input rosbag to be evaluated|
| topic_of_poses | Topic of poses in the evaluation rosbag |
| topic_of_TPs | Topic of TPs in the evaluation rosbag |
| topic_of_scans | Topic of scans in the evaluation rosbag |

The results of checking are published to the topic /autoware_tp_checker, and can also be displayed on Rviz2. The red points

- The rosbags used to both TP collector and TP checker is created by running Autoware's logging simulator and record the following three topics:
- /localization/pose_twist_fusion_filter/pose_with_covariance_without_yawbias
- /localization/pose_estimator/transform_probability
- /localization/util/downsample/pointcloud

## Parameter

{{ json_to_markdown("map/autoware_tp_manager/schema/tp_manager.schema.json") }}

## LICENSE

This package is under [Apache License 2.0](../../LICENSE)
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<buildtool_depend>tier4_debug_msgs</buildtool_depend>

<depend>libpcl-all-dev</depend>
<depend>tier4_debug_msgs</depend>
<depend>yaml-cpp</depend>
<depend>tier4_debug_msgs</depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down
107 changes: 107 additions & 0 deletions map/autoware_tp_manager/schema/tp_manager.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Parameters for autoware tp manager node",
"type": "object",
"definitions": {
"tp_collector": {
"type": "object",
"properties": {
"path_to_pcd_dir": {
"type": "string",
"description": "The path to the directory containing the input PCD files",
"default": ""
},
"path_to_rosbag": {
"type": "string",
"description": "The path to the input rosbag",
"default": ""
},
"path_to_output_dir": {
"type": "string",
"description": "The path to the output directory",
"default": ""
},
"resolution": {
"type": "number",
"description": "Resolution to segment the input PCD. The TPs are collected on these segments.",
"default": "5,0"
},
"pose_topic": {
"type": "string",
"description": "Topic of poses messages in the input rosbag",
"default": "/localization/pose_twist_fusion_filter/pose_with_covariance_without_yawbias"
},
"tp_topic": {
"type": "string",
"description": "Topic of TPs in the input rosbag",
"default": "/localization/pose_estimator/transform_probability"
},
"scan_topic": {
"type": "string",
"description": "Topic of downsampled scans in the input rosbag",
"default": "/localization/util/downsample/pointcloud"
}
},
"required": ["path_to_pcd_dir", "path_to_rosbag", "path_to_output_dir"],
"additionalProperties": false
},
"tp_checker": {
"type": "object",
"properties": {
"path_to_score_dir": {
"type": "string",
"description": "The path to the directory containing the average TP file (.csv) and the downsampled PCD map. This is also the output directory of the TP collector.",
"default": ""
},
"path_to_rosbag": {
"type": "string",
"description": "Path to the input rosbag to be evaluated",
"default": ""
},
"pose_topic": {
"type": "string",
"description": "Topic of poses messages in the input rosbag",
"default": "/localization/pose_twist_fusion_filter/pose_with_covariance_without_yawbias"
},
"tp_topic": {
"type": "string",
"description": "Topic of TPs in the input rosbag",
"default": "/localization/pose_estimator/transform_probability"
},
"scan_topic": {
"type": "string",
"description": "Topic of downsampled scans in the input rosbag",
"default": "/localization/util/downsample/pointcloud"
}
},
"required": ["path_to_score_dir", "path_to_rosbag"],
"additionalProperties": false
},
"tp_visualizer": {
"type": "object",
"properties": {
"path_to_output_dir": {
"type": "string",
"description": "Path to the output directory of TP_collector",
"default": ""
}
},
"required": ["path_to_output_dir"],
"additionalProperties": false
}
},
"properties": {
"/**": {
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/autoware_pointcloud_merger"
}
},
"required": ["ros__parameters"],
"additionalProperties": false
}
},
"required": ["/**"],
"additionalProperties": false
}
Loading

0 comments on commit 42f1ec4

Please sign in to comment.