Skip to content

File robosense_driver.hpp

File List > include > nebula_decoders > nebula_decoders_robosense > robosense_driver.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_common/nebula_common.hpp"
#include "nebula_common/nebula_status.hpp"
#include "nebula_common/point_types.hpp"
#include "nebula_common/robosense/robosense_common.hpp"
#include "nebula_decoders/nebula_decoders_common/nebula_driver_base.hpp"
#include "nebula_decoders/nebula_decoders_robosense/decoders/robosense_scan_decoder.hpp"

#include <pcl_conversions/pcl_conversions.h>

#include <memory>
#include <tuple>
#include <vector>

namespace nebula::drivers
{
class RobosenseDriver : NebulaDriverBase
{
private:
  Status driver_status_{Status::NOT_INITIALIZED};

  std::shared_ptr<RobosenseScanDecoder> scan_decoder_;

public:
  RobosenseDriver() = delete;

  explicit RobosenseDriver(
    const std::shared_ptr<const drivers::RobosenseSensorConfiguration> & sensor_configuration,
    const std::shared_ptr<const drivers::RobosenseCalibrationConfiguration> &
      calibration_configuration);

  Status get_status();

  Status set_calibration_configuration(
    const CalibrationConfigurationBase & calibration_configuration) override;

  std::tuple<drivers::NebulaPointCloudPtr, double> parse_cloud_packet(
    const std::vector<uint8_t> & packet);
};

}  // namespace nebula::drivers