File angle_corrector.hpp
File List > decoders > angle_corrector.hpp
Go to the documentation of this file
// 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.
#pragma once
#include <nebula_core_decoders/scan_cutter.hpp>
#include <rclcpp/rclcpp.hpp>
#include <cstdint>
namespace nebula::drivers
{
struct CorrectedAngleData
{
float azimuth_rad;
float elevation_rad;
float sin_azimuth;
float cos_azimuth;
float sin_elevation;
float cos_elevation;
};
template <typename CorrectionDataT, size_t ChannelN>
class AngleCorrector
{
public:
using correction_data_t = CorrectionDataT;
virtual ~AngleCorrector() = default;
[[nodiscard]] virtual CorrectedAngleData get_corrected_angle_data(
uint32_t encoder_azimuth, uint32_t channel_id) const = 0;
[[nodiscard]] virtual CorrectedAzimuths<ChannelN, float> get_corrected_azimuths(
uint32_t block_azimuth) const = 0;
};
} // namespace nebula::drivers