Class SensorInterface

Inheritance Relationships

Derived Types

Class Documentation

class SensorInterface

An interface for lidars units.

Subclassed by sensor::Sensor, sensor::SensorTins

Public Types

using SharedPtr = std::shared_ptr<SensorInterface>
using Ptr = std::unique_ptr<SensorInterface>

Public Functions

inline SensorInterface()

A sensor interface constructor.

virtual ~SensorInterface() = default

A sensor interface destructor.

SensorInterface(const SensorInterface&) = delete
SensorInterface &operator=(const SensorInterface&) = delete
SensorInterface(SensorInterface&&) = default
SensorInterface &operator=(SensorInterface&&) = default
virtual void reset(ros2_ouster::Configuration &config, rclcpp_lifecycle::LifecycleNode::SharedPtr node) = 0

Reset lidar sensor.

Parameters:
  • configuration – file to use

  • node – pointer to the driver node, which provides access to ROS params

virtual void configure(ros2_ouster::Configuration &config, rclcpp_lifecycle::LifecycleNode::SharedPtr node) = 0

Configure lidar sensor.

Parameters:
  • configuration – file to use

  • node – pointer to the driver node, which provides access to ROS params

virtual ouster::sensor::client_state get() = 0

Ask sensor to get its current state for data collection.

Returns:

the state enum value

virtual bool readLidarPacket(const ouster::sensor::client_state &state, uint8_t *buf) = 0

reading a lidar packet

Parameters:
  • state – of the sensor

  • buf – pointer to a buffer to hold the packet data. Must hold getPacketFormat().lidar_packet_size bytes.

Returns:

true if a packet was recieved, false otherwise

virtual bool readImuPacket(const ouster::sensor::client_state &state, uint8_t *buf) = 0

reading an imu packet

Parameters:
  • state – of the sensor

  • buf – pointer to a buffer to hold the packet data. Must hold getPacketFormat().imu_packet_size bytes.

Returns:

true if a packet was recieved, false otherwise

virtual ros2_ouster::Metadata getMetadata() = 0

Get lidar sensor’s metadata.

Returns:

sensor metadata struct

virtual ouster::sensor::packet_format getPacketFormat() = 0

Get lidar sensor’s packet format.

Returns:

packet format struct