perception_interfaces 1.1.2
Loading...
Searching...
No Matches
init.h
Go to the documentation of this file.
1// Copyright Institute for Automotive Engineering (ika), RWTH Aachen University
2// SPDX-License-Identifier: MIT
3
9#pragma once
10
14
15
16namespace perception_msgs {
17
18namespace object_access {
19
26 inline void initializeState(ObjectState& state, const unsigned char& model_id) {
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 }
33
41 template <typename T>
42 inline void initializeState(T& obj, const unsigned char& model_id) {
43 initializeState(obj.state, model_id);
44 }
45
46} // namespace object_access
47
48} // namespace perception_msgs
Object state constants.
Convenience setter functions for objects state members.
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.
void initializeState(ObjectState &state, const unsigned char &model_id)
This function initializes a given object state.
Definition init.h:26
Object state utility functions.
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