Skip to content

Commit

Permalink
refactor(kalman_fiilter): prefix package and namespace with autoware
Browse files Browse the repository at this point in the history
Signed-off-by: Esteve Fernandez <[email protected]>
  • Loading branch information
esteve committed Jul 2, 2024
1 parent ce09907 commit b894b4b
Show file tree
Hide file tree
Showing 29 changed files with 59 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.14)
project(kalman_filter)
project(autoware_kalman_filter)

find_package(autoware_cmake REQUIRED)
autoware_package()
Expand All @@ -12,18 +12,18 @@ include_directories(
${EIGEN3_INCLUDE_DIR}
)

ament_auto_add_library(kalman_filter SHARED
ament_auto_add_library(${PROJECT_NAME} SHARED
src/kalman_filter.cpp
src/time_delay_kalman_filter.cpp
include/kalman_filter/kalman_filter.hpp
include/kalman_filter/time_delay_kalman_filter.hpp
include/${PROJECT_NAME}/kalman_filter.hpp
include/${PROJECT_NAME}/time_delay_kalman_filter.hpp
)

if(BUILD_TESTING)
file(GLOB_RECURSE test_files test/*.cpp)
ament_add_ros_isolated_gtest(test_kalman_filter ${test_files})
ament_add_ros_isolated_gtest(test_${PROJECT_NAME} ${test_files})

target_link_libraries(test_kalman_filter kalman_filter)
target_link_libraries(test_${PROJECT_NAME} ${PROJECT_NAME})
endif()

ament_auto_package()
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
#include <Eigen/Core>
#include <Eigen/LU>

namespace autoware::kalman_filter
{

/**
* @file kalman_filter.h
* @brief kalman filter class
Expand Down Expand Up @@ -207,4 +210,5 @@ class KalmanFilter
Eigen::MatrixXd R_; //!< @brief covariance matrix for measurement model y[k] = C * x[k]
Eigen::MatrixXd P_; //!< @brief covariance of estimated state
};
} // namespace autoware::kalman_filter
#endif // KALMAN_FILTER__KALMAN_FILTER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
#ifndef KALMAN_FILTER__TIME_DELAY_KALMAN_FILTER_HPP_
#define KALMAN_FILTER__TIME_DELAY_KALMAN_FILTER_HPP_

#include "kalman_filter/kalman_filter.hpp"
#include "autoware_kalman_filter/kalman_filter.hpp"

#include <Eigen/Core>
#include <Eigen/LU>

#include <iostream>

namespace autoware::kalman_filter
{
/**
* @file time_delay_kalman_filter.h
* @brief kalman filter with delayed measurement class
Expand Down Expand Up @@ -83,4 +85,5 @@ class TimeDelayKalmanFilter : public KalmanFilter
int dim_x_; //!< @brief dimension of latest state
int dim_x_ex_; //!< @brief dimension of extended state with dime delay
};
} // namespace autoware::kalman_filter
#endif // KALMAN_FILTER__TIME_DELAY_KALMAN_FILTER_HPP_
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>kalman_filter</name>
<name>autoware_kalman_filter</name>
<version>0.1.0</version>
<description>The kalman filter package</description>
<maintainer email="[email protected]">Yukihiro Saito</maintainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "kalman_filter/kalman_filter.hpp"
#include "autoware_kalman_filter/kalman_filter.hpp"

namespace autoware::kalman_filter
{
KalmanFilter::KalmanFilter()
{
}
Expand Down Expand Up @@ -156,3 +158,4 @@ bool KalmanFilter::update(const Eigen::MatrixXd & y)
{
return update(y, C_, R_);
}
} // namespace autoware::kalman_filter
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "kalman_filter/time_delay_kalman_filter.hpp"
#include "autoware_kalman_filter/time_delay_kalman_filter.hpp"

namespace autoware::kalman_filter
{
TimeDelayKalmanFilter::TimeDelayKalmanFilter()
{
}
Expand Down Expand Up @@ -102,3 +104,4 @@ bool TimeDelayKalmanFilter::updateWithDelay(

return true;
}
} // namespace autoware::kalman_filter
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "kalman_filter/kalman_filter.hpp"
#include "autoware_kalman_filter/kalman_filter.hpp"

#include <gtest/gtest.h>

using autoware::kalman_filter::KalmanFilter;

TEST(kalman_filter, kf)
{
KalmanFilter kf_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "kalman_filter/time_delay_kalman_filter.hpp"
#include "autoware_kalman_filter/time_delay_kalman_filter.hpp"

#include <gtest/gtest.h>

using autoware::kalman_filter::TimeDelayKalmanFilter;

TEST(time_delay_kalman_filter, td_kf)
{
TimeDelayKalmanFilter td_kf_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
#include "ekf_localizer/state_index.hpp"
#include "ekf_localizer/warning.hpp"

#include <kalman_filter/kalman_filter.hpp>
#include <kalman_filter/time_delay_kalman_filter.hpp>
#include <autoware_kalman_filter/kalman_filter.hpp>
#include <autoware_kalman_filter/time_delay_kalman_filter.hpp>
#include <rclcpp/rclcpp.hpp>

#include <geometry_msgs/msg/pose_stamped.hpp>
Expand All @@ -32,6 +32,8 @@
#include <memory>
#include <vector>

using autoware::kalman_filter::TimeDelayKalmanFilter;

struct EKFDiagnosticInfo
{
size_t no_update_count{0};
Expand Down
2 changes: 1 addition & 1 deletion localization/ekf_localizer/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<depend>diagnostic_msgs</depend>
<depend>fmt</depend>
<depend>geometry_msgs</depend>
<depend>kalman_filter</depend>
<depend>autoware_kalman_filter</depend>
<depend>localization_util</depend>
<depend>nav_msgs</depend>
<depend>rclcpp</depend>
Expand Down
5 changes: 3 additions & 2 deletions perception/bytetrack/lib/include/strack.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@

#pragma once

// #include "kalman_filter.h"
#include <kalman_filter/kalman_filter.hpp>
#include <autoware_kalman_filter/kalman_filter.hpp>
#include <opencv2/opencv.hpp>

#include <boost/uuid/uuid.hpp>
Expand All @@ -49,6 +48,8 @@

enum TrackState { New = 0, Tracked, Lost, Removed };

using autoware::kalman_filter::KalmanFilter;

/** manage one tracklet*/
class STrack
{
Expand Down
2 changes: 1 addition & 1 deletion perception/bytetrack/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<depend>cv_bridge</depend>
<depend>eigen</depend>
<depend>image_transport</depend>
<depend>kalman_filter</depend>
<depend>autoware_kalman_filter</depend>
<depend>libboost-system-dev</depend>
<depend>libopencv-dev</depend>
<depend>rclcpp</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef MULTI_OBJECT_TRACKER__TRACKER__MODEL__BICYCLE_TRACKER_HPP_
#define MULTI_OBJECT_TRACKER__TRACKER__MODEL__BICYCLE_TRACKER_HPP_

#include "kalman_filter/kalman_filter.hpp"
#include "autoware_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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef MULTI_OBJECT_TRACKER__TRACKER__MODEL__BIG_VEHICLE_TRACKER_HPP_
#define MULTI_OBJECT_TRACKER__TRACKER__MODEL__BIG_VEHICLE_TRACKER_HPP_

#include "kalman_filter/kalman_filter.hpp"
#include "autoware_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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef MULTI_OBJECT_TRACKER__TRACKER__MODEL__MULTIPLE_VEHICLE_TRACKER_HPP_
#define MULTI_OBJECT_TRACKER__TRACKER__MODEL__MULTIPLE_VEHICLE_TRACKER_HPP_

#include "kalman_filter/kalman_filter.hpp"
#include "autoware_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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef MULTI_OBJECT_TRACKER__TRACKER__MODEL__NORMAL_VEHICLE_TRACKER_HPP_
#define MULTI_OBJECT_TRACKER__TRACKER__MODEL__NORMAL_VEHICLE_TRACKER_HPP_

#include "kalman_filter/kalman_filter.hpp"
#include "autoware_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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef MULTI_OBJECT_TRACKER__TRACKER__MODEL__PASS_THROUGH_TRACKER_HPP_
#define MULTI_OBJECT_TRACKER__TRACKER__MODEL__PASS_THROUGH_TRACKER_HPP_

#include "kalman_filter/kalman_filter.hpp"
#include "autoware_kalman_filter/kalman_filter.hpp"
#include "tracker_base.hpp"

class PassThroughTracker : public Tracker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef MULTI_OBJECT_TRACKER__TRACKER__MODEL__PEDESTRIAN_AND_BICYCLE_TRACKER_HPP_
#define MULTI_OBJECT_TRACKER__TRACKER__MODEL__PEDESTRIAN_AND_BICYCLE_TRACKER_HPP_

#include "kalman_filter/kalman_filter.hpp"
#include "autoware_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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef MULTI_OBJECT_TRACKER__TRACKER__MODEL__PEDESTRIAN_TRACKER_HPP_
#define MULTI_OBJECT_TRACKER__TRACKER__MODEL__PEDESTRIAN_TRACKER_HPP_

#include "kalman_filter/kalman_filter.hpp"
#include "autoware_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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef MULTI_OBJECT_TRACKER__TRACKER__MODEL__UNKNOWN_TRACKER_HPP_
#define MULTI_OBJECT_TRACKER__TRACKER__MODEL__UNKNOWN_TRACKER_HPP_

#include "kalman_filter/kalman_filter.hpp"
#include "autoware_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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__BICYCLE_MOTION_MODEL_HPP_
#define MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__BICYCLE_MOTION_MODEL_HPP_

#include "kalman_filter/kalman_filter.hpp"
#include "autoware_kalman_filter/kalman_filter.hpp"
#include "multi_object_tracker/tracker/motion_model/motion_model_base.hpp"

#include <Eigen/Core>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__CTRV_MOTION_MODEL_HPP_
#define MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__CTRV_MOTION_MODEL_HPP_

#include "kalman_filter/kalman_filter.hpp"
#include "autoware_kalman_filter/kalman_filter.hpp"
#include "multi_object_tracker/tracker/motion_model/motion_model_base.hpp"

#include <Eigen/Core>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__CV_MOTION_MODEL_HPP_
#define MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__CV_MOTION_MODEL_HPP_

#include "kalman_filter/kalman_filter.hpp"
#include "autoware_kalman_filter/kalman_filter.hpp"
#include "multi_object_tracker/tracker/motion_model/motion_model_base.hpp"

#include <Eigen/Core>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__MOTION_MODEL_BASE_HPP_
#define MULTI_OBJECT_TRACKER__TRACKER__MOTION_MODEL__MOTION_MODEL_BASE_HPP_

#include "kalman_filter/kalman_filter.hpp"
#include "autoware_kalman_filter/kalman_filter.hpp"

#include <Eigen/Core>
#include <rclcpp/rclcpp.hpp>
Expand All @@ -31,6 +31,8 @@
#endif
#include <geometry_msgs/msg/twist.hpp>

using autoware::kalman_filter::KalmanFilter;

class MotionModel
{
private:
Expand Down
2 changes: 1 addition & 1 deletion perception/multi_object_tracker/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<depend>diagnostic_updater</depend>
<depend>eigen</depend>
<depend>glog</depend>
<depend>kalman_filter</depend>
<depend>autoware_kalman_filter</depend>
<depend>mussp</depend>
<depend>object_recognition_utils</depend>
<depend>rclcpp</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
#define AUTOWARE_RADAR_OBJECT_TRACKER__TRACKER__MODEL__CONSTANT_TURN_RATE_MOTION_TRACKER_HPP_

#include "autoware_radar_object_tracker/tracker/model/tracker_base.hpp"
#include "kalman_filter/kalman_filter.hpp"
#include "autoware_kalman_filter/kalman_filter.hpp"

#include <string>
namespace autoware::radar_object_tracker
{
using Label = autoware_perception_msgs::msg::ObjectClassification;
using autoware::kalman_filter::KalmanFilter;
class ConstantTurnRateMotionTracker : public Tracker // means constant turn rate motion tracker
{
private:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@
#define AUTOWARE_RADAR_OBJECT_TRACKER__TRACKER__MODEL__LINEAR_MOTION_TRACKER_HPP_

#include "autoware_radar_object_tracker/tracker/model/tracker_base.hpp"
#include "kalman_filter/kalman_filter.hpp"
#include "autoware_kalman_filter/kalman_filter.hpp"

#include <string>

namespace autoware::radar_object_tracker
{

using Label = autoware_perception_msgs::msg::ObjectClassification;
using autoware::kalman_filter::KalmanFilter;

class LinearMotionTracker : public Tracker
{
private:
Expand Down
2 changes: 1 addition & 1 deletion perception/radar_object_tracker/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<depend>autoware_universe_utils</depend>
<depend>eigen</depend>
<depend>glog</depend>
<depend>kalman_filter</depend>
<depend>autoware_kalman_filter</depend>
<depend>mussp</depend>
<depend>nlohmann-json-dev</depend>
<depend>object_recognition_utils</depend>
Expand Down

0 comments on commit b894b4b

Please sign in to comment.