Marker#

#include "navground/sim/state_estimations/sensor_marker.h"
struct MarkerStateEstimation : public navground::sim::Sensor#

A sensor that report the position of a marker relative to the agent.

Registered properties:

Public Types

enum class ReferenceOrientation#

Values:

enumerator target_direction#

target orientation

enumerator agent#

agent frame

enumerator world#

world frame

Public Functions

inline explicit MarkerStateEstimation(core::Vector2 marker_position = core::Vector2::Zero(), ReferenceOrientation reference_orientation = ReferenceOrientation::agent, ng_float_t min_x = -std::numeric_limits<ng_float_t>::infinity(), ng_float_t min_y = -std::numeric_limits<ng_float_t>::infinity(), ng_float_t max_x = std::numeric_limits<ng_float_t>::infinity(), ng_float_t max_y = std::numeric_limits<ng_float_t>::infinity(), bool include_x = true, bool include_y = true, const std::string &name = "")#

Constructs a new instance.

Parameters:
  • marker_position[in] The marker position in the world frame.

  • reference_orientation[in] The reference frame used for orientation

  • min_x[in] The minimal x-coordinate

  • min_y[in] The minimal y-coordinate

  • max_x[in] The maximal x-coordinate

  • max_y[in] The maximal y-coordinate

  • include_x[in] Whether to include the x-coordinate

  • include_y[in] Whether to include the y-coordinate

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

virtual ~MarkerStateEstimation() = default#
inline void set_marker_position(const core::Vector2 &value)#

Sets the marker position in the world frame.

Parameters:

value[in] The desired value

inline void set_reference_orientation(ReferenceOrientation value)#

Sets the reference frame used for orientation.

Parameters:

value[in] The desired value

inline core::Vector2 get_marker_position() const#

Gets the marker position in the world frame. rangings.

Returns:

The position.

inline ReferenceOrientation get_reference_orientation() const#

Gets the reference frame used for orientation.

Returns:

The orientation frame.

inline std::string get_reference_orientation_name() const#

Gets the reference frame used for orientation.

Returns:

The orientation frame name.

inline void set_reference_orientation_name(const std::string &name)#

Sets the reference frame used for orientation.

Parameters:

name[in] The desired frame name.

inline core::Vector2 get_measured_marker_position() const#

Computes the relative marker pose.

Returns:

The position.

inline BoundingBox get_bounding_box() const#

Gets the bounding box.

Returns:

The bounding box

inline void set_bounding_box(const BoundingBox &value)#

Sets the bounding box.

Parameters:

value[in] The desired value

inline ng_float_t get_min_x() const#

Gets the lowest bound on the x-coordinate.

Returns:

The lowest x-coordinate.

inline ng_float_t get_min_y() const#

Gets the lowest bound on the y-coordinate.

Returns:

The lowest y-coordinate.

inline ng_float_t get_max_x() const#

Gets the highest bound on the x-coordinate.

Returns:

The highest x-coordinate.

inline ng_float_t get_max_y() const#

Gets the highest bound on the y-coordinate.

Returns:

The highest y-coordinate.

inline void set_min_x(ng_float_t value)#

Sets the lowest bound on the x-coordinate.

Parameters:

value[in] The desired value

inline void set_min_y(ng_float_t value)#

Sets the lowest bound on the y-coordinate.

Parameters:

value[in] The desired value

inline void set_max_x(ng_float_t value)#

Sets the highest bound on the x-coordinate.

Parameters:

value[in] The desired value

inline void set_max_y(ng_float_t value)#

Sets the highest bound on the y-coordinate.

Parameters:

value[in] The desired value

inline void set_include_x(bool value)#

Sets whether to include the x-coordinate.

Parameters:

value[in] True to include it.

inline bool get_include_x() const#

Gets whether to include the x-coordinate.

Returns:

True when including it.

inline void set_include_y(bool value)#

Sets whether to include the y-coordinate.

Parameters:

value[in] True to include it.

inline bool get_include_y() const#

Gets whether to include the y-coordinate.

Returns:

True when including it.

virtual void update(Agent *agent, World *world, EnvironmentState *state) override#

Updates an environment state with respect to a given agent.

Parameters:
  • agent – The agent owning the state estimation

  • world[in] The world that the agent is part of

  • state – The environment state to be updated

void update_marker(Agent *agent, World *world)#

Runs an update.

Like update but without writing a core::SensingState.

Parameters:
  • agent – The agent

  • world – The world

inline std::optional<core::Vector2> read_marker_position(core::SensingState &state) const#

Reads the marker position from a core::SensingState.

Calls read_marker_position_with_name, passing Sensor::get_name.

Parameters:

state – The state

Returns:

A position or null if none was found.

Public Static Functions

static std::optional<core::Vector2> read_marker_position_with_name(core::SensingState &state, const std::string &name)#

Reads the marker position from a core::SensingState.

Parameters:
  • state – The state

  • name[in] The namespace of the sensor

Returns:

A position or null if none was found.

Public Static Attributes

static const std::string type#