Skip to content

Commit

Permalink
refactor(multi_object_tracker)!: fix namespace and directory structure (
Browse files Browse the repository at this point in the history
autowarefoundation#7863)

* refactor: update include paths for debugger and processor modules

Signed-off-by: Taekjin LEE <[email protected]>

* refactor: update include paths for debugger and processor modules

Signed-off-by: Taekjin LEE <[email protected]>

* refactor: move include files into 'autoware'

Signed-off-by: Taekjin LEE <[email protected]>

* refactor: set namespace

Signed-off-by: Taekjin LEE <[email protected]>

* refactor: refine logics to pass cppcheck

Signed-off-by: Taekjin LEE <[email protected]>

---------

Signed-off-by: Taekjin LEE <[email protected]>
  • Loading branch information
technolojin authored Jul 8, 2024
1 parent deef7c4 commit 094f2e2
Show file tree
Hide file tree
Showing 48 changed files with 398 additions and 204 deletions.
44 changes: 23 additions & 21 deletions perception/multi_object_tracker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Eigen/Core>
#include <Eigen/Geometry>
Expand All @@ -34,6 +34,8 @@
#include <unordered_map>
#include <vector>

namespace autoware::multi_object_tracker
{
class DataAssociation
{
private:
Expand Down Expand Up @@ -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_
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Original file line number Diff line number Diff line change
Expand Up @@ -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 <unordered_map>
#include <vector>

namespace autoware::multi_object_tracker
{
namespace gnn_solver
{
class GnnSolverInterface
Expand All @@ -30,6 +32,8 @@ class GnnSolverInterface
const std::vector<std::vector<double>> & cost, std::unordered_map<int, int> * direct_assignment,
std::unordered_map<int, int> * 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_
Original file line number Diff line number Diff line change
Expand Up @@ -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 <unordered_map>
#include <vector>

namespace autoware::multi_object_tracker
{
namespace gnn_solver
{
class MuSSP : public GnnSolverInterface
Expand All @@ -32,6 +34,8 @@ class MuSSP : public GnnSolverInterface
const std::vector<std::vector<double>> & cost, std::unordered_map<int, int> * direct_assignment,
std::unordered_map<int, int> * 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_
Original file line number Diff line number Diff line change
Expand Up @@ -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 <unordered_map>
#include <vector>

namespace autoware::multi_object_tracker
{
namespace gnn_solver
{
class SSP : public GnnSolverInterface
Expand All @@ -32,6 +34,8 @@ class SSP : public GnnSolverInterface
const std::vector<std::vector<double>> & cost, std::unordered_map<int, int> * direct_assignment,
std::unordered_map<int, int> * 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_
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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_
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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_
Original file line number Diff line number Diff line change
Expand Up @@ -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 <rclcpp/time.hpp>

namespace autoware::multi_object_tracker
{

class MultipleVehicleTracker : public Tracker
{
private:
Expand All @@ -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_
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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_
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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_
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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_
Loading

0 comments on commit 094f2e2

Please sign in to comment.