Program Listing for File sensor.hpp
↰ Return to documentation for file (include/ros2_ouster/sensor.hpp)
// Copyright 2021, Steve Macenski
// 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 ROS2_OUSTER__SENSOR_HPP_
#define ROS2_OUSTER__SENSOR_HPP_
#include <memory>
#include <vector>
#include <string>
#include "ros2_ouster/processors/processor_factories.hpp"
#include "ros2_ouster/interfaces/data_processor_interface.hpp"
#include "ros2_ouster/interfaces/sensor_interface.hpp"
#include "ros2_ouster/client/client.h"
#include "ros2_ouster/ros2_utils.hpp"
namespace sensor
{
class Sensor : public ros2_ouster::SensorInterface
{
public:
Sensor();
~Sensor() override;
void reset(
ros2_ouster::Configuration & config,
rclcpp_lifecycle::LifecycleNode::SharedPtr node) override;
void configure(
ros2_ouster::Configuration & config,
rclcpp_lifecycle::LifecycleNode::SharedPtr node) override;
ros2_ouster::Metadata getMetadata() override;
ouster::sensor::client_state get() override;
bool readLidarPacket(const ouster::sensor::client_state & state, uint8_t * buf) override;
bool readImuPacket(const ouster::sensor::client_state & state, uint8_t * buf) override;
void setMetadata(
int lidar_port, int imu_port,
const std::string & timestamp_mode);
ouster::sensor::packet_format getPacketFormat() override;
private:
std::shared_ptr<ouster::sensor::client> _ouster_client;
ros2_ouster::Metadata _metadata{};
};
} // namespace sensor
#endif // ROS2_OUSTER__SENSOR_HPP_