Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(multi_object_tracker): multi object input #6820

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
5412a55
refactor: frequently used types, namespace
technolojin Apr 11, 2024
4176cec
test: multiple inputs
technolojin Apr 11, 2024
96be0cc
feat: check latest measurement time
technolojin Apr 11, 2024
fd086dc
feat: define input manager class
technolojin Apr 12, 2024
1462eef
feat: interval measures
technolojin Apr 12, 2024
7757212
feat: store and sort inputs PoC
technolojin Apr 12, 2024
2a443e7
chore: rename classes
technolojin Apr 12, 2024
866b656
feat: object collector
technolojin Apr 12, 2024
4b71b57
impl input manager, no subscribe
technolojin Apr 12, 2024
a9fa209
fix: subscribe and trigger callback
technolojin Apr 15, 2024
cf2874d
fix: subscriber and callbacks are working
technolojin Apr 15, 2024
246cb4a
fix: callback object is fixed, tracker is working
technolojin Apr 15, 2024
9ebaf6d
fix: get object time argument revise
technolojin Apr 15, 2024
c496a25
feat: back to periodic publish, analyze input latency and timings
technolojin Apr 15, 2024
969483c
fix: enable timing debugger
technolojin Apr 15, 2024
ceaacc3
fix: separate object interval function
technolojin Apr 15, 2024
c556460
feat: prepare message triggered process
technolojin Apr 15, 2024
4afab3f
feat: trigger tracker by main message arrive
technolojin Apr 16, 2024
23a9df4
chore: clean-up, set namespace
technolojin Apr 16, 2024
787d48b
feat: object lists with detector index
technolojin Apr 16, 2024
b4993c2
feat: define input channel struct
technolojin Apr 16, 2024
e495efb
fix: define type for object list
technolojin Apr 17, 2024
4955207
feat: add channel wise existence probability
technolojin Apr 17, 2024
46c16c7
fix: relocate debugger
technolojin Apr 18, 2024
99ad038
fix: total existence logic change
technolojin Apr 18, 2024
1a761f9
feat: publishing object debug info, need to fix marker id
technolojin Apr 18, 2024
15455cd
feat: indexing marker step 1
technolojin Apr 18, 2024
212752c
fix: uuid management
technolojin Apr 19, 2024
b6f59a9
feat: association line fix
technolojin Apr 19, 2024
104dac4
feat: print channel names
technolojin Apr 19, 2024
8d4408b
feat: association lines are color-coded
technolojin Apr 19, 2024
30aed23
fix: association debug marker bugfix
technolojin Apr 22, 2024
78014b9
style(pre-commit): autofix
pre-commit-ci[bot] Apr 22, 2024
d036f32
feat: add option for debug marker
technolojin Apr 22, 2024
8d6009d
feat: skip time statistics update in case of outlier
technolojin Apr 23, 2024
90d287c
feat: auto-tune latency band
technolojin Apr 24, 2024
ca91b5b
feat: pre-defined channels, select on launcher
technolojin Apr 26, 2024
5c62105
feat: add input channels
technolojin Apr 26, 2024
0d4b683
fix: remove marker idx map
technolojin Apr 26, 2024
9fbf563
fix: to do not miss the latest message of the target stream
technolojin Apr 26, 2024
736411d
fix: remove priority, separate timing optimization
technolojin Apr 26, 2024
5a0757e
fix: time interval bug fix
technolojin Apr 26, 2024
5437a9e
chore: refactoring timing state update
technolojin Apr 26, 2024
6d317e5
fix: set parameters optionally
technolojin May 7, 2024
adc8415
feat: revise object time range logic
technolojin May 7, 2024
ca5c4ac
fix: launcher to set input channels
technolojin May 8, 2024
b2ca6a1
fix: exempt spell check 'pointpainting'
technolojin May 10, 2024
df0cd9f
feat: remove expected interval
technolojin May 13, 2024
0c9c2d8
feat: implement spawn switch
technolojin May 13, 2024
2045957
fix: remove debug messages
technolojin May 13, 2024
eb09e03
chore: update readme
technolojin May 13, 2024
dab7cdc
fix: change tentative object topic
technolojin May 13, 2024
7a0553e
Revert "fix: remove debug messages"
technolojin May 13, 2024
094110f
fix: reset times when jumps to past
technolojin May 13, 2024
c1a85b8
fix: check if interval is negative
technolojin May 14, 2024
c12109a
fix: missing config, default value
technolojin May 14, 2024
c589c3a
fix: remove debug messages
technolojin May 14, 2024
48a8861
fix: change no-object message level
technolojin May 14, 2024
f873ab8
Update perception/multi_object_tracker/include/multi_object_tracker/d…
technolojin May 16, 2024
1ba2c79
chore: Update copyright to uppercase
technolojin May 16, 2024
9edd2e0
chore: fix readme links to config files
technolojin May 16, 2024
cf6cf3c
chore: move and rename uuid functions
technolojin May 17, 2024
d5efe10
chore: fix debug topic to use node name
technolojin May 17, 2024
4445c45
chore: express meaning of threshold
technolojin May 17, 2024
f218f84
feat: revise decay rate, update function
technolojin May 23, 2024
b623993
fix: define constants with explanation
technolojin May 23, 2024
13adc73
style(pre-commit): autofix
pre-commit-ci[bot] May 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<!--multi object tracking-->
<include file="$(find-pkg-share multi_object_tracker)/launch/multi_object_tracker.launch.xml">
<arg name="data_association_matrix_path" value="$(var object_recognition_tracking_multi_object_tracker_data_association_matrix_param_path)"/>
<arg name="input_channels_path" value="$(var object_recognition_tracking_multi_object_tracker_input_channels_param_path)"/>
<arg name="tracker_setting_path" value="$(var object_recognition_tracking_multi_object_tracker_node_param_path)"/>
</include>
</group>
Expand All @@ -26,6 +27,7 @@
<!--multi object tracking for near objects-->
<include file="$(find-pkg-share multi_object_tracker)/launch/multi_object_tracker.launch.xml">
<arg name="data_association_matrix_path" value="$(var object_recognition_tracking_multi_object_tracker_data_association_matrix_param_path)"/>
<arg name="input_channels_path" value="$(var object_recognition_tracking_multi_object_tracker_input_channels_param_path)"/>
<arg name="tracker_setting_path" value="$(var object_recognition_tracking_multi_object_tracker_node_param_path)"/>
<arg name="output" value="/perception/object_recognition/tracking/near_objects"/>
</include>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<arg name="object_recognition_detection_object_range_splitter_radar_param_path"/>
<arg name="object_recognition_detection_object_range_splitter_radar_fusion_param_path"/>
<arg name="object_recognition_tracking_multi_object_tracker_data_association_matrix_param_path"/>
<arg name="object_recognition_tracking_multi_object_tracker_input_channels_param_path"/>
<arg name="object_recognition_tracking_multi_object_tracker_node_param_path"/>
<arg name="object_recognition_tracking_radar_object_tracker_data_association_matrix_param_path"/>
<arg name="object_recognition_tracking_radar_object_tracker_tracking_setting_param_path"/>
Expand Down
4 changes: 3 additions & 1 deletion perception/multi_object_tracker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ include_directories(
# Generate exe file
set(MULTI_OBJECT_TRACKER_SRC
src/multi_object_tracker_core.cpp
src/debugger.cpp
src/debugger/debugger.cpp
src/debugger/debug_object.cpp
src/processor/processor.cpp
src/processor/input_manager.cpp
src/data_association/data_association.cpp
src/data_association/mu_successive_shortest_path/mu_successive_shortest_path_wrapper.cpp
src/tracker/motion_model/motion_model_base.cpp
Expand Down
45 changes: 24 additions & 21 deletions perception/multi_object_tracker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,31 +46,38 @@ Example:

### Input

| Name | Type | Description |
| --------- | ----------------------------------------------------- | ----------- |
| `~/input` | `autoware_auto_perception_msgs::msg::DetectedObjects` | obstacles |
Multiple inputs are pre-defined in the input channel parameters (described below) and the inputs can be configured

| Name | Type | Description |
| ------------------------- | -------------------------- | ---------------------- |
| `selected_input_channels` | `std::vector<std::string>` | array of channel names |

- default value: `selected_input_channels:="['detected_objects']"`, merged DetectedObject message
- multi-input example: `selected_input_channels:="['lidar_centerpoint','camera_lidar_fusion','detection_by_tracker','radar_far']"`

### Output

| Name | Type | Description |
| ---------- | ---------------------------------------------------- | ------------------ |
| `~/output` | `autoware_auto_perception_msgs::msg::TrackedObjects` | modified obstacles |
| Name | Type | Description |
| ---------- | ---------------------------------------------------- | --------------- |
| `~/output` | `autoware_auto_perception_msgs::msg::TrackedObjects` | tracked objects |

## Parameters

<!-- Write parameters of this package.
### Input Channel parameters

Example:
### Node Parameters
Available input channels are defined in [input_channels.param.yaml](config/input_channels.param.yaml).

| Name | Type | Description |
| ---------------------- | ---- | ------------------------------- |
| `output_debug_markers` | bool | whether to output debug markers |
-->
| Name | Type | Description |
| --------------------------------- | ----------------------------------------------------- | ------------------------------------- |
| `<channel>` | | the name of channel |
| `<channel>.topic` | `autoware_auto_perception_msgs::msg::DetectedObjects` | detected objects |
| `<channel>.can_spawn_new_tracker` | `bool` | a switch allow to spawn a new tracker |
| `<channel>.optional.name` | `std::string` | channel name for analysis |
| `<channel>.optional.short_name` | `std::string` | short name for visualization |

### Core Parameters

Node parameters are defined in [multi_object_tracker.param.yaml](config/multi_object_tracker.param.yaml) and association parameters are defined in [data_association.param.yaml](config/data_association.param.yaml).
Node parameters are defined in [multi_object_tracker_node.param.yaml](config/multi_object_tracker_node.param.yaml) and association parameters are defined in [data_association_matrix.param.yaml](config/data_association_matrix.param.yaml).

#### Node parameters

Expand All @@ -80,6 +87,9 @@ Node parameters are defined in [multi_object_tracker.param.yaml](config/multi_ob
| `world_frame_id` | double | object kinematics definition frame |
| `enable_delay_compensation` | bool | if True, tracker use timers to schedule publishers and use prediction step to extrapolate object state at desired timestamp |
| `publish_rate` | double | Timer frequency to output with delay compensation |
| `publish_processing_time` | bool | enable to publish debug message of process time information |
| `publish_tentative_objects` | bool | enable to publish tentative tracked objects, which have lower confidence |
| `publish_debug_markers` | bool | enable to publish debug markers, which indicates association of multi-inputs, existence probability of each detection |

#### Association parameters

Expand All @@ -93,13 +103,6 @@ Node parameters are defined in [multi_object_tracker.param.yaml](config/multi_ob

## Assumptions / Known limits

<!-- Write assumptions and limitations of your implementation.

Example:
This algorithm assumes obstacles are not moving, so if they rapidly move after the vehicle started to avoid them, it might collide with them.
Also, this algorithm doesn't care about blind spots. In general, since too close obstacles aren't visible due to the sensing performance limit, please take enough margin to obstacles.
-->

See the [model explanations](models.md).

## (Optional) Error detection and handling
Expand Down
82 changes: 82 additions & 0 deletions perception/multi_object_tracker/config/input_channels.param.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/**:
ros__parameters:
input_channels:
detected_objects:
topic: "/perception/object_recognition/detection/objects"
can_spawn_new_tracker: true
optional:
name: "detected_objects"
short_name: "all"
# LIDAR - rule-based
lidar_clustering:
topic: "/perception/object_recognition/detection/clustering/objects"
can_spawn_new_tracker: true
optional:
name: "clustering"
short_name: "Lcl"
# LIDAR - DNN
lidar_centerpoint:
topic: "/perception/object_recognition/detection/centerpoint/objects"
can_spawn_new_tracker: true
optional:
name: "centerpoint"
short_name: "Lcp"
lidar_centerpoint_validated:
topic: "/perception/object_recognition/detection/centerpoint/validation/objects"
can_spawn_new_tracker: true
optional:
name: "centerpoint"
short_name: "Lcp"
lidar_apollo:
topic: "/perception/object_recognition/detection/apollo/objects"
can_spawn_new_tracker: true
optional:
name: "apollo"
short_name: "Lap"
lidar_apollo_validated:
topic: "/perception/object_recognition/detection/apollo/validation/objects"
can_spawn_new_tracker: true
optional:
name: "apollo"
short_name: "Lap"
# LIDAR-CAMERA - DNN
# cspell:ignore lidar_pointpainitng pointpainting
lidar_pointpainitng:
topic: "/perception/object_recognition/detection/pointpainting/objects"
can_spawn_new_tracker: true
optional:
name: "pointpainting"
short_name: "Lpp"
lidar_pointpainting_validated:
topic: "/perception/object_recognition/detection/pointpainting/validation/objects"
can_spawn_new_tracker: true
optional:
name: "pointpainting"
short_name: "Lpp"
# CAMERA-LIDAR
camera_lidar_fusion:
topic: "/perception/object_recognition/detection/clustering/camera_lidar_fusion/objects"
can_spawn_new_tracker: true
optional:
name: "camera_lidar_fusion"
short_name: "CLf"
# CAMERA-LIDAR+TRACKER
detection_by_tracker:
topic: "/perception/object_recognition/detection/detection_by_tracker/objects"
can_spawn_new_tracker: false
optional:
name: "detection_by_tracker"
short_name: "dbT"
# RADAR
radar:
topic: "/sensing/radar/detected_objects"
can_spawn_new_tracker: true
optional:
name: "radar"
short_name: "R"
radar_far:
topic: "/perception/object_recognition/detection/radar/far_objects"
can_spawn_new_tracker: true
optional:
name: "radar_far"
short_name: "Rf"
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
# debug parameters
publish_processing_time: false
publish_tentative_objects: false
publish_debug_markers: false
diagnostics_warn_delay: 0.5 # [sec]
diagnostics_error_delay: 1.0 # [sec]
technolojin marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
// Copyright 2024 TIER IV, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef MULTI_OBJECT_TRACKER__DEBUGGER__DEBUG_OBJECT_HPP_
#define MULTI_OBJECT_TRACKER__DEBUGGER__DEBUG_OBJECT_HPP_

#include "multi_object_tracker/tracker/model/tracker_base.hpp"

#include <rclcpp/rclcpp.hpp>
#include <tier4_autoware_utils/ros/uuid_helper.hpp>

#include "unique_identifier_msgs/msg/uuid.hpp"
#include <autoware_auto_perception_msgs/msg/detected_objects.hpp>
#include <autoware_auto_perception_msgs/msg/tracked_objects.hpp>
#include <geometry_msgs/msg/point.hpp>
#include <visualization_msgs/msg/marker_array.hpp>

#include <boost/functional/hash.hpp>
#include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_generators.hpp>

#include <list>
#include <memory>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

struct ObjectData
{
rclcpp::Time time;

// object uuid
boost::uuids::uuid uuid;
int uuid_int;
std::string uuid_str;

// association link, pair of coordinates
// tracker to detection
geometry_msgs::msg::Point tracker_point;
geometry_msgs::msg::Point detection_point;
bool is_associated{false};

// existence probabilities
std::vector<float> existence_vector;

// detection channel id
uint channel_id;
};

class TrackerObjectDebugger
{
public:
explicit TrackerObjectDebugger(std::string frame_id);

private:
bool is_initialized_{false};
std::string frame_id_;
visualization_msgs::msg::MarkerArray markers_;
std::unordered_set<int> current_ids_;
std::unordered_set<int> previous_ids_;
rclcpp::Time message_time_;

std::vector<ObjectData> object_data_list_;
std::list<int32_t> unused_marker_ids_;
int32_t marker_id_ = 0;
std::vector<std::vector<ObjectData>> object_data_groups_;

std::vector<std::string> channel_names_;

public:
void setChannelNames(const std::vector<std::string> & channel_names)
{
channel_names_ = channel_names;
}
void collect(
const rclcpp::Time & message_time, const std::list<std::shared_ptr<Tracker>> & list_tracker,
const uint & channel_index,
const autoware_auto_perception_msgs::msg::DetectedObjects & detected_objects,
const std::unordered_map<int, int> & direct_assignment,
const std::unordered_map<int, int> & reverse_assignment);

void reset();
void draw(
const std::vector<std::vector<ObjectData>> object_data_groups,
visualization_msgs::msg::MarkerArray & marker_array) const;
void process();
void getMessage(visualization_msgs::msg::MarkerArray & marker_array) const;
};

#endif // MULTI_OBJECT_TRACKER__DEBUGGER__DEBUG_OBJECT_HPP_
Loading
Loading