forked from autowarefoundation/autoware.universe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(radar_object_tracker): tune radar object tracker node for untrus…
…table radar input (autowarefoundation#5409) * fix include file Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com> * switchable trust/untrust input yaw and twist information via parameters Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com> * Set measurement count threshold tunable Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com> * enable to switch off acceleration estimation Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com> * add constant turn rate tracker model Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com> * tune default parameters Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com> * set orientation unreliable when object is yaw input is not trusted Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com> * set ekf parameter to static so that it reduces yaml loading function calls Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com> * fix launch file to load tracking_config_directory as arguments Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com> * update readme Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com> --------- Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com>
- Loading branch information
Showing
15 changed files
with
931 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
perception/radar_object_tracker/config/default_tracker.param.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
/**: | ||
ros__parameters: | ||
car_tracker: "linear_motion_tracker" | ||
truck_tracker: "linear_motion_tracker" | ||
bus_tracker: "linear_motion_tracker" | ||
trailer_tracker: "linear_motion_tracker" | ||
pedestrian_tracker: "linear_motion_tracker" | ||
bicycle_tracker: "linear_motion_tracker" | ||
motorcycle_tracker: "linear_motion_tracker" | ||
car_tracker: "constant_turn_rate_motion_tracker" | ||
truck_tracker: "constant_turn_rate_motion_tracker" | ||
bus_tracker: "constant_turn_rate_motion_tracker" | ||
trailer_tracker: "constant_turn_rate_motion_tracker" | ||
pedestrian_tracker: "constant_turn_rate_motion_tracker" | ||
bicycle_tracker: "constant_turn_rate_motion_tracker" | ||
motorcycle_tracker: "constant_turn_rate_motion_tracker" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
perception/radar_object_tracker/config/tracking/constant_turn_rate_motion_tracker.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
default: | ||
# This file defines the parameters for the linear motion tracker. | ||
# All this parameter coordinate is assumed to be in the vehicle coordinate system. | ||
# So, the x axis is pointing to the front of the vehicle, y axis is pointing to the left of the vehicle. | ||
ekf_params: | ||
# random walk noise is used to model the acceleration noise | ||
process_noise_std: # [m/s^2] | ||
x: 0.5 | ||
y: 0.5 | ||
yaw: 0.1 | ||
vx: 1.0 # assume 1m/s velocity noise | ||
wz: 0.4 | ||
measurement_noise_std: | ||
x: 4.0 # [m] | ||
y: 4.0 # [m] | ||
# y: 0.02 # rad/m if use_polar_coordinate_in_measurement_noise is true | ||
yaw: 0.2 # [rad] | ||
vx: 10 # [m/s] | ||
initial_covariance_std: | ||
x: 3.0 # [m] | ||
y: 6.0 # [m] | ||
yaw: 10.0 # [rad] | ||
vx: 100.0 # [m/s] | ||
wz: 10.0 # [rad/s] | ||
# input flag | ||
trust_yaw_input: false # set true if yaw input of sensor is reliable | ||
trust_twist_input: false # set true if twist input of sensor is reliable | ||
use_polar_coordinate_in_measurement_noise: false # set true if you want to define the measurement noise in polar coordinate | ||
assume_zero_yaw_rate: false # set true if you want to assume zero yaw rate | ||
# output limitation | ||
limit: | ||
max_speed: 80.0 # [m/s] | ||
# low pass filter is used to smooth the yaw and shape estimation | ||
low_pass_filter: | ||
time_constant: 1.0 # [s] | ||
sampling_time: 0.1 # [s] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 112 additions & 0 deletions
112
..._tracker/include/radar_object_tracker/tracker/model/constant_turn_rate_motion_tracker.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
// Copyright 2020 Tier IV, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef RADAR_OBJECT_TRACKER__TRACKER__MODEL__CONSTANT_TURN_RATE_MOTION_TRACKER_HPP_ | ||
#define RADAR_OBJECT_TRACKER__TRACKER__MODEL__CONSTANT_TURN_RATE_MOTION_TRACKER_HPP_ | ||
|
||
#include "radar_object_tracker/tracker/model/tracker_base.hpp" | ||
|
||
#include <kalman_filter/kalman_filter.hpp> | ||
|
||
#include <string> | ||
|
||
using Label = autoware_auto_perception_msgs::msg::ObjectClassification; | ||
class ConstantTurnRateMotionTracker : public Tracker // means constant turn rate motion tracker | ||
{ | ||
private: | ||
autoware_auto_perception_msgs::msg::DetectedObject object_; | ||
rclcpp::Logger logger_; | ||
|
||
private: | ||
KalmanFilter ekf_; | ||
rclcpp::Time last_update_time_; | ||
enum IDX { X = 0, Y = 1, YAW = 2, VX = 3, WZ = 4 }; | ||
|
||
struct EkfParams | ||
{ | ||
// dimension | ||
char dim_x = 5; | ||
// system noise | ||
double q_cov_x; | ||
double q_cov_y; | ||
double q_cov_yaw; | ||
double q_cov_vx; | ||
double q_cov_wz; | ||
// measurement noise | ||
double r_cov_x; | ||
double r_cov_y; | ||
double r_cov_yaw; | ||
double r_cov_vx; | ||
// initial state covariance | ||
double p0_cov_x; | ||
double p0_cov_y; | ||
double p0_cov_yaw; | ||
double p0_cov_vx; | ||
double p0_cov_wz; | ||
}; | ||
static EkfParams ekf_params_; | ||
|
||
// limitation | ||
static double max_vx_; | ||
// rough tracking parameters | ||
float z_; | ||
|
||
// lpf parameter | ||
static double filter_tau_; // time constant of 1st order low pass filter | ||
static double filter_dt_; // sampling time of 1st order low pass filter | ||
|
||
// static flags | ||
static bool is_initialized_; | ||
static bool trust_yaw_input_; | ||
static bool trust_twist_input_; | ||
static bool use_polar_coordinate_in_measurement_noise_; | ||
static bool assume_zero_yaw_rate_; | ||
|
||
private: | ||
struct BoundingBox | ||
{ | ||
double length; | ||
double width; | ||
double height; | ||
}; | ||
struct Cylinder | ||
{ | ||
double width; | ||
double height; | ||
}; | ||
BoundingBox bounding_box_; | ||
Cylinder cylinder_; | ||
|
||
public: | ||
ConstantTurnRateMotionTracker( | ||
const rclcpp::Time & time, const autoware_auto_perception_msgs::msg::DetectedObject & object, | ||
const std::string & tracker_param_file, const std::uint8_t & label); | ||
|
||
static void loadDefaultModelParameters(const std::string & path); | ||
bool predict(const rclcpp::Time & time) override; | ||
bool predict(const double dt, KalmanFilter & ekf) const; | ||
bool measure( | ||
const autoware_auto_perception_msgs::msg::DetectedObject & object, const rclcpp::Time & time, | ||
const geometry_msgs::msg::Transform & self_transform) override; | ||
bool measureWithPose( | ||
const autoware_auto_perception_msgs::msg::DetectedObject & object, | ||
const geometry_msgs::msg::Transform & self_transform); | ||
bool measureWithShape(const autoware_auto_perception_msgs::msg::DetectedObject & object); | ||
bool getTrackedObject( | ||
const rclcpp::Time & time, | ||
autoware_auto_perception_msgs::msg::TrackedObject & object) const override; | ||
virtual ~ConstantTurnRateMotionTracker() {} | ||
}; | ||
|
||
#endif // RADAR_OBJECT_TRACKER__TRACKER__MODEL__CONSTANT_TURN_RATE_MOTION_TRACKER_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.