Class Sensor

Inheritance Relationships

Base Type

Class Documentation

class Sensor : public ros2_ouster::SensorInterface

Public Functions

Sensor()
~Sensor() override
virtual void reset(ros2_ouster::Configuration &config, rclcpp_lifecycle::LifecycleNode::SharedPtr node) override

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) override

Configure lidar sensor.

Parameters:
  • configuration – file to use

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

virtual ros2_ouster::Metadata getMetadata() override

Get lidar sensor’s metadata.

Returns:

sensor metadata struct

virtual ouster::sensor::client_state get() override

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) override

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) override

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

void setMetadata(int lidar_port, int imu_port, const std::string &timestamp_mode)

Sets the metadata class variable.

Parameters:
  • lidar_port

  • imu_port

virtual ouster::sensor::packet_format getPacketFormat() override

Get lidar sensor’s packet format.

Returns:

packet format struct