Skip to content

Commit

Permalink
chore(simple_object_merger): update README (autowarefoundation#6146)
Browse files Browse the repository at this point in the history
* chore(simple_object_merger): update README

Signed-off-by: scepter914 <scepter914@gmail.com>

* style(pre-commit): autofix

* update README

Signed-off-by: scepter914 <scepter914@gmail.com>

* style(pre-commit): autofix

* update README

Signed-off-by: scepter914 <scepter914@gmail.com>

---------

Signed-off-by: scepter914 <scepter914@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and karishma1911 committed Jun 3, 2024
1 parent f50ead0 commit b27d431
Showing 1 changed file with 52 additions and 34 deletions.
86 changes: 52 additions & 34 deletions perception/simple_object_merger/README.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,78 @@
# simple_object_merger

This package can merge multiple topics of [autoware_auto_perception_msgs/msg/DetectedObject](https://gitlab.com/autowarefoundation/autoware.auto/autoware_auto_msgs/-/blob/master/autoware_auto_perception_msgs/msg/DetectedObject.idl) without data association algorithm.
This package can merge multiple topics of [autoware_auto_perception_msgs/msg/DetectedObject](https://gitlab.com/autowarefoundation/autoware.auto/autoware_auto_msgs/-/blob/master/autoware_auto_perception_msgs/msg/DetectedObject.idl) without low calculation cost.

## Algorithm

### Background

This package can merge multiple DetectedObjects without matching processing.
[Object_merger](https://github.com/autowarefoundation/autoware.universe/tree/main/perception/object_merger) solve data association algorithm like Hungarian algorithm for matching problem, but it needs computational cost.
In addition, for now, [object_merger](https://github.com/autowarefoundation/autoware.universe/tree/main/perception/object_merger) can handle only 2 DetectedObjects topics and cannot handle more than 2 topics in one node.
To merge 6 DetectedObjects topics, 6 [object_merger](https://github.com/autowarefoundation/autoware.universe/tree/main/perception/object_merger) nodes need to stand.
[Object_merger](https://github.com/autowarefoundation/autoware.universe/tree/main/perception/object_merger) is mainly used for merge process with DetectedObjects. There are 2 characteristics in `Object_merger`. First, `object_merger` solve data association algorithm like Hungarian algorithm for matching problem, but it needs computational cost. Second, `object_merger` can handle only 2 DetectedObjects topics and cannot handle more than 2 topics in one node. To merge 6 DetectedObjects topics, 6 `object_merger` nodes need to stand for now.

So this package aim to merge DetectedObjects simply.
This package do not use data association algorithm to reduce the computational cost, and it can handle more than 2 topics in one node to prevent launching a large number of nodes.
So `simple_object_merger` aim to merge multiple DetectedObjects with low calculation cost.
The package do not use data association algorithm to reduce the computational cost, and it can handle more than 2 topics in one node to prevent launching a large number of nodes.

### Use case

Use case is as below.

- Multiple radar detection

`Simple_object_merger` can be used for multiple radar detection. By combining them into one topic from multiple radar topics with `simple_object_merger`, the pipeline for faraway detection with radar is simpler.

### Limitation

- Sensor data drops and delay

Merged objects will not be published until all topic data is received when initializing.
In addition, to care sensor data drops and delayed, this package has a parameter to judge timeout.
When the latest time of the data of a topic is older than the timeout parameter, it is not merged for output objects.
For now specification of this package, if all topic data is received at first and after that the data drops, and the merged objects are published without objects which is judged as timeout.
The timeout parameter should be determined by sensor cycle time.
Merged objects will not be published until all topic data is received when initializing. In addition, to care sensor data drops and delayed, this package has a parameter to judge timeout. When the latest time of the data of a topic is older than the timeout parameter, it is not merged for output objects. For now specification of this package, if all topic data is received at first and after that the data drops, and the merged objects are published without objects which is judged as timeout.The timeout parameter should be determined by sensor cycle time.

- Post-processing

Because this package does not have matching processing, so it can be used only when post-processing is used.
For now, [clustering processing](https://github.com/autowarefoundation/autoware.universe/tree/main/perception/radar_object_clustering) can be used as post-processing.
Because this package does not have matching processing, there are overlapping objects depending on the input objects. So output objects can be used only when post-processing is used. For now, [clustering processing](https://github.com/autowarefoundation/autoware.universe/tree/main/perception/radar_object_clustering) can be used as post-processing.

### Use case
## Interface

Use case is as below.
### Input

- Multiple radar detection
Input topics is defined by the parameter of `input_topics` (List[string]). The type of input topics is `std::vector<autoware_auto_perception_msgs/msg/DetectedObjects.msg>`.

### Output

- `~/output/objects` (`autoware_auto_perception_msgs/msg/DetectedObjects.msg`)
- Merged objects combined from input topics.

### Parameters

- `update_rate_hz` (double) [hz]
- Default parameter: 20.0

This parameter is update rate for the `onTimer` function.
This parameter should be same as the frame rate of input topics.

This package can be used for multiple radar detection.
Since [clustering processing](https://github.com/autowarefoundation/autoware.universe/tree/main/perception/radar_object_clustering) will be included later process in radar faraway detection, this package can be used.
- `new_frame_id` (string)
- Default parameter: "base_link"

## Input
This parameter is the header frame_id of the output topic.
If output topics use for perception module, it should be set for "base_link"

| Name | Type | Description |
| ---- | ------------------------------------------------------------------ | ------------------------------------------------------ |
| | std::vector<autoware_auto_perception_msgs/msg/DetectedObjects.msg> | 3D detected objects. Topic names are set by parameters |
- `timeout_threshold` (double) [s]
- Default parameter: 0.1

## Output
This parameter is the threshold for timeout judgement.
If the time difference between the first topic of `input_topics` and an input topic is exceeded to this parameter, then the objects of topic is not merged to output objects.

| Name | Type | Description |
| ------------------ | ----------------------------------------------------- | -------------- |
| `~/output/objects` | autoware_auto_perception_msgs/msg/DetectedObjects.msg | Merged objects |
```cpp
for (size_t i = 0; i < input_topic_size; i++) {
double time_diff = rclcpp::Time(objects_data_.at(i)->header.stamp).seconds() -
rclcpp::Time(objects_data_.at(0)->header.stamp).seconds();
if (std::abs(time_diff) < node_param_.timeout_threshold) {
// merge objects
}
}
```
## Parameters
- `input_topics` (List[string])
- Default parameter: "[]"
| Name | Type | Description | Default value |
| :------------------ | :----------- | :----------------------------------- | :------------ |
| `update_rate_hz` | double | Update rate. [hz] | 20.0 |
| `new_frame_id` | string | The header frame_id of output topic. | "base_link" |
| `timeout_threshold` | double | Threshold for timeout judgement [s]. | 1.0 |
| `input_topics` | List[string] | Input topics name. | "[]" |
This parameter is the name of input topics.
For example, when this packages use for radar objects, `"[/sensing/radar/front_center/detected_objects, /sensing/radar/front_left/detected_objects, /sensing/radar/rear_left/detected_objects, /sensing/radar/rear_center/detected_objects, /sensing/radar/rear_right/detected_objects, /sensing/radar/front_right/detected_objects]"` can be set.
For now, the time difference is calculated by the header time between the first topic of `input_topics` and the input topics, so the most important objects to detect should be set in the first of `input_topics` list.

0 comments on commit b27d431

Please sign in to comment.