Object state utility functions.
More...
Go to the source code of this file.
Object state utility functions.
Definition in file utils.h.
◆ getContinuousStateCovarianceSize() [1/3]
| int perception_msgs::object_access::getContinuousStateCovarianceSize |
( |
const ObjectState & |
state | ) |
|
|
inline |
Get the continuous state covariance size for a given object state.
- Parameters
-
- Returns
- int
Definition at line 120 of file utils.h.
120 {
121 return state.continuous_state_covariance.size();
122 }
◆ getContinuousStateCovarianceSize() [2/3]
template<typename T >
| int perception_msgs::object_access::getContinuousStateCovarianceSize |
( |
const T & |
obj | ) |
|
|
inline |
Get the continuous state covariance size for a given template object that contains an object state.
- Template Parameters
-
- Parameters
-
- Returns
- int
Definition at line 132 of file utils.h.
132 {
134 }
int getContinuousStateCovarianceSize(const ObjectState &state)
Get the continuous state covariance size for a given object state.
◆ getContinuousStateCovarianceSize() [3/3]
| int perception_msgs::object_access::getContinuousStateCovarianceSize |
( |
const unsigned char & |
model_id | ) |
|
|
inline |
Get the continuous state covariance size for a given model-id.
- Parameters
-
- Returns
- int
Definition at line 142 of file utils.h.
142 {
144 }
int getContinuousStateSize(const ObjectState &state)
Get the continuous state size for a given object state.
◆ getContinuousStateSize() [1/3]
| int perception_msgs::object_access::getContinuousStateSize |
( |
const ObjectState & |
state | ) |
|
|
inline |
Get the continuous state size for a given object state.
- Parameters
-
- Returns
- int
Definition at line 30 of file utils.h.
30 {
31 return state.continuous_state.size();
32 }
◆ getContinuousStateSize() [2/3]
template<typename T >
| int perception_msgs::object_access::getContinuousStateSize |
( |
const T & |
obj | ) |
|
|
inline |
Get the continuous state size for a given template object that contains an object state.
- Template Parameters
-
- Parameters
-
- Returns
- int
Definition at line 42 of file utils.h.
◆ getContinuousStateSize() [3/3]
| int perception_msgs::object_access::getContinuousStateSize |
( |
const unsigned char & |
model_id | ) |
|
|
inline |
Get the continuous state size for a given model-id.
- Parameters
-
- Returns
- int
Definition at line 52 of file utils.h.
52 {
53 switch(model_id) {
54 case EGO::MODEL_ID:
55 return EGO::CONTINUOUS_STATE_SIZE;
56 case EGORWS::MODEL_ID:
57 return EGORWS::CONTINUOUS_STATE_SIZE;
58 case ISCACTR::MODEL_ID:
59 return ISCACTR::CONTINUOUS_STATE_SIZE;
60 case HEXAMOTION::MODEL_ID:
61 return HEXAMOTION::CONTINUOUS_STATE_SIZE;
62 case TRAFFICLIGHT::MODEL_ID:
63 return TRAFFICLIGHT::CONTINUOUS_STATE_SIZE;
64 default:
65 throw std::invalid_argument(kExceptionUnknownModel + std::to_string(model_id));
66 }
67 }
◆ getDiscreteStateSize() [1/3]
| int perception_msgs::object_access::getDiscreteStateSize |
( |
const ObjectState & |
state | ) |
|
|
inline |
Get the discrete state size for a given object state.
- Parameters
-
- Returns
- int
Definition at line 75 of file utils.h.
75 {
76 return state.discrete_state.size();
77 }
◆ getDiscreteStateSize() [2/3]
template<typename T >
| int perception_msgs::object_access::getDiscreteStateSize |
( |
const T & |
obj | ) |
|
|
inline |
Get the discrete state size for a given template object that contains an object state.
- Template Parameters
-
- Parameters
-
- Returns
- int
Definition at line 87 of file utils.h.
87 {
89 }
int getDiscreteStateSize(const ObjectState &state)
Get the discrete state size for a given object state.
◆ getDiscreteStateSize() [3/3]
| int perception_msgs::object_access::getDiscreteStateSize |
( |
const unsigned char & |
model_id | ) |
|
|
inline |
Get the discrete state size for a given model-id.
- Parameters
-
- Returns
- int
Definition at line 97 of file utils.h.
97 {
98 switch(model_id) {
99 case EGO::MODEL_ID:
100 return EGO::DISCRETE_STATE_SIZE;
101 case EGORWS::MODEL_ID:
102 return EGORWS::DISCRETE_STATE_SIZE;
103 case ISCACTR::MODEL_ID:
104 return ISCACTR::DISCRETE_STATE_SIZE;
105 case HEXAMOTION::MODEL_ID:
106 return HEXAMOTION::DISCRETE_STATE_SIZE;
107 case TRAFFICLIGHT::MODEL_ID:
108 return TRAFFICLIGHT::DISCRETE_STATE_SIZE;
109 default:
110 throw std::invalid_argument(kExceptionUnknownModel + std::to_string(model_id));
111 }
112 }
◆ setContinuousStateCovarianceToUnknownAt()
| void perception_msgs::object_access::setContinuousStateCovarianceToUnknownAt |
( |
ObjectState & |
state, |
|
|
const unsigned int |
i, |
|
|
const unsigned int |
j |
|
) |
| |
|
inline |
Set the continuous state covariance to unknown at (i,j) for a given object state.
- Parameters
-
Definition at line 153 of file utils.h.
153 {
155 state.continuous_state_covariance[n * i + j] = CONTINUOUS_STATE_COVARIANCE_UNKNOWN;
156 }
◆ kExceptionUnknownModel
| const std::string perception_msgs::object_access::kExceptionUnknownModel = "Unknown model ID: " |