Drake
Drake C++ Documentation
BeamModelParams< T > Class Template Referencefinal

Detailed Description

template<typename T>
class drake::systems::sensors::BeamModelParams< T >

Specializes BasicVector with specific getters and setters.

#include <drake/systems/sensors/beam_model_params.h>

Public Types

typedef BeamModelParamsIndices K
 An abbreviation for our row index constants. More...
 

Public Member Functions

 BeamModelParams ()
 Default constructor. More...
 
template<typename U = T>
std::enable_if_t< std::is_same_v< U, symbolic::Expression > > SetToNamedVariables ()
 Create a symbolic::Variable for each element with the known variable name. More...
 
BeamModelParams< T > * DoClone () const final
 Returns a new BasicVector containing a copy of the entire vector. More...
 
template<typename Archive >
void Serialize (Archive *a)
 Visit each field of this named vector, passing them (in order) to the given Archive. More...
 
drake::boolean< T > IsValid () const
 Returns whether the current values of this vector are well-formed. More...
 
void GetElementBounds (Eigen::VectorXd *lower, Eigen::VectorXd *upper) const final
 Get the bounds for the elements. More...
 
Implements CopyConstructible, CopyAssignable, MoveConstructible,

MoveAssignable

 BeamModelParams (const BeamModelParams &other)
 
 BeamModelParams (BeamModelParams &&other) noexcept
 
BeamModelParamsoperator= (const BeamModelParams &other)
 
BeamModelParamsoperator= (BeamModelParams &&other) noexcept
 
Getters and Setters
const T & lambda_short () const
 The rate parameter of the (truncated) exponential distribution governing short returns. More...
 
void set_lambda_short (const T &lambda_short)
 Setter that matches lambda_short(). More...
 
BeamModelParams< T > with_lambda_short (const T &lambda_short) const
 Fluent setter that matches lambda_short(). More...
 
const T & sigma_hit () const
 The standard deviation of the (truncated) Gaussian distribution governing the noisy returns of the true depth (aka hit) More...
 
void set_sigma_hit (const T &sigma_hit)
 Setter that matches sigma_hit(). More...
 
BeamModelParams< T > with_sigma_hit (const T &sigma_hit) const
 Fluent setter that matches sigma_hit(). More...
 
const T & probability_short () const
 The total probability of getting a short return is probability_short * p(lambda_short*w_short <= input_depth) More...
 
void set_probability_short (const T &probability_short)
 Setter that matches probability_short(). More...
 
BeamModelParams< T > with_probability_short (const T &probability_short) const
 Fluent setter that matches probability_short(). More...
 
const T & probability_miss () const
 The probability of ignoring the input depth and simply returning the max range of the sensor. More...
 
void set_probability_miss (const T &probability_miss)
 Setter that matches probability_miss(). More...
 
BeamModelParams< T > with_probability_miss (const T &probability_miss) const
 Fluent setter that matches probability_miss(). More...
 
const T & probability_uniform () const
 The probability of ignoring the input depth and simple returning a uniform random value between 0 and the max range of the sensor. More...
 
void set_probability_uniform (const T &probability_uniform)
 Setter that matches probability_uniform(). More...
 
BeamModelParams< T > with_probability_uniform (const T &probability_uniform) const
 Fluent setter that matches probability_uniform(). More...
 
- Public Member Functions inherited from BasicVector< T >
 BasicVector ()=default
 Constructs an empty BasicVector. More...
 
 BasicVector (int size)
 Initializes with the given size using the drake::dummy_value<T>, which is NaN when T = double. More...
 
 BasicVector (VectorX< T > vec)
 Constructs a BasicVector with the specified vec data. More...
 
 BasicVector (const std::initializer_list< T > &init)
 Constructs a BasicVector whose elements are the elements of init. More...
 
int size () const final
 Returns the number of elements in the vector. More...
 
void set_value (const Eigen::Ref< const VectorX< T >> &value)
 Sets the vector to the given value. More...
 
const VectorX< T > & value () const
 Returns a const reference to the contained VectorX<T>. More...
 
Eigen::VectorBlock< VectorX< T > > get_mutable_value ()
 Returns the entire vector as a mutable Eigen::VectorBlock, which allows mutation of the values, but does not allow resize() to be invoked on the returned object. More...
 
void SetFromVector (const Eigen::Ref< const VectorX< T >> &value) final
 Replaces the entire vector with the contents of value. More...
 
VectorX< T > CopyToVector () const final
 Copies this entire VectorBase into a contiguous Eigen Vector. More...
 
void ScaleAndAddToVector (const T &scale, EigenPtr< VectorX< T >> vec) const final
 Adds a scaled version of this vector to Eigen vector vec. More...
 
void SetZero () final
 Sets all elements of this vector to zero. More...
 
