@@ -61,7 +61,8 @@ class DistortionCorrectorBase
61
61
template <class T >
62
62
class DistortionCorrector : public DistortionCorrectorBase
63
63
{
64
- public:
64
+ protected:
65
+ geometry_msgs::msg::TransformStamped::SharedPtr geometry_imu_to_base_link_ptr_;
65
66
bool pointcloud_transform_needed_{false };
66
67
bool pointcloud_transform_exists_{false };
67
68
bool imu_transform_exists_{false };
@@ -72,28 +73,12 @@ class DistortionCorrector : public DistortionCorrectorBase
72
73
std::deque<geometry_msgs::msg::TwistStamped> twist_queue_;
73
74
std::deque<geometry_msgs::msg::Vector3Stamped> angular_velocity_queue_;
74
75
75
- explicit DistortionCorrector (rclcpp::Node * node)
76
- : node_(node), tf_buffer_(node_->get_clock ()), tf_listener_(tf_buffer_)
77
- {
78
- }
79
- void processTwistMessage (
80
- const geometry_msgs::msg::TwistWithCovarianceStamped::ConstSharedPtr twist_msg) override ;
81
-
82
- void processIMUMessage (
83
- const std::string & base_frame, const sensor_msgs::msg::Imu::ConstSharedPtr imu_msg) override ;
84
- void getIMUTransformation (
85
- const std::string & base_frame, const std::string & imu_frame,
86
- geometry_msgs::msg::TransformStamped::SharedPtr geometry_imu_to_base_link_ptr);
87
- void enqueueIMU (
88
- const sensor_msgs::msg::Imu::ConstSharedPtr imu_msg,
89
- geometry_msgs::msg::TransformStamped::SharedPtr geometry_imu_to_base_link_ptr);
90
-
91
- bool isInputValid (sensor_msgs::msg::PointCloud2 & pointcloud);
76
+ void getIMUTransformation (const std::string & base_frame, const std::string & imu_frame);
77
+ void enqueueIMU (const sensor_msgs::msg::Imu::ConstSharedPtr imu_msg);
92
78
void getTwistAndIMUIterator (
93
79
bool use_imu, double first_point_time_stamp_sec,
94
80
std::deque<geometry_msgs::msg::TwistStamped>::iterator & it_twist,
95
81
std::deque<geometry_msgs::msg::Vector3Stamped>::iterator & it_imu);
96
- void undistortPointCloud (bool use_imu, sensor_msgs::msg::PointCloud2 & pointcloud) override ;
97
82
void warnIfTimestampIsTooLate (bool is_twist_time_stamp_too_late, bool is_imu_time_stamp_too_late);
98
83
void undistortPoint (
99
84
sensor_msgs::PointCloud2Iterator<float > & it_x, sensor_msgs::PointCloud2Iterator<float > & it_y,
@@ -105,6 +90,19 @@ class DistortionCorrector : public DistortionCorrectorBase
105
90
static_cast <T *>(this )->undistortPointImplementation (
106
91
it_x, it_y, it_z, it_twist, it_imu, time_offset, is_twist_valid, is_imu_valid);
107
92
};
93
+
94
+ public:
95
+ explicit DistortionCorrector (rclcpp::Node * node)
96
+ : node_(node), tf_buffer_(node_->get_clock ()), tf_listener_(tf_buffer_)
97
+ {
98
+ }
99
+ void processTwistMessage (
100
+ const geometry_msgs::msg::TwistWithCovarianceStamped::ConstSharedPtr twist_msg) override ;
101
+
102
+ void processIMUMessage (
103
+ const std::string & base_frame, const sensor_msgs::msg::Imu::ConstSharedPtr imu_msg) override ;
104
+ void undistortPointCloud (bool use_imu, sensor_msgs::msg::PointCloud2 & pointcloud) override ;
105
+ bool isInputValid (sensor_msgs::msg::PointCloud2 & pointcloud);
108
106
};
109
107
110
108
class DistortionCorrector2D : public DistortionCorrector <DistortionCorrector2D>
0 commit comments