perception_interfaces 1.1.2
Loading...
Searching...
No Matches
Functions
init.h File Reference

Object state initializers. More...

#include <perception_msgs_utils/impl/constants.h>
#include <perception_msgs_utils/impl/convenience_state_setters.h>
#include <perception_msgs_utils/impl/utils.h>

Go to the source code of this file.

Functions

void perception_msgs::object_access::initializeState (ObjectState &state, const unsigned char &model_id)
 This function initializes a given object state.
 
template<typename T >
void perception_msgs::object_access::initializeState (T &obj, const unsigned char &model_id)
 This function initializes a given template object that contains an object state.
 

Detailed Description

Object state initializers.

Definition in file init.h.

Function Documentation

◆ initializeState() [1/2]

void perception_msgs::object_access::initializeState ( ObjectState &  state,
const unsigned char &  model_id 
)
inline

This function initializes a given object state.

Parameters
state
model_id

Definition at line 26 of file init.h.

26 {
27 state.model_id = model_id;
28 setContinuousState(state, std::vector<double>(getContinuousStateSize(model_id), CONTINUOUS_STATE_INIT));
29 setDiscreteState(state, std::vector<long int>(getDiscreteStateSize(model_id), DISCRETE_STATE_INIT));
30 setContinuousStateCovariance(state, std::vector<double>(getContinuousStateCovarianceSize(model_id), CONTINUOUS_STATE_COVARIANCE_INIT));
31 setContinuousStateCovarianceDiagonal(state, std::vector<double>(getContinuousStateSize(model_id), CONTINUOUS_STATE_COVARIANCE_INVALID));
32 }
void setContinuousStateCovarianceDiagonal(ObjectState &state, const std::vector< double > val)
Set the continuous state covariance diagonal of a given object state.
void setContinuousState(ObjectState &state, const std::vector< double > &val)
Set the continuous state of a given object state.
void setDiscreteState(ObjectState &state, const std::vector< long int > &val)
Set the discrete state of a given object state.
void setContinuousStateCovariance(ObjectState &state, const std::vector< double > &val)
Set the continuous state covariance of a given object state.
int getDiscreteStateSize(const ObjectState &state)
Get the discrete state size for a given object state.
Definition utils.h:75
int getContinuousStateSize(const ObjectState &state)
Get the continuous state size for a given object state.
Definition utils.h:30
int getContinuousStateCovarianceSize(const ObjectState &state)
Get the continuous state covariance size for a given object state.
Definition utils.h:120

◆ initializeState() [2/2]

template<typename T >
void perception_msgs::object_access::initializeState ( T &  obj,
const unsigned char &  model_id 
)
inline

This function initializes a given template object that contains an object state.

Template Parameters
T
Parameters
obj
model_id

Definition at line 42 of file init.h.

42 {
43 initializeState(obj.state, model_id);
44 }
void initializeState(ObjectState &state, const unsigned char &model_id)
This function initializes a given object state.
Definition init.h:26