std::unique_ptr< BasicVector< T > > Clone () const
 Copies the entire vector to a new BasicVector, with the same concrete implementation type. More...
 
Eigen::VectorBlock< const VectorX< T > > get_value () const
 (Don't use this in new code) Returns the entire vector as a const Eigen::VectorBlock. More...
 
 BasicVector (const BasicVector &)=delete
 
BasicVectoroperator= (const BasicVector &)=delete
 
 BasicVector (BasicVector &&)=delete
 
BasicVectoroperator= (BasicVector &&)=delete
 
- Public Member Functions inherited from VectorBase< T >
virtual ~VectorBase ()
 
T & operator[] (int index)
 Returns the element at the given index in the vector. More...
 
const T & operator[] (int index) const
 Returns the element at the given index in the vector. More...
 
const T & GetAtIndex (int index) const
 Returns the element at the given index in the vector. More...
 
T & GetAtIndex (int index)
 Returns the element at the given index in the vector. More...
 
void SetAtIndex (int index, const T &value)
 Replaces the state at the given index with the value. More...
 
virtual void SetFrom (const VectorBase< T > &value)
 Replaces the entire vector with the contents of value. More...
 
virtual void CopyToPreSizedVector (EigenPtr< VectorX< T >> vec) const
 Copies this entire VectorBase into a pre-sized Eigen Vector. More...
 
VectorBasePlusEqScaled (const T &scale, const VectorBase< T > &rhs)
 Add in scaled vector rhs to this vector. More...
 
VectorBasePlusEqScaled (const std::initializer_list< std::pair< T, const VectorBase< T > & >> &rhs_scale)
 Add in multiple scaled vectors to this vector. More...
 
VectorBaseoperator+= (const VectorBase< T > &rhs)
 Add in vector rhs to this vector. More...
 
VectorBaseoperator-= (const VectorBase< T > &rhs)
 Subtract in vector rhs to this vector. More...
 
 VectorBase (const VectorBase &)=delete
 
VectorBaseoperator= (const VectorBase &)=delete
 
 VectorBase (VectorBase &&)=delete
 
VectorBaseoperator= (VectorBase &&)=delete
 

Static Public Member Functions

static const std::vector< std::string > & GetCoordinateNames ()
 See BeamModelParamsIndices::GetCoordinateNames(). More...
 
- Static Public Member Functions inherited from BasicVector< T >
static std::unique_ptr< BasicVector< T > > Make (const std::initializer_list< T > &init)
 Constructs a BasicVector whose elements are the elements of init. More...
 
template<typename... Fargs>
static std::unique_ptr< BasicVector< T > > Make (Fargs &&... args)
 Constructs a BasicVector where each element is constructed using the placewise-corresponding member of args as the sole constructor argument. More...
 

Additional Inherited Members

- Protected Member Functions inherited from BasicVector< T >
const T & DoGetAtIndexUnchecked (int index) const final
 Implementations should ensure this operation is O(1) and allocates no memory. More...
 
T & DoGetAtIndexUnchecked (int index) final
 Implementations should ensure this operation is O(1) and allocates no memory. More...
 
const T & DoGetAtIndexChecked (int index) const final
 Implementations should ensure this operation is O(1) and allocates no memory. More...
 
T & DoGetAtIndexChecked (int index) final
 Implementations should ensure this operation is O(1) and allocates no memory. More...
 
const VectorX< T > & values () const
 Provides const access to the element storage. More...
 
VectorX< T > & values ()
 (Advanced) Provides mutable access to the element storage. More...
 
- Protected Member Functions inherited from VectorBase< T >
 VectorBase ()
 
void ThrowOutOfRange (int index) const
 
void ThrowMismatchedSize (int other_size) const
 
- Static Protected Member Functions inherited from BasicVector< T >
template<typename F , typename... Fargs>
static void MakeRecursive (BasicVector< T > *data, int index, F constructor_arg, Fargs &&... recursive_args)
 Sets data at index to an object of type T, which must have a single-argument constructor invoked via constructor_arg, and then recursively invokes itself on the next index with recursive args. More...
 
template<typename F , typename... Fargs>
static void MakeRecursive (BasicVector< T > *data, int index, F constructor_arg)
 Base case for the MakeRecursive template recursion. More...
 

Member Typedef Documentation

◆ K

An abbreviation for our row index constants.

Constructor & Destructor Documentation

◆ BeamModelParams() [1/3]

Default constructor.

Sets all rows to their default value:

  • lambda_short defaults to 1.0 dimensionless.
  • sigma_hit defaults to 0.0 m.
  • probability_short defaults to 0.0 dimensionless.
  • probability_miss defaults to 0.0 dimensionless.
  • probability_uniform defaults to 0.0 dimensionless.

◆ BeamModelParams() [2/3]

BeamModelParams ( const BeamModelParams< T > &  other)

◆ BeamModelParams() [3/3]

BeamModelParams ( BeamModelParams< T > &&  other)
noexcept

Member Function Documentation

◆ DoClone()

BeamModelParams<T>* DoClone ( ) const
finalvirtual

Returns a new BasicVector containing a copy of the entire vector.

Caller must take ownership, and may rely on the NVI wrapper to initialize the clone elementwise.

Subclasses of BasicVector must override DoClone to return their covariant type.

Reimplemented from BasicVector< T >.

◆ GetCoordinateNames()

static const std::vector<std::string>& GetCoordinateNames ( )
static

◆ GetElementBounds()

void GetElementBounds ( Eigen::VectorXd *  lower,
Eigen::VectorXd *  upper 
) const
finalvirtual

Get the bounds for the elements.

If lower and upper are both empty size vectors, then there are no bounds. Otherwise, the bounds are (*lower)(i) <= GetAtIndex(i) <= (*upper)(i) The default output is no bounds.

Reimplemented from VectorBase< T >.

◆ IsValid()

drake::boolean<T> IsValid ( ) const

Returns whether the current values of this vector are well-formed.

◆ lambda_short()

const T& lambda_short ( ) const

The rate parameter of the (truncated) exponential distribution governing short returns.

Note
lambda_short is expressed in units of dimensionless.
lambda_short has a limited domain of [0.0, +Inf].

◆ operator=() [1/2]

BeamModelParams& operator= ( const BeamModelParams< T > &  other)

◆ operator=() [2/2]

BeamModelParams& operator= ( BeamModelParams< T > &&  other)
noexcept

◆ probability_miss()

const T& probability_miss ( ) const

The probability of ignoring the input depth and simply returning the max range of the sensor.

Note
probability_miss is expressed in units of dimensionless.
probability_miss has a limited domain of [0.0, 1.0].

◆ probability_short()

const T& probability_short ( ) const

The total probability of getting a short return is probability_short * p(lambda_short*w_short <= input_depth)

Note
probability_short is expressed in units of dimensionless.
probability_short has a limited domain of [0.0, 1.0].

◆ probability_uniform()

const T& probability_uniform ( ) const

The probability of ignoring the input depth and simple returning a uniform random value between 0 and the max range of the sensor.

Note
probability_uniform is expressed in units of dimensionless.
probability_uniform has a limited domain of [0.0, 1.0].

◆ Serialize()

void Serialize ( Archive *  a)

Visit each field of this named vector, passing them (in order) to the given Archive.

The archive can read and/or write to the vector values. One common use of Serialize is the //common/yaml tools.

◆ set_lambda_short()

void set_lambda_short ( const T &  lambda_short)

Setter that matches lambda_short().

◆ set_probability_miss()

void set_probability_miss ( const T &  probability_miss)

Setter that matches probability_miss().

◆ set_probability_short()

void set_probability_short ( const T &  probability_short)

Setter that matches probability_short().

◆ set_probability_uniform()

void set_probability_uniform ( const T &  probability_uniform)

Setter that matches probability_uniform().

◆ set_sigma_hit()

void set_sigma_hit ( const T &  sigma_hit)

Setter that matches sigma_hit().

◆ SetToNamedVariables()

std::enable_if_t<std::is_same_v<U, symbolic::Expression> > SetToNamedVariables ( )

Create a symbolic::Variable for each element with the known variable name.

This is only available for T == symbolic::Expression.

◆ sigma_hit()

const T& sigma_hit ( ) const

The standard deviation of the (truncated) Gaussian distribution governing the noisy returns of the true depth (aka hit)

Note
sigma_hit is expressed in units of m.
sigma_hit has a limited domain of [0.0, +Inf].

◆ with_lambda_short()

BeamModelParams<T> with_lambda_short ( const T &  lambda_short) const

Fluent setter that matches lambda_short().

Returns a copy of this with lambda_short set to a new value.

◆ with_probability_miss()

BeamModelParams<T> with_probability_miss ( const T &  probability_miss) const

Fluent setter that matches probability_miss().

Returns a copy of this with probability_miss set to a new value.

◆ with_probability_short()

BeamModelParams<T> with_probability_short ( const T &  probability_short) const

Fluent setter that matches probability_short().

Returns a copy of this with probability_short set to a new value.

◆ with_probability_uniform()

BeamModelParams<T> with_probability_uniform ( const T &  probability_uniform) const

Fluent setter that matches probability_uniform().

Returns a copy of this with probability_uniform set to a new value.

◆ with_sigma_hit()

BeamModelParams<T> with_sigma_hit ( const T &  sigma_hit) const

Fluent setter that matches sigma_hit().

Returns a copy of this with sigma_hit set to a new value.


The documentation for this class was generated from the following file: