perception_interfaces 1.1.2
Loading...
Searching...
No Matches
Functions | Variables
checks.h File Reference

Object state sanity checks. More...

#include <perception_msgs_utils/impl/utils.h>

Go to the source code of this file.

Functions

void perception_msgs::object_access::sanityCheckContinuousStateSize (const ObjectState &state)
 Perform sanity check on continuous state size of given object state.
 
void perception_msgs::object_access::sanityCheckDiscreteStateSize (const ObjectState &state)
 Perform sanity check on discrete state size of given object state.
 
void perception_msgs::object_access::sanityCheckContinuousStateCovarianceSize (const ObjectState &state)
 Perform sanity check on continuous state covariance size of given object state.
 
void perception_msgs::object_access::sanityCheckContinuousState (const ObjectState &state)
 Perform sanity check on continuous state of given object state.
 
template<typename T >
void perception_msgs::object_access::sanityCheckContinuousState (const T &obj)
 Perform sanity check on continuous state of given template object that contains an object state.
 
void perception_msgs::object_access::sanityCheckDiscreteState (const ObjectState &state)
 Perform sanity check on discrete state of given object state.
 
template<typename T >
void perception_msgs::object_access::sanityCheckDiscreteState (const T &obj)
 Perform sanity check on discrete state of given template object that contains an object state.
 
void perception_msgs::object_access::sanityCheckContinuousStateCovariance (const ObjectState &state)
 Perform sanity check on continuous state covariance of given object state.
 
template<typename T >
void perception_msgs::object_access::sanityCheckContinuousStateCovariance (const T &obj)
 Perform sanity check on continuous state covariance of given template object that contains an object state.
 
void perception_msgs::object_access::sanityCheckFullState (const ObjectState &state)
 Perform sanity check on full state of given object state.
 
template<typename T >
void perception_msgs::object_access::sanityCheckFullState (const T &obj)
 Perform sanity check on full state of of given template object that contains an object state.
 

Variables

const std::string perception_msgs::object_access::kExceptionInvalidStateSize = "Invalid continuous state size for model with ID: "
 
const std::string perception_msgs::object_access::kExceptionInvalidDiscreteStateSize = "Invalid discrete state size for model with ID: "
 
const std::string perception_msgs::object_access::kExceptionInvalidStateCovarianceSize = "Invalid continuous state covariance size for model with ID: "
 

Detailed Description

Object state sanity checks.

Definition in file checks.h.

Function Documentation

◆ sanityCheckContinuousState() [1/2]

void perception_msgs::object_access::sanityCheckContinuousState ( const ObjectState &  state)
inline

Perform sanity check on continuous state of given object state.

Parameters
state

Definition at line 63 of file checks.h.

63 {
65 }
void sanityCheckContinuousStateSize(const ObjectState &state)
Perform sanity check on continuous state size of given object state.
Definition checks.h:27

◆ sanityCheckContinuousState() [2/2]

template<typename T >
void perception_msgs::object_access::sanityCheckContinuousState ( const T &  obj)
inline

Perform sanity check on continuous state of given template object that contains an object state.

Template Parameters
T
Parameters
obj

Definition at line 74 of file checks.h.

74 {
76 }
void sanityCheckContinuousState(const ObjectState &state)
Perform sanity check on continuous state of given object state.
Definition checks.h:63

◆ sanityCheckContinuousStateCovariance() [1/2]

void perception_msgs::object_access::sanityCheckContinuousStateCovariance ( const ObjectState &  state)
inline

Perform sanity check on continuous state covariance of given object state.

Parameters
state

Definition at line 103 of file checks.h.

103 {
105 }
void sanityCheckContinuousStateCovarianceSize(const ObjectState &state)
Perform sanity check on continuous state covariance size of given object state.
Definition checks.h:51

◆ sanityCheckContinuousStateCovariance() [2/2]

template<typename T >
void perception_msgs::object_access::sanityCheckContinuousStateCovariance ( const T &  obj)
inline

Perform sanity check on continuous state covariance of given template object that contains an object state.

Template Parameters
T
Parameters
obj

Definition at line 114 of file checks.h.

114 {
116 }
void sanityCheckContinuousStateCovariance(const ObjectState &state)
Perform sanity check on continuous state covariance of given object state.
Definition checks.h:103

◆ sanityCheckContinuousStateCovarianceSize()

void perception_msgs::object_access::sanityCheckContinuousStateCovarianceSize ( const ObjectState &  state)
inline

Perform sanity check on continuous state covariance size of given object state.

