diff --git a/perception/multi_object_tracker/CMakeLists.txt b/perception/multi_object_tracker/CMakeLists.txt index 4f9268583dd34..370e5bb0b9161 100644 --- a/perception/multi_object_tracker/CMakeLists.txt +++ b/perception/multi_object_tracker/CMakeLists.txt @@ -20,32 +20,34 @@ include_directories( ) # Generate exe file -set(MULTI_OBJECT_TRACKER_SRC - src/multi_object_tracker_core.cpp +set(${PROJECT_NAME}_src + src/multi_object_tracker_node.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 - src/tracker/motion_model/bicycle_motion_model.cpp +) +set(${PROJECT_NAME}_lib + lib/association/association.cpp + lib/association/mu_successive_shortest_path/mu_ssp.cpp + lib/tracker/motion_model/motion_model_base.cpp + lib/tracker/motion_model/bicycle_motion_model.cpp # cspell: ignore ctrv - src/tracker/motion_model/ctrv_motion_model.cpp - src/tracker/motion_model/cv_motion_model.cpp - src/tracker/model/tracker_base.cpp - src/tracker/model/big_vehicle_tracker.cpp - src/tracker/model/normal_vehicle_tracker.cpp - src/tracker/model/multiple_vehicle_tracker.cpp - src/tracker/model/bicycle_tracker.cpp - src/tracker/model/pedestrian_tracker.cpp - src/tracker/model/pedestrian_and_bicycle_tracker.cpp - src/tracker/model/unknown_tracker.cpp - src/tracker/model/pass_through_tracker.cpp + 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/multiple_vehicle_tracker.cpp + lib/tracker/model/bicycle_tracker.cpp + lib/tracker/model/pedestrian_tracker.cpp + lib/tracker/model/pedestrian_and_bicycle_tracker.cpp + lib/tracker/model/unknown_tracker.cpp + lib/tracker/model/pass_through_tracker.cpp ) - ament_auto_add_library(${PROJECT_NAME} SHARED - ${MULTI_OBJECT_TRACKER_SRC} + ${${PROJECT_NAME}_src} + ${${PROJECT_NAME}_lib} ) target_link_libraries(${PROJECT_NAME} @@ -54,8 +56,8 @@ target_link_libraries(${PROJECT_NAME} ) rclcpp_components_register_node(${PROJECT_NAME} - PLUGIN "multi_object_tracker::MultiObjectTracker" - EXECUTABLE ${PROJECT_NAME}_node + PLUGIN "autoware::multi_object_tracker::MultiObjectTracker" + EXECUTABLE multi_object_tracker_node ) ament_auto_package(INSTALL_TO_SHARE diff --git a/perception/multi_object_tracker/include/multi_object_tracker/data_association/data_association.hpp b/perception/multi_object_tracker/include/autoware/multi_object_tracker/association/association.hpp similarity index 81% rename from perception/multi_object_tracker/include/multi_object_tracker/data_association/data_association.hpp rename to perception/multi_object_tracker/include/autoware/multi_object_tracker/association/association.hpp index c30423db02c26..2c12341d0aa67 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/data_association/data_association.hpp +++ b/perception/multi_object_tracker/include/autoware/multi_object_tracker/association/association.hpp @@ -16,13 +16,13 @@ // Author: v1.0 Yukihiro Saito // -#ifndef MULTI_OBJECT_TRACKER__DATA_ASSOCIATION__DATA_ASSOCIATION_HPP_ -#define MULTI_OBJECT_TRACKER__DATA_ASSOCIATION__DATA_ASSOCIATION_HPP_ +#ifndef AUTOWARE__MULTI_OBJECT_TRACKER__ASSOCIATION__ASSOCIATION_HPP_ +#define AUTOWARE__MULTI_OBJECT_TRACKER__ASSOCIATION__ASSOCIATION_HPP_ #define EIGEN_MPL2_ONLY -#include "multi_object_tracker/data_association/solver/gnn_solver.hpp" -#include "multi_object_tracker/tracker/tracker.hpp" +#include "autoware/multi_object_tracker/association/solver/gnn_solver.hpp" +#include "autoware/multi_object_tracker/tracker/tracker.hpp" #include #include @@ -34,6 +34,8 @@ #include #include +namespace autoware::multi_object_tracker +{ class DataAssociation { private: @@ -61,4 +63,6 @@ class DataAssociation virtual ~DataAssociation() {} }; -#endif // MULTI_OBJECT_TRACKER__DATA_ASSOCIATION__DATA_ASSOCIATION_HPP_ +} // namespace autoware::multi_object_tracker + +#endif // AUTOWARE__MULTI_OBJECT_TRACKER__ASSOCIATION__ASSOCIATION_HPP_ diff --git a/perception/multi_object_tracker/include/multi_object_tracker/data_association/solver/gnn_solver.hpp b/perception/multi_object_tracker/include/autoware/multi_object_tracker/association/solver/gnn_solver.hpp similarity index 55% rename from perception/multi_object_tracker/include/multi_object_tracker/data_association/solver/gnn_solver.hpp rename to perception/multi_object_tracker/include/autoware/multi_object_tracker/association/solver/gnn_solver.hpp index 631fd73f8583d..3b72b800e86bc 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/data_association/solver/gnn_solver.hpp +++ b/perception/multi_object_tracker/include/autoware/multi_object_tracker/association/solver/gnn_solver.hpp @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef MULTI_OBJECT_TRACKER__DATA_ASSOCIATION__SOLVER__GNN_SOLVER_HPP_ -#define MULTI_OBJECT_TRACKER__DATA_ASSOCIATION__SOLVER__GNN_SOLVER_HPP_ +#ifndef AUTOWARE__MULTI_OBJECT_TRACKER__ASSOCIATION__SOLVER__GNN_SOLVER_HPP_ +#define AUTOWARE__MULTI_OBJECT_TRACKER__ASSOCIATION__SOLVER__GNN_SOLVER_HPP_ -#include "multi_object_tracker/data_association/solver/gnn_solver_interface.hpp" -#include "multi_object_tracker/data_association/solver/mu_successive_shortest_path.hpp" -#include "multi_object_tracker/data_association/solver/successive_shortest_path.hpp" +#include "autoware/multi_object_tracker/association/solver/gnn_solver_interface.hpp" +#include "autoware/multi_object_tracker/association/solver/mu_ssp.hpp" +#include "autoware/multi_object_tracker/association/solver/ssp.hpp" -#endif // MULTI_OBJECT_TRACKER__DATA_ASSOCIATION__SOLVER__GNN_SOLVER_HPP_ +#endif // AUTOWARE__MULTI_OBJECT_TRACKER__ASSOCIATION__SOLVER__GNN_SOLVER_HPP_ diff --git a/perception/multi_object_tracker/include/multi_object_tracker/data_association/solver/gnn_solver_interface.hpp b/perception/multi_object_tracker/include/autoware/multi_object_tracker/association/solver/gnn_solver_interface.hpp similarity index 73% rename from perception/multi_object_tracker/include/multi_object_tracker/data_association/solver/gnn_solver_interface.hpp rename to perception/multi_object_tracker/include/autoware/multi_object_tracker/association/solver/gnn_solver_interface.hpp index 1fb508bcf12b2..88f9181d96d9b 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/data_association/solver/gnn_solver_interface.hpp +++ b/perception/multi_object_tracker/include/autoware/multi_object_tracker/association/solver/gnn_solver_interface.hpp @@ -12,12 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef MULTI_OBJECT_TRACKER__DATA_ASSOCIATION__SOLVER__GNN_SOLVER_INTERFACE_HPP_ -#define MULTI_OBJECT_TRACKER__DATA_ASSOCIATION__SOLVER__GNN_SOLVER_INTERFACE_HPP_ +#ifndef AUTOWARE__MULTI_OBJECT_TRACKER__ASSOCIATION__SOLVER__GNN_SOLVER_INTERFACE_HPP_ +#define AUTOWARE__MULTI_OBJECT_TRACKER__ASSOCIATION__SOLVER__GNN_SOLVER_INTERFACE_HPP_ #include #include +namespace autoware::multi_object_tracker +{ namespace gnn_solver { class GnnSolverInterface @@ -30,6 +32,8 @@ class GnnSolverInterface const std::vector> & cost, std::unordered_map * direct_assignment, std::unordered_map * reverse_assignment) = 0; }; + } // namespace gnn_solver +} // namespace autoware::multi_object_tracker -#endif // MULTI_OBJECT_TRACKER__DATA_ASSOCIATION__SOLVER__GNN_SOLVER_INTERFACE_HPP_ +#endif // AUTOWARE__MULTI_OBJECT_TRACKER__ASSOCIATION__SOLVER__GNN_SOLVER_INTERFACE_HPP_ diff --git a/perception/multi_object_tracker/include/multi_object_tracker/data_association/solver/mu_successive_shortest_path.hpp b/perception/multi_object_tracker/include/autoware/multi_object_tracker/association/solver/mu_ssp.hpp similarity index 71% rename from perception/multi_object_tracker/include/multi_object_tracker/data_association/solver/mu_successive_shortest_path.hpp rename to perception/multi_object_tracker/include/autoware/multi_object_tracker/association/solver/mu_ssp.hpp index a4d9d727e6cc5..024670c3389c6 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/data_association/solver/mu_successive_shortest_path.hpp +++ b/perception/multi_object_tracker/include/autoware/multi_object_tracker/association/solver/mu_ssp.hpp @@ -12,14 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef MULTI_OBJECT_TRACKER__DATA_ASSOCIATION__SOLVER__MU_SUCCESSIVE_SHORTEST_PATH_HPP_ -#define MULTI_OBJECT_TRACKER__DATA_ASSOCIATION__SOLVER__MU_SUCCESSIVE_SHORTEST_PATH_HPP_ +#ifndef AUTOWARE__MULTI_OBJECT_TRACKER__ASSOCIATION__SOLVER__MU_SSP_HPP_ +#define AUTOWARE__MULTI_OBJECT_TRACKER__ASSOCIATION__SOLVER__MU_SSP_HPP_ -#include "multi_object_tracker/data_association/solver/gnn_solver_interface.hpp" +#include "autoware/multi_object_tracker/association/solver/gnn_solver_interface.hpp" #include #include +namespace autoware::multi_object_tracker +{ namespace gnn_solver { class MuSSP : public GnnSolverInterface @@ -32,6 +34,8 @@ class MuSSP : public GnnSolverInterface const std::vector> & cost, std::unordered_map * direct_assignment, std::unordered_map * reverse_assignment) override; }; + } // namespace gnn_solver +} // namespace autoware::multi_object_tracker -#endif // MULTI_OBJECT_TRACKER__DATA_ASSOCIATION__SOLVER__MU_SUCCESSIVE_SHORTEST_PATH_HPP_ +#endif // AUTOWARE__MULTI_OBJECT_TRACKER__ASSOCIATION__SOLVER__MU_SSP_HPP_ diff --git a/perception/multi_object_tracker/include/multi_object_tracker/data_association/solver/successive_shortest_path.hpp b/perception/multi_object_tracker/include/autoware/multi_object_tracker/association/solver/ssp.hpp similarity index 71% rename from perception/multi_object_tracker/include/multi_object_tracker/data_association/solver/successive_shortest_path.hpp rename to perception/multi_object_tracker/include/autoware/multi_object_tracker/association/solver/ssp.hpp index 1c4b15cd68b59..0f987fc49ee7c 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/data_association/solver/successive_shortest_path.hpp +++ b/perception/multi_object_tracker/include/autoware/multi_object_tracker/association/solver/ssp.hpp @@ -12,14 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef MULTI_OBJECT_TRACKER__DATA_ASSOCIATION__SOLVER__SUCCESSIVE_SHORTEST_PATH_HPP_ -#define MULTI_OBJECT_TRACKER__DATA_ASSOCIATION__SOLVER__SUCCESSIVE_SHORTEST_PATH_HPP_ +#ifndef AUTOWARE__MULTI_OBJECT_TRACKER__ASSOCIATION__SOLVER__SSP_HPP_ +#define AUTOWARE__MULTI_OBJECT_TRACKER__ASSOCIATION__SOLVER__SSP_HPP_ -#include "multi_object_tracker/data_association/solver/gnn_solver_interface.hpp" +#include "autoware/multi_object_tracker/association/solver/gnn_solver_interface.hpp" #include #include +namespace autoware::multi_object_tracker +{ namespace gnn_solver { class SSP : public GnnSolverInterface @@ -32,6 +34,8 @@ class SSP : public GnnSolverInterface const std::vector> & cost, std::unordered_map * direct_assignment, std::unordered_map * reverse_assignment) override; }; + } // namespace gnn_solver +} // namespace autoware::multi_object_tracker -#endif // MULTI_OBJECT_TRACKER__DATA_ASSOCIATION__SOLVER__SUCCESSIVE_SHORTEST_PATH_HPP_ +#endif // AUTOWARE__MULTI_OBJECT_TRACKER__ASSOCIATION__SOLVER__SSP_HPP_ diff --git a/perception/multi_object_tracker/include/multi_object_tracker/tracker/model/bicycle_tracker.hpp b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/bicycle_tracker.hpp similarity index 78% rename from perception/multi_object_tracker/include/multi_object_tracker/tracker/model/bicycle_tracker.hpp rename to perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/bicycle_tracker.hpp index 63ad496b70ed9..5374e28d5f9cf 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/tracker/model/bicycle_tracker.hpp +++ b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/bicycle_tracker.hpp @@ -16,13 +16,16 @@ // Author: v1.0 Yukihiro Saito // -#ifndef MULTI_OBJECT_TRACKER__TRACKER__MODEL__BICYCLE_TRACKER_HPP_ -#define MULTI_OBJECT_TRACKER__TRACKER__MODEL__BICYCLE_TRACKER_HPP_ +#ifndef AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__BICYCLE_TRACKER_HPP_ +#define AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__BICYCLE_TRACKER_HPP_ +#include "autoware/multi_object_tracker/tracker/model/tracker_base.hpp" +#include "autoware/multi_object_tracker/tracker/motion_model/bicycle_motion_model.hpp" +#include "autoware/multi_object_tracker/tracker/object_model/object_model.hpp" #include "kalman_filter/kalman_filter.hpp" -#include "multi_object_tracker/tracker/model/tracker_base.hpp" -#include "multi_object_tracker/tracker/motion_model/bicycle_motion_model.hpp" -#include "multi_object_tracker/tracker/object_model/object_model.hpp" + +namespace autoware::multi_object_tracker +{ class BicycleTracker : public Tracker { @@ -67,4 +70,6 @@ class BicycleTracker : public Tracker const geometry_msgs::msg::Transform & self_transform) const; }; -#endif // MULTI_OBJECT_TRACKER__TRACKER__MODEL__BICYCLE_TRACKER_HPP_ +} // namespace autoware::multi_object_tracker + +#endif // AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__BICYCLE_TRACKER_HPP_ diff --git a/perception/multi_object_tracker/include/multi_object_tracker/tracker/model/big_vehicle_tracker.hpp b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/big_vehicle_tracker.hpp similarity index 78% rename from perception/multi_object_tracker/include/multi_object_tracker/tracker/model/big_vehicle_tracker.hpp rename to perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/big_vehicle_tracker.hpp index 7112e6a08ade1..c3f824aff35b4 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/tracker/model/big_vehicle_tracker.hpp +++ b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/big_vehicle_tracker.hpp @@ -16,13 +16,16 @@ // Author: v1.0 Yukihiro Saito // -#ifndef MULTI_OBJECT_TRACKER__TRACKER__MODEL__BIG_VEHICLE_TRACKER_HPP_ -#define MULTI_OBJECT_TRACKER__TRACKER__MODEL__BIG_VEHICLE_TRACKER_HPP_ +#ifndef AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__BIG_VEHICLE_TRACKER_HPP_ +#define AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__BIG_VEHICLE_TRACKER_HPP_ +#include "autoware/multi_object_tracker/tracker/model/tracker_base.hpp" +#include "autoware/multi_object_tracker/tracker/motion_model/bicycle_motion_model.hpp" +#include "autoware/multi_object_tracker/tracker/object_model/object_model.hpp" #include "kalman_filter/kalman_filter.hpp" -#include "multi_object_tracker/tracker/model/tracker_base.hpp" -#include "multi_object_tracker/tracker/motion_model/bicycle_motion_model.hpp" -#include "multi_object_tracker/tracker/object_model/object_model.hpp" + +namespace autoware::multi_object_tracker +{ class BigVehicleTracker : public Tracker { @@ -70,4 +73,6 @@ class BigVehicleTracker : public Tracker const geometry_msgs::msg::Transform & self_transform); }; -#endif // MULTI_OBJECT_TRACKER__TRACKER__MODEL__BIG_VEHICLE_TRACKER_HPP_ +} // namespace autoware::multi_object_tracker + +#endif // AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__BIG_VEHICLE_TRACKER_HPP_ diff --git a/perception/multi_object_tracker/include/multi_object_tracker/tracker/model/multiple_vehicle_tracker.hpp b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/multiple_vehicle_tracker.hpp similarity index 71% rename from perception/multi_object_tracker/include/multi_object_tracker/tracker/model/multiple_vehicle_tracker.hpp rename to perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/multiple_vehicle_tracker.hpp index 75aec0b06d6b8..a0a6bd7781761 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/tracker/model/multiple_vehicle_tracker.hpp +++ b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/multiple_vehicle_tracker.hpp @@ -16,16 +16,19 @@ // Author: v1.0 Yukihiro Saito // -#ifndef MULTI_OBJECT_TRACKER__TRACKER__MODEL__MULTIPLE_VEHICLE_TRACKER_HPP_ -#define MULTI_OBJECT_TRACKER__TRACKER__MODEL__MULTIPLE_VEHICLE_TRACKER_HPP_ +#ifndef AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__MULTIPLE_VEHICLE_TRACKER_HPP_ +#define AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__MULTIPLE_VEHICLE_TRACKER_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 "kalman_filter/kalman_filter.hpp" -#include "multi_object_tracker/tracker/model/big_vehicle_tracker.hpp" -#include "multi_object_tracker/tracker/model/normal_vehicle_tracker.hpp" -#include "multi_object_tracker/tracker/model/tracker_base.hpp" #include +namespace autoware::multi_object_tracker +{ + class MultipleVehicleTracker : public Tracker { private: @@ -48,4 +51,6 @@ class MultipleVehicleTracker : public Tracker virtual ~MultipleVehicleTracker() {} }; -#endif // MULTI_OBJECT_TRACKER__TRACKER__MODEL__MULTIPLE_VEHICLE_TRACKER_HPP_ +} // namespace autoware::multi_object_tracker + +#endif // AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__MULTIPLE_VEHICLE_TRACKER_HPP_ diff --git a/perception/multi_object_tracker/include/multi_object_tracker/tracker/model/normal_vehicle_tracker.hpp b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/normal_vehicle_tracker.hpp similarity index 78% rename from perception/multi_object_tracker/include/multi_object_tracker/tracker/model/normal_vehicle_tracker.hpp rename to perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/normal_vehicle_tracker.hpp index 1165cecab258b..f7edebfc31378 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/tracker/model/normal_vehicle_tracker.hpp +++ b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/normal_vehicle_tracker.hpp @@ -16,13 +16,16 @@ // Author: v1.0 Yukihiro Saito // -#ifndef MULTI_OBJECT_TRACKER__TRACKER__MODEL__NORMAL_VEHICLE_TRACKER_HPP_ -#define MULTI_OBJECT_TRACKER__TRACKER__MODEL__NORMAL_VEHICLE_TRACKER_HPP_ +#ifndef AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__NORMAL_VEHICLE_TRACKER_HPP_ +#define 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/motion_model/bicycle_motion_model.hpp" +#include "autoware/multi_object_tracker/tracker/object_model/object_model.hpp" #include "kalman_filter/kalman_filter.hpp" -#include "multi_object_tracker/tracker/model/tracker_base.hpp" -#include "multi_object_tracker/tracker/motion_model/bicycle_motion_model.hpp" -#include "multi_object_tracker/tracker/object_model/object_model.hpp" + +namespace autoware::multi_object_tracker +{ class NormalVehicleTracker : public Tracker { @@ -70,4 +73,6 @@ class NormalVehicleTracker : public Tracker const geometry_msgs::msg::Transform & self_transform); }; -#endif // MULTI_OBJECT_TRACKER__TRACKER__MODEL__NORMAL_VEHICLE_TRACKER_HPP_ +} // namespace autoware::multi_object_tracker + +#endif // AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__NORMAL_VEHICLE_TRACKER_HPP_ diff --git a/perception/multi_object_tracker/include/multi_object_tracker/tracker/model/pass_through_tracker.hpp b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/pass_through_tracker.hpp similarity index 81% rename from perception/multi_object_tracker/include/multi_object_tracker/tracker/model/pass_through_tracker.hpp rename to perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/pass_through_tracker.hpp index cd661dab52c6e..e7f0a5fd699e1 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/tracker/model/pass_through_tracker.hpp +++ b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/pass_through_tracker.hpp @@ -16,12 +16,15 @@ // Author: v1.0 Yutaka Shimizu // -#ifndef MULTI_OBJECT_TRACKER__TRACKER__MODEL__PASS_THROUGH_TRACKER_HPP_ -#define MULTI_OBJECT_TRACKER__TRACKER__MODEL__PASS_THROUGH_TRACKER_HPP_ +#ifndef AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__PASS_THROUGH_TRACKER_HPP_ +#define AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__PASS_THROUGH_TRACKER_HPP_ #include "kalman_filter/kalman_filter.hpp" #include "tracker_base.hpp" +namespace autoware::multi_object_tracker +{ + class PassThroughTracker : public Tracker { private: @@ -44,4 +47,6 @@ class PassThroughTracker : public Tracker autoware_perception_msgs::msg::TrackedObject & object) const override; }; -#endif // MULTI_OBJECT_TRACKER__TRACKER__MODEL__PASS_THROUGH_TRACKER_HPP_ +} // namespace autoware::multi_object_tracker + +#endif // AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__PASS_THROUGH_TRACKER_HPP_ diff --git a/perception/multi_object_tracker/include/multi_object_tracker/tracker/model/pedestrian_and_bicycle_tracker.hpp b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/pedestrian_and_bicycle_tracker.hpp similarity index 71% rename from perception/multi_object_tracker/include/multi_object_tracker/tracker/model/pedestrian_and_bicycle_tracker.hpp rename to perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/pedestrian_and_bicycle_tracker.hpp index 3c3ac038b085e..f593280c2e183 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/tracker/model/pedestrian_and_bicycle_tracker.hpp +++ b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/pedestrian_and_bicycle_tracker.hpp @@ -16,13 +16,16 @@ // Author: v1.0 Yukihiro Saito // -#ifndef MULTI_OBJECT_TRACKER__TRACKER__MODEL__PEDESTRIAN_AND_BICYCLE_TRACKER_HPP_ -#define MULTI_OBJECT_TRACKER__TRACKER__MODEL__PEDESTRIAN_AND_BICYCLE_TRACKER_HPP_ +#ifndef AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__PEDESTRIAN_AND_BICYCLE_TRACKER_HPP_ +#define AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__PEDESTRIAN_AND_BICYCLE_TRACKER_HPP_ +#include "autoware/multi_object_tracker/tracker/model/bicycle_tracker.hpp" +#include "autoware/multi_object_tracker/tracker/model/pedestrian_tracker.hpp" +#include "autoware/multi_object_tracker/tracker/model/tracker_base.hpp" #include "kalman_filter/kalman_filter.hpp" -#include "multi_object_tracker/tracker/model/bicycle_tracker.hpp" -#include "multi_object_tracker/tracker/model/pedestrian_tracker.hpp" -#include "multi_object_tracker/tracker/model/tracker_base.hpp" + +namespace autoware::multi_object_tracker +{ class PedestrianAndBicycleTracker : public Tracker { @@ -46,4 +49,6 @@ class PedestrianAndBicycleTracker : public Tracker virtual ~PedestrianAndBicycleTracker() {} }; -#endif // MULTI_OBJECT_TRACKER__TRACKER__MODEL__PEDESTRIAN_AND_BICYCLE_TRACKER_HPP_ +} // namespace autoware::multi_object_tracker + +#endif // AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__PEDESTRIAN_AND_BICYCLE_TRACKER_HPP_ diff --git a/perception/multi_object_tracker/include/multi_object_tracker/tracker/model/pedestrian_tracker.hpp b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/pedestrian_tracker.hpp similarity index 78% rename from perception/multi_object_tracker/include/multi_object_tracker/tracker/model/pedestrian_tracker.hpp rename to perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/pedestrian_tracker.hpp index c5be57f656eb5..1e0f778a69137 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/tracker/model/pedestrian_tracker.hpp +++ b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/pedestrian_tracker.hpp @@ -16,15 +16,16 @@ // Author: v1.0 Yukihiro Saito // -#ifndef MULTI_OBJECT_TRACKER__TRACKER__MODEL__PEDESTRIAN_TRACKER_HPP_ -#define MULTI_OBJECT_TRACKER__TRACKER__MODEL__PEDESTRIAN_TRACKER_HPP_ +#ifndef AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__PEDESTRIAN_TRACKER_HPP_ +#define AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__PEDESTRIAN_TRACKER_HPP_ +#include "autoware/multi_object_tracker/tracker/model/tracker_base.hpp" +#include "autoware/multi_object_tracker/tracker/motion_model/ctrv_motion_model.hpp" +#include "autoware/multi_object_tracker/tracker/object_model/object_model.hpp" #include "kalman_filter/kalman_filter.hpp" -#include "multi_object_tracker/tracker/model/tracker_base.hpp" -#include "multi_object_tracker/tracker/motion_model/ctrv_motion_model.hpp" -#include "multi_object_tracker/tracker/object_model/object_model.hpp" -// cspell: ignore CTRV +namespace autoware::multi_object_tracker +{ class PedestrianTracker : public Tracker { @@ -49,7 +50,7 @@ class PedestrianTracker : public Tracker }; BoundingBox bounding_box_; Cylinder cylinder_; - + // cspell: ignore CTRV CTRVMotionModel motion_model_; using IDX = CTRVMotionModel::IDX; @@ -75,4 +76,6 @@ class PedestrianTracker : public Tracker const geometry_msgs::msg::Transform & self_transform) const; }; -#endif // MULTI_OBJECT_TRACKER__TRACKER__MODEL__PEDESTRIAN_TRACKER_HPP_ +} // namespace autoware::multi_object_tracker + +#endif // AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__PEDESTRIAN_TRACKER_HPP_ diff --git a/perception/multi_object_tracker/include/multi_object_tracker/tracker/model/tracker_base.hpp b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/tracker_base.hpp similarity index 91% rename from perception/multi_object_tracker/include/multi_object_tracker/tracker/model/tracker_base.hpp rename to perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/tracker_base.hpp index 44b3884c392e6..bc52e49f763fd 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/tracker/model/tracker_base.hpp +++ b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/tracker_base.hpp @@ -16,11 +16,11 @@ // Author: v1.0 Yukihiro Saito // -#ifndef MULTI_OBJECT_TRACKER__TRACKER__MODEL__TRACKER_BASE_HPP_ -#define MULTI_OBJECT_TRACKER__TRACKER__MODEL__TRACKER_BASE_HPP_ +#ifndef AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__TRACKER_BASE_HPP_ +#define AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__TRACKER_BASE_HPP_ #define EIGEN_MPL2_ONLY -#include "multi_object_tracker/utils/utils.hpp" +#include "autoware/multi_object_tracker/utils/utils.hpp" #include "object_recognition_utils/object_recognition_utils.hpp" #include @@ -33,6 +33,9 @@ #include +namespace autoware::multi_object_tracker +{ + class Tracker { private: @@ -114,4 +117,6 @@ class Tracker virtual bool predict(const rclcpp::Time & time) = 0; }; -#endif // MULTI_OBJECT_TRACKER__TRACKER__MODEL__TRACKER_BASE_HPP_ +} // namespace autoware::multi_object_tracker + +#endif // AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__TRACKER_BASE_HPP_ diff --git a/perception/multi_object_tracker/include/multi_object_tracker/tracker/model/unknown_tracker.hpp b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/unknown_tracker.hpp similarity index 80% rename from perception/multi_object_tracker/include/multi_object_tracker/tracker/model/unknown_tracker.hpp rename to perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/unknown_tracker.hpp index ca8ecba160bd8..4bc03f439ffc2 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/tracker/model/unknown_tracker.hpp +++ b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/model/unknown_tracker.hpp @@ -16,12 +16,15 @@ // Author: v1.0 Yukihiro Saito // -#ifndef MULTI_OBJECT_TRACKER__TRACKER__MODEL__UNKNOWN_TRACKER_HPP_ -#define MULTI_OBJECT_TRACKER__TRACKER__MODEL__UNKNOWN_TRACKER_HPP_ +#ifndef AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__UNKNOWN_TRACKER_HPP_ +#define AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__UNKNOWN_TRACKER_HPP_ +#include "autoware/multi_object_tracker/tracker/model/tracker_base.hpp" +#include "autoware/multi_object_tracker/tracker/motion_model/cv_motion_model.hpp" #include "kalman_filter/kalman_filter.hpp" -#include "multi_object_tracker/tracker/model/tracker_base.hpp" -#include "multi_object_tracker/tracker/motion_model/cv_motion_model.hpp" + +namespace autoware::multi_object_tracker +{ class UnknownTracker : public Tracker { @@ -62,4 +65,6 @@ class UnknownTracker : public Tracker autoware_perception_msgs::msg::TrackedObject & object) const override; }; -#endif // MULTI_OBJECT_TRACKER__TRACKER__MODEL__UNKNOWN_TRACKER_HPP_ +} // namespace autoware::multi_object_tracker + +#endif // AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MODEL__UNKNOWN_TRACKER_HPP_ diff --git a/perception/multi_object_tracker/include/multi_object_tracker/tracker/motion_model/bicycle_motion_model.hpp b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/motion_model/bicycle_motion_model.hpp similarity index 87% rename from perception/multi_object_tracker/include/multi_object_tracker/tracker/motion_model/bicycle_motion_model.hpp rename to perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/motion_model/bicycle_motion_model.hpp index f6ce2842388c6..6e20d31aad168 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/tracker/motion_model/bicycle_motion_model.hpp +++ b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/motion_model/bicycle_motion_model.hpp @@ -16,11 +16,11 @@ // Author: v1.0 Taekjin Lee // -#ifndef MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__BICYCLE_MOTION_MODEL_HPP_ -#define MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__BICYCLE_MOTION_MODEL_HPP_ +#ifndef AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__BICYCLE_MOTION_MODEL_HPP_ +#define AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__BICYCLE_MOTION_MODEL_HPP_ +#include "autoware/multi_object_tracker/tracker/motion_model/motion_model_base.hpp" #include "kalman_filter/kalman_filter.hpp" -#include "multi_object_tracker/tracker/motion_model/motion_model_base.hpp" #include #include @@ -32,6 +32,9 @@ #endif #include +namespace autoware::multi_object_tracker +{ + class BicycleMotionModel : public MotionModel { private: @@ -107,4 +110,6 @@ class BicycleMotionModel : public MotionModel geometry_msgs::msg::Twist & twist, std::array & twist_cov) const override; }; -#endif // MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__BICYCLE_MOTION_MODEL_HPP_ +} // namespace autoware::multi_object_tracker + +#endif // AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__BICYCLE_MOTION_MODEL_HPP_ diff --git a/perception/multi_object_tracker/include/multi_object_tracker/tracker/motion_model/ctrv_motion_model.hpp b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/motion_model/ctrv_motion_model.hpp similarity index 86% rename from perception/multi_object_tracker/include/multi_object_tracker/tracker/motion_model/ctrv_motion_model.hpp rename to perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/motion_model/ctrv_motion_model.hpp index 657048079c46c..3cca786d9f65b 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/tracker/motion_model/ctrv_motion_model.hpp +++ b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/motion_model/ctrv_motion_model.hpp @@ -16,11 +16,11 @@ // Author: v1.0 Taekjin Lee // -#ifndef MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__CTRV_MOTION_MODEL_HPP_ -#define MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__CTRV_MOTION_MODEL_HPP_ +#ifndef AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__CTRV_MOTION_MODEL_HPP_ +#define AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__CTRV_MOTION_MODEL_HPP_ +#include "autoware/multi_object_tracker/tracker/motion_model/motion_model_base.hpp" #include "kalman_filter/kalman_filter.hpp" -#include "multi_object_tracker/tracker/motion_model/motion_model_base.hpp" #include #include @@ -32,8 +32,10 @@ #endif #include -// cspell: ignore CTRV +namespace autoware::multi_object_tracker +{ +// cspell: ignore CTRV class CTRVMotionModel : public MotionModel { private: @@ -92,4 +94,6 @@ class CTRVMotionModel : public MotionModel geometry_msgs::msg::Twist & twist, std::array & twist_cov) const override; }; -#endif // MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__CTRV_MOTION_MODEL_HPP_ +} // namespace autoware::multi_object_tracker + +#endif // AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__CTRV_MOTION_MODEL_HPP_ diff --git a/perception/multi_object_tracker/include/multi_object_tracker/tracker/motion_model/cv_motion_model.hpp b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/motion_model/cv_motion_model.hpp similarity index 84% rename from perception/multi_object_tracker/include/multi_object_tracker/tracker/motion_model/cv_motion_model.hpp rename to perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/motion_model/cv_motion_model.hpp index 421e413d7aab7..ad3061285a80c 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/tracker/motion_model/cv_motion_model.hpp +++ b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/motion_model/cv_motion_model.hpp @@ -16,11 +16,11 @@ // Author: v1.0 Taekjin Lee // -#ifndef MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__CV_MOTION_MODEL_HPP_ -#define MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__CV_MOTION_MODEL_HPP_ +#ifndef AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__CV_MOTION_MODEL_HPP_ +#define AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__CV_MOTION_MODEL_HPP_ +#include "autoware/multi_object_tracker/tracker/motion_model/motion_model_base.hpp" #include "kalman_filter/kalman_filter.hpp" -#include "multi_object_tracker/tracker/motion_model/motion_model_base.hpp" #include #include @@ -32,6 +32,9 @@ #endif #include +namespace autoware::multi_object_tracker +{ + class CVMotionModel : public MotionModel { private: @@ -85,4 +88,6 @@ class CVMotionModel : public MotionModel geometry_msgs::msg::Twist & twist, std::array & twist_cov) const override; }; -#endif // MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__CV_MOTION_MODEL_HPP_ +} // namespace autoware::multi_object_tracker + +#endif // AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__CV_MOTION_MODEL_HPP_ diff --git a/perception/multi_object_tracker/include/multi_object_tracker/tracker/motion_model/motion_model_base.hpp b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/motion_model/motion_model_base.hpp similarity index 85% rename from perception/multi_object_tracker/include/multi_object_tracker/tracker/motion_model/motion_model_base.hpp rename to perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/motion_model/motion_model_base.hpp index e740612e96d4f..130053fafd2ed 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/tracker/motion_model/motion_model_base.hpp +++ b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/motion_model/motion_model_base.hpp @@ -16,8 +16,8 @@ // Author: v1.0 Taekjin Lee // -#ifndef MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__MOTION_MODEL_BASE_HPP_ -#define MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__MOTION_MODEL_BASE_HPP_ +#ifndef AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__MOTION_MODEL_BASE_HPP_ +#define AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__MOTION_MODEL_BASE_HPP_ #include "kalman_filter/kalman_filter.hpp" @@ -31,6 +31,9 @@ #endif #include +namespace autoware::multi_object_tracker +{ + class MotionModel { private: @@ -65,4 +68,6 @@ class MotionModel geometry_msgs::msg::Twist & twist, std::array & twist_cov) const = 0; }; -#endif // MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__MOTION_MODEL_BASE_HPP_ +} // namespace autoware::multi_object_tracker + +#endif // AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__MOTION_MODEL_BASE_HPP_ diff --git a/perception/multi_object_tracker/include/multi_object_tracker/tracker/object_model/object_model.hpp b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/object_model/object_model.hpp similarity index 96% rename from perception/multi_object_tracker/include/multi_object_tracker/tracker/object_model/object_model.hpp rename to perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/object_model/object_model.hpp index 6a771344bb36b..b49464109eec8 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/tracker/object_model/object_model.hpp +++ b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/object_model/object_model.hpp @@ -16,8 +16,8 @@ // Author: v1.0 Taekjin Lee // -#ifndef MULTI_OBJECT_TRACKER__TRACKER__OBJECT_MODEL__OBJECT_MODEL_HPP_ -#define MULTI_OBJECT_TRACKER__TRACKER__OBJECT_MODEL__OBJECT_MODEL_HPP_ +#ifndef AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__OBJECT_MODEL__OBJECT_MODEL_HPP_ +#define AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__OBJECT_MODEL__OBJECT_MODEL_HPP_ #include @@ -46,6 +46,9 @@ constexpr T kmph2mps(const T kmph) } // namespace +namespace autoware::multi_object_tracker +{ + namespace object_model { @@ -301,5 +304,6 @@ static const ObjectModel bicycle(ObjectModelType::Bicycle); static const ObjectModel pedestrian(ObjectModelType::Pedestrian); } // namespace object_model +} // namespace autoware::multi_object_tracker -#endif // MULTI_OBJECT_TRACKER__TRACKER__OBJECT_MODEL__OBJECT_MODEL_HPP_ +#endif // AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__OBJECT_MODEL__OBJECT_MODEL_HPP_ diff --git a/perception/multi_object_tracker/include/multi_object_tracker/tracker/tracker.hpp b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/tracker.hpp similarity index 84% rename from perception/multi_object_tracker/include/multi_object_tracker/tracker/tracker.hpp rename to perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/tracker.hpp index a8bc58e254fc2..ea1e60d4c7e17 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/tracker/tracker.hpp +++ b/perception/multi_object_tracker/include/autoware/multi_object_tracker/tracker/tracker.hpp @@ -16,8 +16,8 @@ // Author: v1.0 Yukihiro Saito // -#ifndef MULTI_OBJECT_TRACKER__TRACKER__TRACKER_HPP_ -#define MULTI_OBJECT_TRACKER__TRACKER__TRACKER_HPP_ +#ifndef AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__TRACKER_HPP_ +#define AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__TRACKER_HPP_ #include "model/bicycle_tracker.hpp" #include "model/big_vehicle_tracker.hpp" @@ -29,4 +29,4 @@ #include "model/tracker_base.hpp" #include "model/unknown_tracker.hpp" -#endif // MULTI_OBJECT_TRACKER__TRACKER__TRACKER_HPP_ +#endif // AUTOWARE__MULTI_OBJECT_TRACKER__TRACKER__TRACKER_HPP_ diff --git a/perception/multi_object_tracker/include/multi_object_tracker/utils/utils.hpp b/perception/multi_object_tracker/include/autoware/multi_object_tracker/utils/utils.hpp similarity index 98% rename from perception/multi_object_tracker/include/multi_object_tracker/utils/utils.hpp rename to perception/multi_object_tracker/include/autoware/multi_object_tracker/utils/utils.hpp index 0bda7870ae2b9..833f768e171f4 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/utils/utils.hpp +++ b/perception/multi_object_tracker/include/autoware/multi_object_tracker/utils/utils.hpp @@ -16,8 +16,8 @@ // Author: v1.0 Yukihiro Saito // -#ifndef MULTI_OBJECT_TRACKER__UTILS__UTILS_HPP_ -#define MULTI_OBJECT_TRACKER__UTILS__UTILS_HPP_ +#ifndef AUTOWARE__MULTI_OBJECT_TRACKER__UTILS__UTILS_HPP_ +#define AUTOWARE__MULTI_OBJECT_TRACKER__UTILS__UTILS_HPP_ #include #include @@ -276,4 +276,4 @@ inline bool getMeasurementYaw( } // namespace utils -#endif // MULTI_OBJECT_TRACKER__UTILS__UTILS_HPP_ +#endif // AUTOWARE__MULTI_OBJECT_TRACKER__UTILS__UTILS_HPP_ diff --git a/perception/multi_object_tracker/src/data_association/data_association.cpp b/perception/multi_object_tracker/lib/association/association.cpp similarity index 96% rename from perception/multi_object_tracker/src/data_association/data_association.cpp rename to perception/multi_object_tracker/lib/association/association.cpp index f7b40cd178528..ac31cad4cc13c 100644 --- a/perception/multi_object_tracker/src/data_association/data_association.cpp +++ b/perception/multi_object_tracker/lib/association/association.cpp @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "multi_object_tracker/data_association/data_association.hpp" +#include "autoware/multi_object_tracker/association/association.hpp" -#include "multi_object_tracker/data_association/solver/gnn_solver.hpp" -#include "multi_object_tracker/utils/utils.hpp" +#include "autoware/multi_object_tracker/association/solver/gnn_solver.hpp" +#include "autoware/multi_object_tracker/utils/utils.hpp" #include "object_recognition_utils/object_recognition_utils.hpp" #include @@ -68,6 +68,9 @@ double getFormedYawAngle( } } // namespace +namespace autoware::multi_object_tracker +{ + DataAssociation::DataAssociation( std::vector can_assign_vector, std::vector max_dist_vector, std::vector max_area_vector, std::vector min_area_vector, @@ -224,3 +227,5 @@ Eigen::MatrixXd DataAssociation::calcScoreMatrix( return score_matrix; } + +} // namespace autoware::multi_object_tracker diff --git a/perception/multi_object_tracker/src/data_association/mu_successive_shortest_path/mu_successive_shortest_path_wrapper.cpp b/perception/multi_object_tracker/lib/association/mu_successive_shortest_path/mu_ssp.cpp similarity index 88% rename from perception/multi_object_tracker/src/data_association/mu_successive_shortest_path/mu_successive_shortest_path_wrapper.cpp rename to perception/multi_object_tracker/lib/association/mu_successive_shortest_path/mu_ssp.cpp index 18779a7fffbdf..9ae6e300b2b9b 100644 --- a/perception/multi_object_tracker/src/data_association/mu_successive_shortest_path/mu_successive_shortest_path_wrapper.cpp +++ b/perception/multi_object_tracker/lib/association/mu_successive_shortest_path/mu_ssp.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "multi_object_tracker/data_association/solver/mu_successive_shortest_path.hpp" +#include "autoware/multi_object_tracker/association/solver/mu_ssp.hpp" #include @@ -24,6 +24,8 @@ #include #include +namespace autoware::multi_object_tracker +{ namespace gnn_solver { void MuSSP::maximizeLinearAssignment( @@ -39,3 +41,5 @@ void MuSSP::maximizeLinearAssignment( solve_muSSP(cost, direct_assignment, reverse_assignment); } } // namespace gnn_solver + +} // namespace autoware::multi_object_tracker diff --git a/perception/multi_object_tracker/src/data_association/successive_shortest_path/successive_shortest_path.cpp b/perception/multi_object_tracker/lib/association/successive_shortest_path/ssp.cpp similarity index 98% rename from perception/multi_object_tracker/src/data_association/successive_shortest_path/successive_shortest_path.cpp rename to perception/multi_object_tracker/lib/association/successive_shortest_path/ssp.cpp index 0b52c09cb54b8..d20992c7d183b 100644 --- a/perception/multi_object_tracker/src/data_association/successive_shortest_path/successive_shortest_path.cpp +++ b/perception/multi_object_tracker/lib/association/successive_shortest_path/ssp.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "multi_object_tracker/data_association/solver/successive_shortest_path.hpp" +#include "autoware/multi_object_tracker/association/solver/ssp.hpp" #include #include @@ -22,6 +22,8 @@ #include #include +namespace autoware::multi_object_tracker +{ namespace gnn_solver { struct ResidualEdge @@ -368,3 +370,5 @@ void SSP::maximizeLinearAssignment( #endif } } // namespace gnn_solver + +} // namespace autoware::multi_object_tracker diff --git a/perception/multi_object_tracker/src/tracker/model/bicycle_tracker.cpp b/perception/multi_object_tracker/lib/tracker/model/bicycle_tracker.cpp similarity index 98% rename from perception/multi_object_tracker/src/tracker/model/bicycle_tracker.cpp rename to perception/multi_object_tracker/lib/tracker/model/bicycle_tracker.cpp index a438c830596d7..ba53ccec1ad43 100644 --- a/perception/multi_object_tracker/src/tracker/model/bicycle_tracker.cpp +++ b/perception/multi_object_tracker/lib/tracker/model/bicycle_tracker.cpp @@ -17,13 +17,13 @@ // #define EIGEN_MPL2_ONLY -#include "multi_object_tracker/tracker/model/bicycle_tracker.hpp" +#include "autoware/multi_object_tracker/tracker/model/bicycle_tracker.hpp" +#include "autoware/multi_object_tracker/utils/utils.hpp" #include "autoware/universe_utils/geometry/boost_polygon_utils.hpp" #include "autoware/universe_utils/math/normalization.hpp" #include "autoware/universe_utils/math/unit_conversion.hpp" #include "autoware/universe_utils/ros/msg_covariance.hpp" -#include "multi_object_tracker/utils/utils.hpp" #include "object_recognition_utils/object_recognition_utils.hpp" #include @@ -40,6 +40,9 @@ #include #endif +namespace autoware::multi_object_tracker +{ + using Label = autoware_perception_msgs::msg::ObjectClassification; BicycleTracker::BicycleTracker( @@ -334,3 +337,5 @@ bool BicycleTracker::getTrackedObject( return true; } + +} // namespace autoware::multi_object_tracker diff --git a/perception/multi_object_tracker/src/tracker/model/big_vehicle_tracker.cpp b/perception/multi_object_tracker/lib/tracker/model/big_vehicle_tracker.cpp similarity index 98% rename from perception/multi_object_tracker/src/tracker/model/big_vehicle_tracker.cpp rename to perception/multi_object_tracker/lib/tracker/model/big_vehicle_tracker.cpp index 90d33e65b46bd..0593b7fc9dc12 100644 --- a/perception/multi_object_tracker/src/tracker/model/big_vehicle_tracker.cpp +++ b/perception/multi_object_tracker/lib/tracker/model/big_vehicle_tracker.cpp @@ -17,13 +17,13 @@ // #define EIGEN_MPL2_ONLY -#include "multi_object_tracker/tracker/model/big_vehicle_tracker.hpp" +#include "autoware/multi_object_tracker/tracker/model/big_vehicle_tracker.hpp" +#include "autoware/multi_object_tracker/utils/utils.hpp" #include "autoware/universe_utils/geometry/boost_polygon_utils.hpp" #include "autoware/universe_utils/math/normalization.hpp" #include "autoware/universe_utils/math/unit_conversion.hpp" #include "autoware/universe_utils/ros/msg_covariance.hpp" -#include "multi_object_tracker/utils/utils.hpp" #include "object_recognition_utils/object_recognition_utils.hpp" #include @@ -40,6 +40,8 @@ #include #endif +namespace autoware::multi_object_tracker +{ using Label = autoware_perception_msgs::msg::ObjectClassification; BigVehicleTracker::BigVehicleTracker( @@ -398,3 +400,5 @@ bool BigVehicleTracker::getTrackedObject( return true; } + +} // namespace autoware::multi_object_tracker diff --git a/perception/multi_object_tracker/src/tracker/model/multiple_vehicle_tracker.cpp b/perception/multi_object_tracker/lib/tracker/model/multiple_vehicle_tracker.cpp similarity index 93% rename from perception/multi_object_tracker/src/tracker/model/multiple_vehicle_tracker.cpp rename to perception/multi_object_tracker/lib/tracker/model/multiple_vehicle_tracker.cpp index 67445e5b0daa2..a6e5021e4fe7d 100644 --- a/perception/multi_object_tracker/src/tracker/model/multiple_vehicle_tracker.cpp +++ b/perception/multi_object_tracker/lib/tracker/model/multiple_vehicle_tracker.cpp @@ -16,7 +16,10 @@ // Author: v1.0 Yukihiro Saito // -#include "multi_object_tracker/tracker/model/multiple_vehicle_tracker.hpp" +#include "autoware/multi_object_tracker/tracker/model/multiple_vehicle_tracker.hpp" + +namespace autoware::multi_object_tracker +{ using Label = autoware_perception_msgs::msg::ObjectClassification; @@ -65,3 +68,5 @@ bool MultipleVehicleTracker::getTrackedObject( object.classification = getClassification(); return true; } + +} // namespace autoware::multi_object_tracker diff --git a/perception/multi_object_tracker/src/tracker/model/normal_vehicle_tracker.cpp b/perception/multi_object_tracker/lib/tracker/model/normal_vehicle_tracker.cpp similarity index 98% rename from perception/multi_object_tracker/src/tracker/model/normal_vehicle_tracker.cpp rename to perception/multi_object_tracker/lib/tracker/model/normal_vehicle_tracker.cpp index 67282893083c1..ef345692b32ca 100644 --- a/perception/multi_object_tracker/src/tracker/model/normal_vehicle_tracker.cpp +++ b/perception/multi_object_tracker/lib/tracker/model/normal_vehicle_tracker.cpp @@ -17,13 +17,13 @@ // #define EIGEN_MPL2_ONLY -#include "multi_object_tracker/tracker/model/normal_vehicle_tracker.hpp" +#include "autoware/multi_object_tracker/tracker/model/normal_vehicle_tracker.hpp" +#include "autoware/multi_object_tracker/utils/utils.hpp" #include "autoware/universe_utils/geometry/boost_polygon_utils.hpp" #include "autoware/universe_utils/math/normalization.hpp" #include "autoware/universe_utils/math/unit_conversion.hpp" #include "autoware/universe_utils/ros/msg_covariance.hpp" -#include "multi_object_tracker/utils/utils.hpp" #include "object_recognition_utils/object_recognition_utils.hpp" #include @@ -40,6 +40,9 @@ #include #endif +namespace autoware::multi_object_tracker +{ + using Label = autoware_perception_msgs::msg::ObjectClassification; NormalVehicleTracker::NormalVehicleTracker( @@ -399,3 +402,5 @@ bool NormalVehicleTracker::getTrackedObject( return true; } + +} // namespace autoware::multi_object_tracker diff --git a/perception/multi_object_tracker/src/tracker/model/pass_through_tracker.cpp b/perception/multi_object_tracker/lib/tracker/model/pass_through_tracker.cpp similarity index 95% rename from perception/multi_object_tracker/src/tracker/model/pass_through_tracker.cpp rename to perception/multi_object_tracker/lib/tracker/model/pass_through_tracker.cpp index 17be415480360..c872944fab3d7 100644 --- a/perception/multi_object_tracker/src/tracker/model/pass_through_tracker.cpp +++ b/perception/multi_object_tracker/lib/tracker/model/pass_through_tracker.cpp @@ -16,10 +16,10 @@ // Author: v1.0 Yutaka Shimizu // #define EIGEN_MPL2_ONLY -#include "multi_object_tracker/tracker/model/pass_through_tracker.hpp" +#include "autoware/multi_object_tracker/tracker/model/pass_through_tracker.hpp" +#include "autoware/multi_object_tracker/utils/utils.hpp" #include "autoware/universe_utils/ros/msg_covariance.hpp" -#include "multi_object_tracker/utils/utils.hpp" #include "object_recognition_utils/object_recognition_utils.hpp" #include @@ -36,6 +36,9 @@ #include #endif +namespace autoware::multi_object_tracker +{ + PassThroughTracker::PassThroughTracker( const rclcpp::Time & time, const autoware_perception_msgs::msg::DetectedObject & object, const geometry_msgs::msg::Transform & /*self_transform*/, const size_t channel_size, @@ -117,3 +120,5 @@ bool PassThroughTracker::getTrackedObject( return true; } + +} // namespace autoware::multi_object_tracker diff --git a/perception/multi_object_tracker/src/tracker/model/pedestrian_and_bicycle_tracker.cpp b/perception/multi_object_tracker/lib/tracker/model/pedestrian_and_bicycle_tracker.cpp similarity index 93% rename from perception/multi_object_tracker/src/tracker/model/pedestrian_and_bicycle_tracker.cpp rename to perception/multi_object_tracker/lib/tracker/model/pedestrian_and_bicycle_tracker.cpp index 00609934990a3..8c665e6078a2b 100644 --- a/perception/multi_object_tracker/src/tracker/model/pedestrian_and_bicycle_tracker.cpp +++ b/perception/multi_object_tracker/lib/tracker/model/pedestrian_and_bicycle_tracker.cpp @@ -16,7 +16,10 @@ // Author: v1.0 Yukihiro Saito // -#include "multi_object_tracker/tracker/model/pedestrian_and_bicycle_tracker.hpp" +#include "autoware/multi_object_tracker/tracker/model/pedestrian_and_bicycle_tracker.hpp" + +namespace autoware::multi_object_tracker +{ using Label = autoware_perception_msgs::msg::ObjectClassification; @@ -65,3 +68,5 @@ bool PedestrianAndBicycleTracker::getTrackedObject( object.classification = getClassification(); return true; } + +} // namespace autoware::multi_object_tracker diff --git a/perception/multi_object_tracker/src/tracker/model/pedestrian_tracker.cpp b/perception/multi_object_tracker/lib/tracker/model/pedestrian_tracker.cpp similarity index 98% rename from perception/multi_object_tracker/src/tracker/model/pedestrian_tracker.cpp rename to perception/multi_object_tracker/lib/tracker/model/pedestrian_tracker.cpp index d9412c3b5739c..ee50c2e5449ed 100644 --- a/perception/multi_object_tracker/src/tracker/model/pedestrian_tracker.cpp +++ b/perception/multi_object_tracker/lib/tracker/model/pedestrian_tracker.cpp @@ -17,13 +17,13 @@ // #define EIGEN_MPL2_ONLY -#include "multi_object_tracker/tracker/model/pedestrian_tracker.hpp" +#include "autoware/multi_object_tracker/tracker/model/pedestrian_tracker.hpp" +#include "autoware/multi_object_tracker/utils/utils.hpp" #include "autoware/universe_utils/geometry/boost_polygon_utils.hpp" #include "autoware/universe_utils/math/normalization.hpp" #include "autoware/universe_utils/math/unit_conversion.hpp" #include "autoware/universe_utils/ros/msg_covariance.hpp" -#include "multi_object_tracker/utils/utils.hpp" #include "object_recognition_utils/object_recognition_utils.hpp" #include @@ -40,6 +40,9 @@ #include #endif +namespace autoware::multi_object_tracker +{ + using Label = autoware_perception_msgs::msg::ObjectClassification; PedestrianTracker::PedestrianTracker( @@ -338,3 +341,5 @@ bool PedestrianTracker::getTrackedObject( return true; } + +} // namespace autoware::multi_object_tracker diff --git a/perception/multi_object_tracker/src/tracker/model/tracker_base.cpp b/perception/multi_object_tracker/lib/tracker/model/tracker_base.cpp similarity index 96% rename from perception/multi_object_tracker/src/tracker/model/tracker_base.cpp rename to perception/multi_object_tracker/lib/tracker/model/tracker_base.cpp index f27bad172a4b9..daa8db5db91e6 100644 --- a/perception/multi_object_tracker/src/tracker/model/tracker_base.cpp +++ b/perception/multi_object_tracker/lib/tracker/model/tracker_base.cpp @@ -14,9 +14,9 @@ // // -#include "multi_object_tracker/tracker/model/tracker_base.hpp" +#include "autoware/multi_object_tracker/tracker/model/tracker_base.hpp" -#include "multi_object_tracker/utils/utils.hpp" +#include "autoware/multi_object_tracker/utils/utils.hpp" #include #include @@ -40,6 +40,9 @@ float decayProbability(const float & prior, const float & delta_time) } } // namespace +namespace autoware::multi_object_tracker +{ + Tracker::Tracker( const rclcpp::Time & time, const std::vector & classification, @@ -202,3 +205,5 @@ geometry_msgs::msg::PoseWithCovariance Tracker::getPoseWithCovariance( getTrackedObject(time, object); return object.kinematics.pose_with_covariance; } + +} // namespace autoware::multi_object_tracker diff --git a/perception/multi_object_tracker/src/tracker/model/unknown_tracker.cpp b/perception/multi_object_tracker/lib/tracker/model/unknown_tracker.cpp similarity index 97% rename from perception/multi_object_tracker/src/tracker/model/unknown_tracker.cpp rename to perception/multi_object_tracker/lib/tracker/model/unknown_tracker.cpp index 6905d7c3b8ced..0648007e0b807 100644 --- a/perception/multi_object_tracker/src/tracker/model/unknown_tracker.cpp +++ b/perception/multi_object_tracker/lib/tracker/model/unknown_tracker.cpp @@ -13,13 +13,13 @@ // limitations under the License. #define EIGEN_MPL2_ONLY -#include "multi_object_tracker/tracker/model/unknown_tracker.hpp" +#include "autoware/multi_object_tracker/tracker/model/unknown_tracker.hpp" +#include "autoware/multi_object_tracker/utils/utils.hpp" #include "autoware/universe_utils/geometry/boost_polygon_utils.hpp" #include "autoware/universe_utils/math/normalization.hpp" #include "autoware/universe_utils/math/unit_conversion.hpp" #include "autoware/universe_utils/ros/msg_covariance.hpp" -#include "multi_object_tracker/utils/utils.hpp" #include #include @@ -36,6 +36,9 @@ #endif #include "object_recognition_utils/object_recognition_utils.hpp" +namespace autoware::multi_object_tracker +{ + UnknownTracker::UnknownTracker( const rclcpp::Time & time, const autoware_perception_msgs::msg::DetectedObject & object, const geometry_msgs::msg::Transform & /*self_transform*/, const size_t channel_size, @@ -234,3 +237,5 @@ bool UnknownTracker::getTrackedObject( return true; } + +} // namespace autoware::multi_object_tracker diff --git a/perception/multi_object_tracker/src/tracker/motion_model/bicycle_motion_model.cpp b/perception/multi_object_tracker/lib/tracker/motion_model/bicycle_motion_model.cpp similarity index 98% rename from perception/multi_object_tracker/src/tracker/motion_model/bicycle_motion_model.cpp rename to perception/multi_object_tracker/lib/tracker/motion_model/bicycle_motion_model.cpp index 466108a2bef0e..2e325d18579a6 100644 --- a/perception/multi_object_tracker/src/tracker/motion_model/bicycle_motion_model.cpp +++ b/perception/multi_object_tracker/lib/tracker/motion_model/bicycle_motion_model.cpp @@ -17,17 +17,20 @@ // #define EIGEN_MPL2_ONLY -#include "multi_object_tracker/tracker/motion_model/bicycle_motion_model.hpp" +#include "autoware/multi_object_tracker/tracker/motion_model/bicycle_motion_model.hpp" +#include "autoware/multi_object_tracker/tracker/motion_model/motion_model_base.hpp" +#include "autoware/multi_object_tracker/utils/utils.hpp" #include "autoware/universe_utils/math/normalization.hpp" #include "autoware/universe_utils/math/unit_conversion.hpp" #include "autoware/universe_utils/ros/msg_covariance.hpp" -#include "multi_object_tracker/tracker/motion_model/motion_model_base.hpp" -#include "multi_object_tracker/utils/utils.hpp" #include #include +namespace autoware::multi_object_tracker +{ + // cspell: ignore CTRV // Bicycle CTRV motion model // CTRV : Constant Turn Rate and constant Velocity @@ -487,3 +490,5 @@ bool BicycleMotionModel::getPredictedState( return true; } + +} // namespace autoware::multi_object_tracker diff --git a/perception/multi_object_tracker/src/tracker/motion_model/ctrv_motion_model.cpp b/perception/multi_object_tracker/lib/tracker/motion_model/ctrv_motion_model.cpp similarity index 97% rename from perception/multi_object_tracker/src/tracker/motion_model/ctrv_motion_model.cpp rename to perception/multi_object_tracker/lib/tracker/motion_model/ctrv_motion_model.cpp index b19af1d26d162..b1c5a36f9ad5b 100644 --- a/perception/multi_object_tracker/src/tracker/motion_model/ctrv_motion_model.cpp +++ b/perception/multi_object_tracker/lib/tracker/motion_model/ctrv_motion_model.cpp @@ -17,17 +17,19 @@ // #define EIGEN_MPL2_ONLY -#include "multi_object_tracker/tracker/motion_model/ctrv_motion_model.hpp" +#include "autoware/multi_object_tracker/tracker/motion_model/ctrv_motion_model.hpp" +#include "autoware/multi_object_tracker/tracker/motion_model/motion_model_base.hpp" +#include "autoware/multi_object_tracker/utils/utils.hpp" #include "autoware/universe_utils/math/normalization.hpp" #include "autoware/universe_utils/math/unit_conversion.hpp" #include "autoware/universe_utils/ros/msg_covariance.hpp" -#include "multi_object_tracker/tracker/motion_model/motion_model_base.hpp" -#include "multi_object_tracker/utils/utils.hpp" #include #include +namespace autoware::multi_object_tracker +{ // cspell: ignore CTRV // Constant Turn Rate and constant Velocity (CTRV) motion model using autoware::universe_utils::xyzrpy_covariance_index::XYZRPY_COV_IDX; @@ -386,3 +388,5 @@ bool CTRVMotionModel::getPredictedState( return true; } + +} // namespace autoware::multi_object_tracker diff --git a/perception/multi_object_tracker/src/tracker/motion_model/cv_motion_model.cpp b/perception/multi_object_tracker/lib/tracker/motion_model/cv_motion_model.cpp similarity index 97% rename from perception/multi_object_tracker/src/tracker/motion_model/cv_motion_model.cpp rename to perception/multi_object_tracker/lib/tracker/motion_model/cv_motion_model.cpp index 231ba73796ed9..2e2ba660a6e0d 100644 --- a/perception/multi_object_tracker/src/tracker/motion_model/cv_motion_model.cpp +++ b/perception/multi_object_tracker/lib/tracker/motion_model/cv_motion_model.cpp @@ -17,19 +17,21 @@ // #define EIGEN_MPL2_ONLY -#include "multi_object_tracker/tracker/motion_model/cv_motion_model.hpp" +#include "autoware/multi_object_tracker/tracker/motion_model/cv_motion_model.hpp" +#include "autoware/multi_object_tracker/tracker/motion_model/motion_model_base.hpp" +#include "autoware/multi_object_tracker/utils/utils.hpp" #include "autoware/universe_utils/math/normalization.hpp" #include "autoware/universe_utils/math/unit_conversion.hpp" #include "autoware/universe_utils/ros/msg_covariance.hpp" -#include "multi_object_tracker/tracker/motion_model/motion_model_base.hpp" -#include "multi_object_tracker/utils/utils.hpp" #include #include #include +namespace autoware::multi_object_tracker +{ // cspell: ignore CV // Constant Velocity (CV) motion model using autoware::universe_utils::xyzrpy_covariance_index::XYZRPY_COV_IDX; @@ -306,3 +308,5 @@ bool CVMotionModel::getPredictedState( return true; } + +} // namespace autoware::multi_object_tracker diff --git a/perception/multi_object_tracker/src/tracker/motion_model/motion_model_base.cpp b/perception/multi_object_tracker/lib/tracker/motion_model/motion_model_base.cpp similarity index 93% rename from perception/multi_object_tracker/src/tracker/motion_model/motion_model_base.cpp rename to perception/multi_object_tracker/lib/tracker/motion_model/motion_model_base.cpp index 4d51021de634b..ffbb452815fa7 100644 --- a/perception/multi_object_tracker/src/tracker/motion_model/motion_model_base.cpp +++ b/perception/multi_object_tracker/lib/tracker/motion_model/motion_model_base.cpp @@ -16,7 +16,10 @@ // Author: v1.0 Taekjin Lee // -#include "multi_object_tracker/tracker/motion_model/motion_model_base.hpp" +#include "autoware/multi_object_tracker/tracker/motion_model/motion_model_base.hpp" + +namespace autoware::multi_object_tracker +{ MotionModel::MotionModel() : last_update_time_(rclcpp::Time(0, 0)) { @@ -90,3 +93,5 @@ bool MotionModel::getPredictedState( tmp_ekf_for_no_update.getP(P); return true; } + +} // namespace autoware::multi_object_tracker diff --git a/perception/multi_object_tracker/src/debugger/debug_object.cpp b/perception/multi_object_tracker/src/debugger/debug_object.cpp index fe6d3d5c75564..58b7dfc5cef48 100644 --- a/perception/multi_object_tracker/src/debugger/debug_object.cpp +++ b/perception/multi_object_tracker/src/debugger/debug_object.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "multi_object_tracker/debugger/debug_object.hpp" +#include "debug_object.hpp" #include "autoware_perception_msgs/msg/tracked_object.hpp" @@ -48,6 +48,9 @@ int32_t uuidToInt(const boost::uuids::uuid & uuid) } } // namespace +namespace autoware::multi_object_tracker +{ + TrackerObjectDebugger::TrackerObjectDebugger(std::string frame_id) { // set frame id @@ -79,7 +82,7 @@ void TrackerObjectDebugger::collect( const std::unordered_map & direct_assignment, const std::unordered_map & /*reverse_assignment*/) { - if (!is_initialized_) is_initialized_ = true; + is_initialized_ = true; message_time_ = message_time; @@ -391,3 +394,5 @@ void TrackerObjectDebugger::getMessage(visualization_msgs::msg::MarkerArray & ma return; } + +} // namespace autoware::multi_object_tracker diff --git a/perception/multi_object_tracker/include/multi_object_tracker/debugger/debug_object.hpp b/perception/multi_object_tracker/src/debugger/debug_object.hpp similarity index 91% rename from perception/multi_object_tracker/include/multi_object_tracker/debugger/debug_object.hpp rename to perception/multi_object_tracker/src/debugger/debug_object.hpp index 08c9eb975d8e6..ed4c556959861 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/debugger/debug_object.hpp +++ b/perception/multi_object_tracker/src/debugger/debug_object.hpp @@ -12,11 +12,11 @@ // 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_ +#ifndef DEBUGGER__DEBUG_OBJECT_HPP_ +#define DEBUGGER__DEBUG_OBJECT_HPP_ +#include "autoware/multi_object_tracker/tracker/model/tracker_base.hpp" #include "autoware/universe_utils/ros/uuid_helper.hpp" -#include "multi_object_tracker/tracker/model/tracker_base.hpp" #include @@ -37,6 +37,9 @@ #include #include +namespace autoware::multi_object_tracker +{ + struct ObjectData { rclcpp::Time time; @@ -99,4 +102,6 @@ class TrackerObjectDebugger void getMessage(visualization_msgs::msg::MarkerArray & marker_array) const; }; -#endif // MULTI_OBJECT_TRACKER__DEBUGGER__DEBUG_OBJECT_HPP_ +} // namespace autoware::multi_object_tracker + +#endif // DEBUGGER__DEBUG_OBJECT_HPP_ diff --git a/perception/multi_object_tracker/src/debugger/debugger.cpp b/perception/multi_object_tracker/src/debugger/debugger.cpp index e692ae76468e4..3e47bbe9bed8d 100644 --- a/perception/multi_object_tracker/src/debugger/debugger.cpp +++ b/perception/multi_object_tracker/src/debugger/debugger.cpp @@ -12,10 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "multi_object_tracker/debugger/debugger.hpp" +#include "debugger.hpp" #include +namespace autoware::multi_object_tracker +{ TrackerDebugger::TrackerDebugger(rclcpp::Node & node, const std::string & frame_id) : node_(node), diagnostic_updater_(&node), object_debugger_(frame_id) { @@ -207,3 +209,5 @@ void TrackerDebugger::publishObjectsMarkers() // reset object data object_debugger_.reset(); } + +} // namespace autoware::multi_object_tracker diff --git a/perception/multi_object_tracker/include/multi_object_tracker/debugger/debugger.hpp b/perception/multi_object_tracker/src/debugger/debugger.hpp similarity index 94% rename from perception/multi_object_tracker/include/multi_object_tracker/debugger/debugger.hpp rename to perception/multi_object_tracker/src/debugger/debugger.hpp index a1c516147b220..77618e1882be7 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/debugger/debugger.hpp +++ b/perception/multi_object_tracker/src/debugger/debugger.hpp @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef MULTI_OBJECT_TRACKER__DEBUGGER__DEBUGGER_HPP_ -#define MULTI_OBJECT_TRACKER__DEBUGGER__DEBUGGER_HPP_ +#ifndef DEBUGGER__DEBUGGER_HPP_ +#define DEBUGGER__DEBUGGER_HPP_ #include "autoware/universe_utils/ros/debug_publisher.hpp" #include "autoware/universe_utils/ros/published_time_publisher.hpp" -#include "multi_object_tracker/debugger/debug_object.hpp" +#include "debug_object.hpp" #include #include @@ -33,6 +33,9 @@ #include #include +namespace autoware::multi_object_tracker +{ + /** * @brief Debugger class for multi object tracker * @details This class is used to publish debug information of multi object tracker @@ -104,4 +107,6 @@ class TrackerDebugger void publishObjectsMarkers(); }; -#endif // MULTI_OBJECT_TRACKER__DEBUGGER__DEBUGGER_HPP_ +} // namespace autoware::multi_object_tracker + +#endif // DEBUGGER__DEBUGGER_HPP_ diff --git a/perception/multi_object_tracker/src/multi_object_tracker_core.cpp b/perception/multi_object_tracker/src/multi_object_tracker_node.cpp similarity index 96% rename from perception/multi_object_tracker/src/multi_object_tracker_core.cpp rename to perception/multi_object_tracker/src/multi_object_tracker_node.cpp index 97c3d93d191b2..d3e1c9686b69b 100644 --- a/perception/multi_object_tracker/src/multi_object_tracker_core.cpp +++ b/perception/multi_object_tracker/src/multi_object_tracker_node.cpp @@ -15,13 +15,12 @@ // #define EIGEN_MPL2_ONLY -#include "multi_object_tracker/multi_object_tracker_core.hpp" +#include "multi_object_tracker_node.hpp" -#include "multi_object_tracker/utils/utils.hpp" +#include "autoware/multi_object_tracker/utils/utils.hpp" #include #include -#include #include @@ -66,7 +65,7 @@ boost::optional getTransformAnonymous( } // namespace -namespace multi_object_tracker +namespace autoware::multi_object_tracker { using Label = autoware_perception_msgs::msg::ObjectClassification; @@ -192,7 +191,7 @@ MultiObjectTracker::MultiObjectTracker(const rclcpp::NodeOptions & node_options) const auto max_rad_matrix = this->declare_parameter>("max_rad_matrix"); const auto min_iou_matrix = this->declare_parameter>("min_iou_matrix"); - data_association_ = std::make_unique( + association_ = std::make_unique( can_assign_matrix, max_dist_matrix, max_area_matrix, min_area_matrix, max_rad_matrix, min_iou_matrix); } @@ -295,9 +294,9 @@ void MultiObjectTracker::runProcess( const auto & list_tracker = processor_->getListTracker(); const auto & detected_objects = transformed_objects; // global nearest neighbor - Eigen::MatrixXd score_matrix = data_association_->calcScoreMatrix( + Eigen::MatrixXd score_matrix = association_->calcScoreMatrix( detected_objects, list_tracker); // row : tracker, col : measurement - data_association_->assign(score_matrix, direct_assignment, reverse_assignment); + association_->assign(score_matrix, direct_assignment, reverse_assignment); // Collect debug information - tracker list, existence probabilities, association results debugger_->collectObjectInfo( @@ -358,6 +357,8 @@ void MultiObjectTracker::publish(const rclcpp::Time & time) const debugger_->publishObjectsMarkers(); } -} // namespace multi_object_tracker +} // namespace autoware::multi_object_tracker + +#include -RCLCPP_COMPONENTS_REGISTER_NODE(multi_object_tracker::MultiObjectTracker) +RCLCPP_COMPONENTS_REGISTER_NODE(autoware::multi_object_tracker::MultiObjectTracker) diff --git a/perception/multi_object_tracker/include/multi_object_tracker/multi_object_tracker_core.hpp b/perception/multi_object_tracker/src/multi_object_tracker_node.hpp similarity index 82% rename from perception/multi_object_tracker/include/multi_object_tracker/multi_object_tracker_core.hpp rename to perception/multi_object_tracker/src/multi_object_tracker_node.hpp index aff3cbd00eabe..db5eaaa88ca8c 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/multi_object_tracker_core.hpp +++ b/perception/multi_object_tracker/src/multi_object_tracker_node.hpp @@ -16,14 +16,14 @@ // Author: v1.0 Yukihiro Saito /// -#ifndef MULTI_OBJECT_TRACKER__MULTI_OBJECT_TRACKER_CORE_HPP_ -#define MULTI_OBJECT_TRACKER__MULTI_OBJECT_TRACKER_CORE_HPP_ +#ifndef MULTI_OBJECT_TRACKER_NODE_HPP_ +#define MULTI_OBJECT_TRACKER_NODE_HPP_ -#include "multi_object_tracker/data_association/data_association.hpp" -#include "multi_object_tracker/debugger/debugger.hpp" -#include "multi_object_tracker/processor/input_manager.hpp" -#include "multi_object_tracker/processor/processor.hpp" -#include "multi_object_tracker/tracker/model/tracker_base.hpp" +#include "autoware/multi_object_tracker/association/association.hpp" +#include "autoware/multi_object_tracker/tracker/model/tracker_base.hpp" +#include "debugger/debugger.hpp" +#include "processor/input_manager.hpp" +#include "processor/processor.hpp" #include @@ -52,7 +52,7 @@ #include #include -namespace multi_object_tracker +namespace autoware::multi_object_tracker { using DetectedObject = autoware_perception_msgs::msg::DetectedObject; @@ -82,7 +82,7 @@ class MultiObjectTracker : public rclcpp::Node // internal states std::string world_frame_id_; // tracking frame - std::unique_ptr data_association_; + std::unique_ptr association_; std::unique_ptr processor_; // input manager @@ -103,6 +103,6 @@ class MultiObjectTracker : public rclcpp::Node inline bool shouldTrackerPublish(const std::shared_ptr tracker) const; }; -} // namespace multi_object_tracker +} // namespace autoware::multi_object_tracker -#endif // MULTI_OBJECT_TRACKER__MULTI_OBJECT_TRACKER_CORE_HPP_ +#endif // MULTI_OBJECT_TRACKER_NODE_HPP_ diff --git a/perception/multi_object_tracker/src/processor/input_manager.cpp b/perception/multi_object_tracker/src/processor/input_manager.cpp index bee76e6c05940..5172cc5062450 100644 --- a/perception/multi_object_tracker/src/processor/input_manager.cpp +++ b/perception/multi_object_tracker/src/processor/input_manager.cpp @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "multi_object_tracker/processor/input_manager.hpp" +#include "input_manager.hpp" #include -namespace multi_object_tracker +namespace autoware::multi_object_tracker { /////////////////////////// /////// InputStream /////// @@ -62,7 +62,7 @@ void InputStream::onMessage( { const DetectedObjects objects = *msg; objects_que_.push_back(objects); - if (objects_que_.size() > que_size_) { + while (objects_que_.size() > que_size_) { objects_que_.pop_front(); } @@ -160,21 +160,27 @@ void InputStream::getObjectsOlderThan( return; } - for (const auto & object : objects_que_) { - const rclcpp::Time object_time = rclcpp::Time(object.header.stamp); - - // remove objects older than the specified duration + for (const auto & objects : objects_que_) { + const rclcpp::Time object_time = rclcpp::Time(objects.header.stamp); + // ignore objects older than the specified duration if (object_time < object_oldest_time) { - objects_que_.pop_front(); continue; } // Add the object if the object is older than the specified latest time - if (object_latest_time >= object_time) { - std::pair object_pair(index_, object); - objects_list.push_back(object_pair); - // remove the object from the queue + if (object_time <= object_latest_time) { + std::pair objects_pair(index_, objects); + objects_list.push_back(objects_pair); + } + } + + // remove objects older than 'object_latest_time' + while (!objects_que_.empty()) { + const rclcpp::Time object_time = rclcpp::Time(objects_que_.front().header.stamp); + if (object_time < object_latest_time) { objects_que_.pop_front(); + } else { + break; } } } @@ -368,4 +374,4 @@ bool InputManager::getObjects(const rclcpp::Time & now, ObjectsList & objects_li return is_any_object; } -} // namespace multi_object_tracker +} // namespace autoware::multi_object_tracker diff --git a/perception/multi_object_tracker/include/multi_object_tracker/processor/input_manager.hpp b/perception/multi_object_tracker/src/processor/input_manager.hpp similarity index 95% rename from perception/multi_object_tracker/include/multi_object_tracker/processor/input_manager.hpp rename to perception/multi_object_tracker/src/processor/input_manager.hpp index 29b0c18ae766f..432a4105d815f 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/processor/input_manager.hpp +++ b/perception/multi_object_tracker/src/processor/input_manager.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef MULTI_OBJECT_TRACKER__PROCESSOR__INPUT_MANAGER_HPP_ -#define MULTI_OBJECT_TRACKER__PROCESSOR__INPUT_MANAGER_HPP_ +#ifndef PROCESSOR__INPUT_MANAGER_HPP_ +#define PROCESSOR__INPUT_MANAGER_HPP_ #include "rclcpp/rclcpp.hpp" @@ -26,7 +26,7 @@ #include #include -namespace multi_object_tracker +namespace autoware::multi_object_tracker { using DetectedObjects = autoware_perception_msgs::msg::DetectedObjects; using ObjectsList = std::vector>; @@ -155,6 +155,6 @@ class InputManager void optimizeTimings(); }; -} // namespace multi_object_tracker +} // namespace autoware::multi_object_tracker -#endif // MULTI_OBJECT_TRACKER__PROCESSOR__INPUT_MANAGER_HPP_ +#endif // PROCESSOR__INPUT_MANAGER_HPP_ diff --git a/perception/multi_object_tracker/src/processor/processor.cpp b/perception/multi_object_tracker/src/processor/processor.cpp index 50d1a021c5838..17871c89b5258 100644 --- a/perception/multi_object_tracker/src/processor/processor.cpp +++ b/perception/multi_object_tracker/src/processor/processor.cpp @@ -12,15 +12,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "multi_object_tracker/processor/processor.hpp" +#include "processor.hpp" -#include "multi_object_tracker/tracker/tracker.hpp" +#include "autoware/multi_object_tracker/tracker/tracker.hpp" #include "object_recognition_utils/object_recognition_utils.hpp" #include "autoware_perception_msgs/msg/tracked_objects.hpp" #include +namespace autoware::multi_object_tracker +{ + using Label = autoware_perception_msgs::msg::ObjectClassification; TrackerProcessor::TrackerProcessor( @@ -248,3 +251,5 @@ void TrackerProcessor::getTentativeObjects( } } } + +} // namespace autoware::multi_object_tracker diff --git a/perception/multi_object_tracker/include/multi_object_tracker/processor/processor.hpp b/perception/multi_object_tracker/src/processor/processor.hpp similarity index 91% rename from perception/multi_object_tracker/include/multi_object_tracker/processor/processor.hpp rename to perception/multi_object_tracker/src/processor/processor.hpp index 6d0dbcd036e53..5eac113b3974c 100644 --- a/perception/multi_object_tracker/include/multi_object_tracker/processor/processor.hpp +++ b/perception/multi_object_tracker/src/processor/processor.hpp @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef MULTI_OBJECT_TRACKER__PROCESSOR__PROCESSOR_HPP_ -#define MULTI_OBJECT_TRACKER__PROCESSOR__PROCESSOR_HPP_ +#ifndef PROCESSOR__PROCESSOR_HPP_ +#define PROCESSOR__PROCESSOR_HPP_ -#include "multi_object_tracker/tracker/model/tracker_base.hpp" +#include "autoware/multi_object_tracker/tracker/model/tracker_base.hpp" #include @@ -29,6 +29,8 @@ #include #include +namespace autoware::multi_object_tracker +{ class TrackerProcessor { public: @@ -78,4 +80,6 @@ class TrackerProcessor const geometry_msgs::msg::Transform & self_transform, const uint & channel_index) const; }; -#endif // MULTI_OBJECT_TRACKER__PROCESSOR__PROCESSOR_HPP_ +} // namespace autoware::multi_object_tracker + +#endif // PROCESSOR__PROCESSOR_HPP_