forked from autowarefoundation/autoware.universe
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pointcloud_preprocessor): support for 3d distortion correction a…
…lgorithm and refactor distortion correction node
- Loading branch information
Showing
10 changed files
with
633 additions
and
248 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
5 changes: 5 additions & 0 deletions
5
sensing/pointcloud_preprocessor/config/distortion_corrector_node.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/**: | ||
ros__parameters: | ||
base_frame: base_link | ||
use_imu: true | ||
use_3d_distortion_correction: false |
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
65 changes: 65 additions & 0 deletions
65
...cessor/include/pointcloud_preprocessor/distortion_corrector/distortion_corrector_node.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,65 @@ | ||
// Copyright 2024 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 POINTCLOUD_PREPROCESSOR__DISTORTION_CORRECTOR__DISTORTION_CORRECTOR_NODE_HPP_ | ||
#define POINTCLOUD_PREPROCESSOR__DISTORTION_CORRECTOR__DISTORTION_CORRECTOR_NODE_HPP_ | ||
|
||
#include "pointcloud_preprocessor/distortion_corrector/distortion_corrector.hpp" | ||
|
||
#include <tier4_autoware_utils/ros/debug_publisher.hpp> | ||
#include <tier4_autoware_utils/system/stop_watch.hpp> | ||
#include <rclcpp/rclcpp.hpp> | ||
|
||
#include <geometry_msgs/msg/twist_stamped.hpp> | ||
#include <geometry_msgs/msg/twist_with_covariance_stamped.hpp> | ||
#include <sensor_msgs/msg/imu.hpp> | ||
#include <sensor_msgs/msg/point_cloud2.hpp> | ||
|
||
#include <memory> | ||
#include <string> | ||
|
||
namespace pointcloud_preprocessor | ||
{ | ||
using rcl_interfaces::msg::SetParametersResult; | ||
using sensor_msgs::msg::PointCloud2; | ||
|
||
class DistortionCorrectorComponent : public rclcpp::Node | ||
{ | ||
public: | ||
explicit DistortionCorrectorComponent(const rclcpp::NodeOptions & options); | ||
|
||
private: | ||
rclcpp::Subscription<geometry_msgs::msg::TwistWithCovarianceStamped>::SharedPtr twist_sub_; | ||
rclcpp::Subscription<sensor_msgs::msg::Imu>::SharedPtr imu_sub_; | ||
rclcpp::Subscription<PointCloud2>::SharedPtr pointcloud_sub_; | ||
|
||
rclcpp::Publisher<PointCloud2>::SharedPtr undistorted_pointcloud_pub_; | ||
|
||
std::unique_ptr<tier4_autoware_utils::StopWatch<std::chrono::milliseconds>> stop_watch_ptr_; | ||
std::unique_ptr<tier4_autoware_utils::DebugPublisher> debug_publisher_; | ||
|
||
std::string base_frame_; | ||
bool use_imu_; | ||
bool use_3d_distortion_correction_; | ||
|
||
std::unique_ptr<DistortionCorrectorBase> distortion_corrector_; | ||
|
||
void onPointCloud(PointCloud2::UniquePtr points_msg); | ||
void onTwist(const geometry_msgs::msg::TwistWithCovarianceStamped::ConstSharedPtr twist_msg); | ||
void onImu(const sensor_msgs::msg::Imu::ConstSharedPtr imu_msg); | ||
}; | ||
|
||
} // namespace pointcloud_preprocessor | ||
|
||
#endif // POINTCLOUD_PREPROCESSOR__DISTORTION_CORRECTOR__DISTORTION_CORRECTOR_NODE_HPP_ |
16 changes: 16 additions & 0 deletions
16
sensing/pointcloud_preprocessor/launch/distortion_corrector_node.launch.xml
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,16 @@ | ||
<launch> | ||
<arg name="input/pointcloud" default="/sensing/lidar/top/mirror_cropped/pointcloud_ex"/> | ||
<arg name="input/twist" default="/sensing/vehicle_velocity_converter/twist_with_covariance"/> | ||
<arg name="input/imu" default="/sensing/imu/imu_data"/> | ||
<arg name="output/pointcloud" default="/sensing/lidar/top/rectified/pointcloud_ex"/> | ||
|
||
<!-- Parameter --> | ||
<arg name="param_file" default="$(find-pkg-share pointcloud_preprocessor)/config/distortion_corrector_node.param.yaml"/> | ||
<node pkg="pointcloud_preprocessor" exec="distortion_corrector_node" name="distortion_corrector_node" output="screen"> | ||
<remap from="~/input/pointcloud" to="$(var input/pointcloud)"/> | ||
<remap from="~/input/twist" to="$(var input/twist)"/> | ||
<remap from="~/input/imu" to="$(var input/imu)"/> | ||
<remap from="~/output/pointcloud" to="$(var output/pointcloud)"/> | ||
<param from="$(var param_file)"/> | ||
</node> | ||
</launch> |
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.