Definition of a scoped state. More...
#include <ompl/base/ScopedState.h>
Public Types | |
using | StateType = typename T::StateType |
The type of the contained state. | |
Public Member Functions | |
ScopedState (const SpaceInformationPtr &si) | |
Given the space that we are working with, allocate a state from the corresponding state space. | |
ScopedState (StateSpacePtr space) | |
Given the state space that we are working with, allocate a state. | |
ScopedState (const ScopedState< T > &other) | |
Copy constructor. | |
template<class O > | |
ScopedState (const ScopedState< O > &other) | |
Copy constructor that allows instantiation from states of other type. | |
ScopedState (StateSpacePtr space, const State *state) | |
Given the state space that we are working with, allocate a state and fill that state with a given value. | |
~ScopedState () | |
Free the memory of the internally allocated state. | |
const StateSpacePtr & | getSpace () const |
Get the state space that the state corresponds to. | |
ScopedState< T > & | operator= (const ScopedState< T > &other) |
Assignment operator. | |
ScopedState< T > & | operator= (const State *other) |
Assignment operator. | |
ScopedState< T > & | operator= (const State &other) |
Assignment operator. | |
template<class O > | |
ScopedState< T > & | operator= (const ScopedState< O > &other) |
Assignment operator that allows conversion of states. | |
ScopedState< T > & | operator= (const std::vector< double > &reals) |
Partial assignment operator. Only sets the double values of the state to specified real values. | |
ScopedState< T > & | operator= (const double value) |
Partial assignment operator. Only sets the double values of the state to a fixed value. | |
template<class O > | |
bool | operator== (const ScopedState< O > &other) const |
Checks equality of two states. | |
template<class O > | |
bool | operator!= (const ScopedState< O > &other) const |
Checks equality of two states. | |
const ScopedState | operator[] (const StateSpacePtr &s) const |
Extract a state that corresponds to the components in state space s. Those components will have the same value as the current state (only the ones included in the current state; others will be uninitialised). Note: a new state is constructed and data is copied. | |
double & | operator[] (const unsigned int index) |
Access the indexth double value this state contains. | |
double | operator[] (const unsigned int index) const |
Access the indexth double value this state contains. | |
double & | operator[] (const std::string &name) |
Access a double value from this state contains using its name. | |
double | operator[] (const std::string &name) const |
Access a double value from this state contains using its name. | |
template<class O > | |
double | distance (const ScopedState< O > &other) const |
Compute the distance to another state. | |
double | distance (const State *state) const |
Compute the distance to another state. | |
void | random () |
Set this state to a random value (uniform) | |
void | enforceBounds () |
Enforce the bounds on the maintained state. | |
bool | satisfiesBounds () const |
Check if the maintained state satisfies bounds. | |
std::vector< double > | reals () const |
Return the real values corresponding to this state. If a conversion is not possible, an exception is thrown. | |
void | print (std::ostream &out=std::cout) const |
Print this state to a stream. | |
StateType & | operator* () |
De-references to the contained state. | |
const StateType & | operator* () const |
De-references to the contained state. | |
StateType * | operator-> () |
Returns a pointer to the contained state. | |
const StateType * | operator-> () const |
Returns a pointer to the contained state. | |
StateType * | get () |
Returns a pointer to the contained state. | |
const StateType * | get () const |
Returns a pointer to the contained state. | |
StateType * | operator() () const |
Returns a pointer to the contained state (used for Python bindings) | |
Detailed Description
class ompl::base::ScopedState< T >
Definition of a scoped state.
This class allocates a state of a desired type using the allocation mechanism of the corresponding state space. The state is then freed when the instance goes out of scope using the corresponding free mechanism.
Definition at line 56 of file ScopedState.h.
Member Typedef Documentation
◆ StateType
using ompl::base::ScopedState< T >::StateType = typename T::StateType |
The type of the contained state.
Definition at line 66 of file ScopedState.h.
Constructor & Destructor Documentation
◆ ScopedState() [1/5]
|
inlineexplicit |
Given the space that we are working with, allocate a state from the corresponding state space.
Definition at line 71 of file ScopedState.h.
◆ ScopedState() [2/5]
|
inlineexplicit |
Given the state space that we are working with, allocate a state.
Definition at line 84 of file ScopedState.h.
◆ ScopedState() [3/5]
|
inline |
Copy constructor.
Definition at line 96 of file ScopedState.h.
◆ ScopedState() [4/5]
|
inline |
Copy constructor that allows instantiation from states of other type.
Definition at line 105 of file ScopedState.h.
◆ ScopedState() [5/5]
|
inline |
Given the state space that we are working with, allocate a state and fill that state with a given value.
Definition at line 123 of file ScopedState.h.
◆ ~ScopedState()
|
inline |
Free the memory of the internally allocated state.
Definition at line 136 of file ScopedState.h.
Member Function Documentation
◆ distance() [1/2]
|
inline |
Compute the distance to another state.
Definition at line 317 of file ScopedState.h.
◆ distance() [2/2]
|
inline |
Compute the distance to another state.
Definition at line 325 of file ScopedState.h.
◆ enforceBounds()
|
inline |
Enforce the bounds on the maintained state.
Definition at line 339 of file ScopedState.h.
◆ get() [1/2]
|
inline |
Returns a pointer to the contained state.
Definition at line 393 of file ScopedState.h.
◆ get() [2/2]
|
inline |
Returns a pointer to the contained state.
Definition at line 399 of file ScopedState.h.
◆ getSpace()
|
inline |
Get the state space that the state corresponds to.
Definition at line 142 of file ScopedState.h.
◆ operator!=()
|
inline |
Checks equality of two states.
Definition at line 257 of file ScopedState.h.
◆ operator()()
|
inline |
Returns a pointer to the contained state (used for Python bindings)
Definition at line 405 of file ScopedState.h.
◆ operator*() [1/2]
|
inline |
De-references to the contained state.
Definition at line 369 of file ScopedState.h.
◆ operator*() [2/2]
|
inline |
De-references to the contained state.
Definition at line 375 of file ScopedState.h.
◆ operator->() [1/2]
|
inline |
Returns a pointer to the contained state.
Definition at line 381 of file ScopedState.h.
◆ operator->() [2/2]
|
inline |
Returns a pointer to the contained state.
Definition at line 387 of file ScopedState.h.
◆ operator=() [1/6]
|
inline |
Partial assignment operator. Only sets the double values of the state to a fixed value.
Definition at line 231 of file ScopedState.h.
◆ operator=() [2/6]
|
inline |
Assignment operator that allows conversion of states.
Definition at line 196 of file ScopedState.h.
◆ operator=() [3/6]
|
inline |
Assignment operator.
Definition at line 148 of file ScopedState.h.
◆ operator=() [4/6]
|
inline |
Assignment operator.
Definition at line 179 of file ScopedState.h.
◆ operator=() [5/6]
|
inline |
Assignment operator.
Definition at line 163 of file ScopedState.h.
◆ operator=() [6/6]
|
inline |
Partial assignment operator. Only sets the double values of the state to specified real values.
Definition at line 220 of file ScopedState.h.
◆ operator==()
|
inline |
Checks equality of two states.
Definition at line 241 of file ScopedState.h.
◆ operator[]() [1/5]
const ScopedState ompl::base::ScopedState< T >::operator[] | ( | const StateSpacePtr & | s | ) | const |
Extract a state that corresponds to the components in state space s. Those components will have the same value as the current state (only the ones included in the current state; others will be uninitialised). Note: a new state is constructed and data is copied.
Definition at line 542 of file ScopedState.h.
◆ operator[]() [2/5]
|
inline |
Access a double value from this state contains using its name.
Definition at line 288 of file ScopedState.h.
◆ operator[]() [3/5]
|
inline |
Access a double value from this state contains using its name.
Definition at line 302 of file ScopedState.h.
◆ operator[]() [4/5]
|
inline |
Access the indexth double value this state contains.
Definition at line 270 of file ScopedState.h.
◆ operator[]() [5/5]
|
inline |
Access the indexth double value this state contains.
Definition at line 279 of file ScopedState.h.
◆ print()
|
inline |
Print this state to a stream.
Definition at line 363 of file ScopedState.h.
◆ random()
|
inline |
Set this state to a random value (uniform)
Definition at line 331 of file ScopedState.h.
◆ reals()
|
inline |
Return the real values corresponding to this state. If a conversion is not possible, an exception is thrown.
Definition at line 353 of file ScopedState.h.
◆ satisfiesBounds()
|
inline |
Check if the maintained state satisfies bounds.
Definition at line 345 of file ScopedState.h.
The documentation for this class was generated from the following file:
- ompl/base/ScopedState.h