Parameters
state

Definition at line 51 of file checks.h.

51 {
52 int exp_state_cov_size = getContinuousStateCovarianceSize(state.model_id);
53 int state_cov_size = getContinuousStateCovarianceSize(state);
54 if (state_cov_size != exp_state_cov_size)
55 throw std::invalid_argument(kExceptionInvalidStateCovarianceSize + std::to_string(state.model_id) + ", " + std::to_string(state_cov_size) + " != " + std::to_string(exp_state_cov_size));
56 }
int getContinuousStateCovarianceSize(const ObjectState &state)
Get the continuous state covariance size for a given object state.
Definition utils.h:120

◆ sanityCheckContinuousStateSize()

void perception_msgs::object_access::sanityCheckContinuousStateSize ( const ObjectState &  state)
inline

Perform sanity check on continuous state size of given object state.

Parameters
state

Definition at line 27 of file checks.h.

27 {
28 int exp_state_size = getContinuousStateSize(state.model_id);
29 int state_size = getContinuousStateSize(state);
30 if (state_size != exp_state_size)
31 throw std::invalid_argument(kExceptionInvalidStateSize + std::to_string(state.model_id) + ", " + std::to_string(state_size) + " != " + std::to_string(exp_state_size));
32 }
int getContinuousStateSize(const ObjectState &state)
Get the continuous state size for a given object state.
Definition utils.h:30

◆ sanityCheckDiscreteState() [1/2]

void perception_msgs::object_access::sanityCheckDiscreteState ( const ObjectState &  state)
inline

Perform sanity check on discrete state of given object state.

Parameters
state

Definition at line 83 of file checks.h.

83 {
85 }
void sanityCheckDiscreteStateSize(const ObjectState &state)
Perform sanity check on discrete state size of given object state.
Definition checks.h:39

◆ sanityCheckDiscreteState() [2/2]

template<typename T >
void perception_msgs::object_access::sanityCheckDiscreteState ( const T &  obj)
inline

Perform sanity check on discrete state of given template object that contains an object state.

Template Parameters
T
Parameters
obj

Definition at line 94 of file checks.h.

94 {
95 sanityCheckDiscreteState(obj.state);
96 }
void sanityCheckDiscreteState(const ObjectState &state)
Perform sanity check on discrete state of given object state.
Definition checks.h:83

◆ sanityCheckDiscreteStateSize()

void perception_msgs::object_access::sanityCheckDiscreteStateSize ( const ObjectState &  state)
inline

Perform sanity check on discrete state size of given object state.

Parameters
state

Definition at line 39 of file checks.h.

39 {
40 int exp_discrete_state_size = getDiscreteStateSize(state.model_id);
41 int discrete_state_size = getDiscreteStateSize(state);
42 if (discrete_state_size != exp_discrete_state_size)
43 throw std::invalid_argument(kExceptionInvalidDiscreteStateSize + std::to_string(state.model_id) + ", " + std::to_string(discrete_state_size) + " != " + std::to_string(exp_discrete_state_size));
44 }
int getDiscreteStateSize(const ObjectState &state)
Get the discrete state size for a given object state.
Definition utils.h:75

◆ sanityCheckFullState() [1/2]

void perception_msgs::object_access::sanityCheckFullState ( const ObjectState &  state)
inline

Perform sanity check on full state of given object state.

Parameters
state

Definition at line 123 of file checks.h.

◆ sanityCheckFullState() [2/2]

template<typename T >
void perception_msgs::object_access::sanityCheckFullState ( const T &  obj)
inline

Perform sanity check on full state of of given template object that contains an object state.

Template Parameters
T
Parameters
obj

Definition at line 136 of file checks.h.

136 {
137 sanityCheckFullState(obj.state);
138 }
void sanityCheckFullState(const ObjectState &state)
Perform sanity check on full state of given object state.
Definition checks.h:123

Variable Documentation

◆ kExceptionInvalidDiscreteStateSize

const std::string perception_msgs::object_access::kExceptionInvalidDiscreteStateSize = "Invalid discrete state size for model with ID: "

Definition at line 19 of file checks.h.

◆ kExceptionInvalidStateCovarianceSize

const std::string perception_msgs::object_access::kExceptionInvalidStateCovarianceSize = "Invalid continuous state covariance size for model with ID: "

Definition at line 20 of file checks.h.

◆ kExceptionInvalidStateSize

const std::string perception_msgs::object_access::kExceptionInvalidStateSize = "Invalid continuous state size for model with ID: "

Definition at line 18 of file checks.h.