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(pose_initializer): check error initial pose and gnss pose, outpu…
…t diagnostics (autowarefoundation#8947) * check initial pose error use GNSS pose Signed-off-by: RyuYamamoto <ryu.yamamoto@tier4.jp> * add pose_error_check_enabled parameter Signed-off-by: RyuYamamoto <ryu.yamamoto@tier4.jp> * fixed key value name Signed-off-by: RyuYamamoto <ryu.yamamoto@tier4.jp> * rename diagnostics key value Signed-off-by: RyuYamamoto <ryu.yamamoto@tier4.jp> * update README Signed-off-by: RyuYamamoto <ryu.yamamoto@tier4.jp> * fixed schema json Signed-off-by: RyuYamamoto <ryu.yamamoto@tier4.jp> * fixed type and default in schema json Signed-off-by: RyuYamamoto <ryu.yamamoto@tier4.jp> * rename key value Signed-off-by: RyuYamamoto <ryu.yamamoto@tier4.jp> --------- Signed-off-by: RyuYamamoto <ryu.yamamoto@tier4.jp>
- Loading branch information
1 parent
efc87e3
commit f0b43d6
Showing
9 changed files
with
120 additions
and
1 deletion.
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
Binary file modified
BIN
+7.77 KB
(150%)
localization/autoware_pose_initializer/media/diagnostic_pose_reliability.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
40 changes: 40 additions & 0 deletions
40
localization/autoware_pose_initializer/src/pose_error_check_module.cpp
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,40 @@ | ||
// Copyright 2022 The Autoware Contributors | ||
// | ||
// 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. | ||
|
||
#include "pose_error_check_module.hpp" | ||
|
||
namespace autoware::pose_initializer | ||
{ | ||
PoseErrorCheckModule::PoseErrorCheckModule(rclcpp::Node * node) : node_(node) | ||
{ | ||
pose_error_threshold_ = node_->declare_parameter<double>("pose_error_threshold"); | ||
} | ||
|
||
bool PoseErrorCheckModule::check_pose_error( | ||
const geometry_msgs::msg::Pose & reference_pose, const geometry_msgs::msg::Pose & result_pose, | ||
double & error_2d) | ||
{ | ||
const double diff_pose_x = reference_pose.position.x - result_pose.position.x; | ||
const double diff_pose_y = reference_pose.position.y - result_pose.position.y; | ||
error_2d = std::sqrt(std::pow(diff_pose_x, 2) + std::pow(diff_pose_y, 2)); | ||
|
||
if (pose_error_threshold_ <= error_2d) { | ||
RCLCPP_INFO(node_->get_logger(), "Pose Error is Large. Error is %f", error_2d); | ||
return false; | ||
} | ||
|
||
return true; | ||
} | ||
|
||
} // namespace autoware::pose_initializer |
38 changes: 38 additions & 0 deletions
38
localization/autoware_pose_initializer/src/pose_error_check_module.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,38 @@ | ||
// Copyright 2024 The Autoware Contributors | ||
// | ||
// 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 POSE_ERROR_CHECK_MODULE_HPP_ | ||
#define POSE_ERROR_CHECK_MODULE_HPP_ | ||
|
||
#include <rclcpp/rclcpp.hpp> | ||
|
||
#include <geometry_msgs/msg/pose.hpp> | ||
|
||
namespace autoware::pose_initializer | ||
{ | ||
class PoseErrorCheckModule | ||
{ | ||
public: | ||
explicit PoseErrorCheckModule(rclcpp::Node * node); | ||
bool check_pose_error( | ||
const geometry_msgs::msg::Pose & reference_pose, const geometry_msgs::msg::Pose & result_pose, | ||
double & error_2d); | ||
|
||
private: | ||
rclcpp::Node * node_; | ||
double pose_error_threshold_; | ||
}; | ||
} // namespace autoware::pose_initializer | ||
|
||
#endif // POSE_ERROR_CHECK_MODULE_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