Lidar#

#include "navground/sim/state_estimations/sensor_lidar.h"
struct LidarStateEstimation : public navground::sim::Sensor#

A distance scanner.

Registered properties:

Public Functions

inline explicit LidarStateEstimation(ng_float_t range = default_range, ng_float_t start_angle = default_start_angle, ng_float_t field_of_view = default_field_of_view, unsigned resolution = default_resolution, const Vector2 &position = Vector2::Zero(), ng_float_t error_bias = default_error_bias, ng_float_t error_std_dev = default_error_std_dev, const std::string &name = "")#

Constructs a new instance.

Parameters:
  • range[in] The maximal range of the sensor

  • start_angle[in] The starting angle

  • field_of_view[in] The field of view

  • resolution[in] The number of ranging measurements per scan

  • position[in] The position of the sensor with respect to the agent origin.

  • error_bias[in] The systematic error for all rangings.

  • error_std_dev[in] The rangings error standard deviation.

  • name[in] The name to use as a prefix

inline void set_range(ng_float_t value)#

Sets the range of view.

Parameters:

value[in] The new value

inline ng_float_t get_range() const#

Gets the range of view.

Returns:

The range of view.

inline void set_start_angle(ng_float_t value)#

Sets the range of view.

Parameters:

value[in] The new value

inline ng_float_t get_start_angle() const#

Gets the range of view.

Returns:

The range of view.

inline void set_field_of_view(ng_float_t value)#

Sets the range of view.

Parameters:

value[in] The new value

inline ng_float_t get_field_of_view() const#

Gets the range of view.

Returns:

The range of view.

inline void set_error_bias(ng_float_t value)#

Sets the error bias, i.e., the systematic error for all rangings.

Parameters:

value[in] The new value

inline ng_float_t get_error_bias() const#

Gets the error bias, i.e., the systematic error for all rangings.

Returns:

The error.

inline void set_error_std_dev(ng_float_t value)#

Sets the rangings error standard deviation.

Parameters:

value[in] The positive value

inline ng_float_t get_error_std_dev() const#

Gets the rangings error standard deviation.

Returns:

The error.

inline void set_resolution(int value)#

Sets the range of view.

Parameters:

value[in] The new value

inline int get_resolution() const#

Gets the range of view.

Returns:

The range of view.

inline void set_position(const core::Vector2 &value)#

Sets the position of the sensor with respect to the agent origin.

Parameters:

value[in] The new value

inline core::Vector2 get_position() const#

Gets the position of the sensor with respect to the agent origin.

Returns:

The position.

ng_float_t get_angular_increment() const#

Gets the angular increment between rays.

Returns:

The angular increment.

std::valarray<ng_float_t> get_angles() const#

Gets the ray angles.

Returns:

The angles.

const std::valarray<ng_float_t> &read_ranges(core::SensingState &state) const#

Reads the ranges stored in a sensing state.

Parameters:

state – The state

Returns:

The array of ranges

Public Static Attributes

static const ng_float_t default_range = 1#

The default range

static const ng_float_t default_start_angle = -static_cast<ng_float_t>(core::PI)#

The default start angle [radians]

static const ng_float_t default_field_of_view = core::TWO_PI#

The default field of view [radians]

static const int default_resolution = 100#

The default resolution

static const ng_float_t default_error_bias = 0#

The default error bias

static const ng_float_t default_error_std_dev = 0#

The default error standard deviation

static const std::string field_name = "range"#

The name of the buffer set by the sensor