-
Notifications
You must be signed in to change notification settings - Fork 682
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(ndt_scan_matcher): refactor callbackSensorPoints (#1757)
* now works Signed-off-by: kminoda <koji.m.minoda@gmail.com> * ci(pre-commit): autofix * refactored alignUsingMonteCarlo Signed-off-by: kminoda <koji.m.minoda@gmail.com> * ci(pre-commit): autofix * output from screen to log Signed-off-by: kminoda <koji.m.minoda@gmail.com> * lowerCamelCase to snake_case Signed-off-by: kminoda <koji.m.minoda@gmail.com> * ci(pre-commit): autofix * remove iteration_num_max from NdtResult Signed-off-by: kminoda <koji.m.minoda@gmail.com> * minor fix Signed-off-by: kminoda <koji.m.minoda@gmail.com> * remove publish_scalars Signed-off-by: kminoda <koji.m.minoda@gmail.com> * ci(pre-commit): autofix * move publish_tf out from publish_pose Signed-off-by: kminoda <koji.m.minoda@gmail.com> * ci(pre-commit): autofix * simplified the function transform_sensor_points Signed-off-by: kminoda <koji.m.minoda@gmail.com> * ci(pre-commit): autofix * WIP pose_array_interpolator Signed-off-by: kminoda <koji.m.minoda@gmail.com> * added pose_array_interpolator class Signed-off-by: kminoda <koji.m.minoda@gmail.com> * ci(pre-commit): autofix * remove unnecessary code Signed-off-by: kminoda <koji.m.minoda@gmail.com> * removed std::pow(*, 2) Signed-off-by: kminoda <koji.m.minoda@gmail.com> * reflected comments Signed-off-by: kminoda <koji.m.minoda@gmail.com> * ci(pre-commit): autofix * minor fix in publish_point_cloud (seperated pcd transform and publish) Signed-off-by: kminoda <koji.m.minoda@gmail.com> * removed unnecessary commentout Signed-off-by: kminoda <koji.m.minoda@gmail.com> * ci(pre-commit): autofix * changed Eigen::Vector3f to Eigen::Vector3d Signed-off-by: kminoda <koji.m.minoda@gmail.com> * reverted No pose warning for initial pose Signed-off-by: kminoda <koji.minoda@tier4.jp> * from_HOGE_to_FUGA to HOGE_to_FUGA Signed-off-by: kminoda <koji.minoda@tier4.jp> * validate_* functions should not change member variables implicitely Signed-off-by: kminoda <koji.minoda@tier4.jp> * ci(pre-commit): autofix * removed member function that implicitely changes the member variables Signed-off-by: kminoda <koji.minoda@tier4.jp> * ci(pre-commit): autofix * remote 'ros' and 'eigen' prefix from utiility function name Signed-off-by: kminoda <koji.minoda@tier4.jp> * ci(pre-commit): autofix * debugged Signed-off-by: kminoda <koji.minoda@tier4.jp> * ci(pre-commit): autofix * added a name for each validation booleans Signed-off-by: kminoda <koji.m.minoda@gmail.com> * ci(pre-commit): autofix Signed-off-by: kminoda <koji.m.minoda@gmail.com> Signed-off-by: kminoda <koji.minoda@tier4.jp> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
248295e
commit 87f2322
Showing
9 changed files
with
572 additions
and
366 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
62 changes: 62 additions & 0 deletions
62
localization/ndt_scan_matcher/include/ndt_scan_matcher/pose_array_interpolator.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,62 @@ | ||
// Copyright 2015-2019 Autoware Foundation | ||
// | ||
// 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 NDT_SCAN_MATCHER__POSE_ARRAY_INTERPOLATOR_HPP_ | ||
#define NDT_SCAN_MATCHER__POSE_ARRAY_INTERPOLATOR_HPP_ | ||
|
||
#include "ndt_scan_matcher/util_func.hpp" | ||
|
||
#include <rclcpp/rclcpp.hpp> | ||
|
||
#include <geometry_msgs/msg/pose_with_covariance_stamped.hpp> | ||
|
||
#include <deque> | ||
|
||
class PoseArrayInterpolator | ||
{ | ||
private: | ||
using PoseWithCovarianceStamped = geometry_msgs::msg::PoseWithCovarianceStamped; | ||
|
||
public: | ||
PoseArrayInterpolator( | ||
rclcpp::Node * node, const rclcpp::Time target_ros_time, | ||
const std::deque<PoseWithCovarianceStamped::ConstSharedPtr> & pose_msg_ptr_array, | ||
const double & pose_timeout_sec, const double & pose_distance_tolerance_meters); | ||
|
||
PoseArrayInterpolator( | ||
rclcpp::Node * node, const rclcpp::Time target_ros_time, | ||
const std::deque<PoseWithCovarianceStamped::ConstSharedPtr> & pose_msg_ptr_array); | ||
|
||
PoseWithCovarianceStamped get_current_pose(); | ||
PoseWithCovarianceStamped get_old_pose(); | ||
PoseWithCovarianceStamped get_new_pose(); | ||
bool is_success(); | ||
|
||
private: | ||
rclcpp::Logger logger_; | ||
rclcpp::Clock clock_; | ||
const PoseWithCovarianceStamped::SharedPtr current_pose_ptr_; | ||
PoseWithCovarianceStamped::SharedPtr old_pose_ptr_; | ||
PoseWithCovarianceStamped::SharedPtr new_pose_ptr_; | ||
bool success_; | ||
|
||
bool validate_time_stamp_difference( | ||
const rclcpp::Time & target_time, const rclcpp::Time & reference_time, | ||
const double time_tolerance_sec) const; | ||
bool validate_position_difference( | ||
const geometry_msgs::msg::Point & target_point, | ||
const geometry_msgs::msg::Point & reference_point, const double distance_tolerance_m_) const; | ||
}; | ||
|
||
#endif // NDT_SCAN_MATCHER__POSE_ARRAY_INTERPOLATOR_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
Oops, something went wrong.