perception_interfaces 1.0.0
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.

============================================================================ MIT License

Copyright (c) 2025 Institute for Automotive Engineering (ika), RWTH Aachen University

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE

SOFTWARE.

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 84 of file checks.h.

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

◆ 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 95 of file checks.h.

95 {
97 }
void sanityCheckContinuousState(const ObjectState &state)
Perform sanity check on continuous state of given object state.
Definition checks.h:84

◆ 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 124 of file checks.h.

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

◆ 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 135 of file checks.h.

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

◆ 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 72 of file checks.h.

72 {
73 int exp_state_cov_size = getContinuousStateCovarianceSize(state.model_id);
74 int state_cov_size = getContinuousStateCovarianceSize(state);
75 if (state_cov_size != exp_state_cov_size)
76 throw std::invalid_argument(kExceptionInvalidStateCovarianceSize + std::to_string(state.model_id) + ", " + std::to_string(state_cov_size) + " != " + std::to_string(exp_state_cov_size));
77 }
int getContinuousStateCovarianceSize(const ObjectState &state)
Get the continuous state covariance size for a given object state.
Definition utils.h:141

◆ 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 48 of file checks.h.

48 {
49 int exp_state_size = getContinuousStateSize(state.model_id);
50 int state_size = getContinuousStateSize(state);
51 if (state_size != exp_state_size)
52 throw std::invalid_argument(kExceptionInvalidStateSize + std::to_string(state.model_id) + ", " + std::to_string(state_size) + " != " + std::to_string(exp_state_size));
53 }
int getContinuousStateSize(const ObjectState &state)
Get the continuous state size for a given object state.
Definition utils.h:51

◆ 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 104 of file checks.h.

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

◆ 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 115 of file checks.h.

115 {
116 sanityCheckDiscreteState(obj.state);
117 }
void sanityCheckDiscreteState(const ObjectState &state)
Perform sanity check on discrete state of given object state.
Definition checks.h:104

◆ 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 60 of file checks.h.

60 {
61 int exp_discrete_state_size = getDiscreteStateSize(state.model_id);
62 int discrete_state_size = getDiscreteStateSize(state);
63 if (discrete_state_size != exp_discrete_state_size)
64 throw std::invalid_argument(kExceptionInvalidDiscreteStateSize + std::to_string(state.model_id) + ", " + std::to_string(discrete_state_size) + " != " + std::to_string(exp_discrete_state_size));
65 }
int getDiscreteStateSize(const ObjectState &state)
Get the discrete state size for a given object state.
Definition utils.h:96

◆ 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 144 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 157 of file checks.h.

157 {
158 sanityCheckFullState(obj.state);
159 }
void sanityCheckFullState(const ObjectState &state)
Perform sanity check on full state of given object state.
Definition checks.h:144

Variable Documentation

◆ kExceptionInvalidDiscreteStateSize

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

Definition at line 40 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 41 of file checks.h.

◆ kExceptionInvalidStateSize

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

Definition at line 39 of file checks.h.