Skip to content

Commit

Permalink
refactor(autoware_multi_object_tracker): merge normal_vehicle_tracker…
Browse files Browse the repository at this point in the history
… and big_vehicle_tracker (autowarefoundation#9613)

* refactor: define object_model_ at initialization

* refactor: combine normal and big vehicle tracker
  • Loading branch information
technolojin authored Dec 12, 2024
1 parent 3cfb03e commit e30350c
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 479 deletions.
3 changes: 1 addition & 2 deletions perception/autoware_multi_object_tracker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ set(${PROJECT_NAME}_lib
lib/tracker/motion_model/ctrv_motion_model.cpp
lib/tracker/motion_model/cv_motion_model.cpp
lib/tracker/model/tracker_base.cpp
lib/tracker/model/big_vehicle_tracker.cpp
lib/tracker/model/normal_vehicle_tracker.cpp
lib/tracker/model/vehicle_tracker.cpp
lib/tracker/model/multiple_vehicle_tracker.cpp
lib/tracker/model/bicycle_tracker.cpp
lib/tracker/model/pedestrian_tracker.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
#define AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__MULTIPLE_VEHICLE_TRACKER_HPP_

#include "autoware/kalman_filter/kalman_filter.hpp"
#include "autoware/multi_object_tracker/tracker/model/big_vehicle_tracker.hpp"
#include "autoware/multi_object_tracker/tracker/model/normal_vehicle_tracker.hpp"
#include "autoware/multi_object_tracker/tracker/model/tracker_base.hpp"
#include "autoware/multi_object_tracker/tracker/model/vehicle_tracker.hpp"

#include <rclcpp/time.hpp>

Expand All @@ -32,8 +31,8 @@ namespace autoware::multi_object_tracker
class MultipleVehicleTracker : public Tracker
{
private:
NormalVehicleTracker normal_vehicle_tracker_;
BigVehicleTracker big_vehicle_tracker_;
VehicleTracker normal_vehicle_tracker_;
VehicleTracker big_vehicle_tracker_;

public:
MultipleVehicleTracker(
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Author: v1.0 Yukihiro Saito
//

#ifndef AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__BIG_VEHICLE_TRACKER_HPP_
#define AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__BIG_VEHICLE_TRACKER_HPP_
#ifndef AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__VEHICLE_TRACKER_HPP_
#define AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__VEHICLE_TRACKER_HPP_

#include "autoware/kalman_filter/kalman_filter.hpp"
#include "autoware/multi_object_tracker/object_model/object_model.hpp"
Expand All @@ -27,16 +27,15 @@
namespace autoware::multi_object_tracker
{

class BigVehicleTracker : public Tracker
class VehicleTracker : public Tracker
{
private:
autoware_perception_msgs::msg::DetectedObject object_;
object_model::ObjectModel object_model_;
rclcpp::Logger logger_;

object_model::ObjectModel object_model_ = object_model::big_vehicle;

double velocity_deviation_threshold_;

autoware_perception_msgs::msg::DetectedObject object_;
double z_;

struct BoundingBox
Expand All @@ -52,8 +51,9 @@ class BigVehicleTracker : public Tracker
using IDX = BicycleMotionModel::IDX;

public:
BigVehicleTracker(
const rclcpp::Time & time, const autoware_perception_msgs::msg::DetectedObject & object,
VehicleTracker(
const object_model::ObjectModel & object_model, const rclcpp::Time & time,
const autoware_perception_msgs::msg::DetectedObject & object,
const geometry_msgs::msg::Transform & self_transform, const size_t channel_size,
const uint & channel_index);

Expand All @@ -75,4 +75,4 @@ class BigVehicleTracker : public Tracker

} // namespace autoware::multi_object_tracker

#endif // AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__BIG_VEHICLE_TRACKER_HPP_
#endif // AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__VEHICLE_TRACKER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@
#define AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__TRACKER_HPP_

#include "model/bicycle_tracker.hpp"
#include "model/big_vehicle_tracker.hpp"
#include "model/multiple_vehicle_tracker.hpp"
#include "model/normal_vehicle_tracker.hpp"
#include "model/pass_through_tracker.hpp"
#include "model/pedestrian_and_bicycle_tracker.hpp"
#include "model/pedestrian_tracker.hpp"
#include "model/tracker_base.hpp"
#include "model/unknown_tracker.hpp"
#include "model/vehicle_tracker.hpp"

#endif // AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__TRACKER_HPP_
Loading

0 comments on commit e30350c

Please sign in to comment.