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

============================================================================ 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 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 47 of file init.h.

47 {
48 state.model_id = model_id;
49 setContinuousState(state, std::vector<double>(getContinuousStateSize(model_id), CONTINUOUS_STATE_INIT));
50 setDiscreteState(state, std::vector<long int>(getDiscreteStateSize(model_id), DISCRETE_STATE_INIT));
51 setContinuousStateCovariance(state, std::vector<double>(getContinuousStateCovarianceSize(model_id), CONTINUOUS_STATE_COVARIANCE_INIT));
52 setContinuousStateCovarianceDiagonal(state, std::vector<double>(getContinuousStateSize(model_id), CONTINUOUS_STATE_COVARIANCE_INVALID));
53 }
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:96
int getContinuousStateSize(const ObjectState &state)
Get the continuous state size for a given object state.
Definition utils.h:51
int getContinuousStateCovarianceSize(const ObjectState &state)
Get the continuous state covariance size for a given object state.
Definition utils.h:141

◆ 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 63 of file init.h.

63 {
64 initializeState(obj.state, model_id);
65 }
void initializeState(ObjectState &state, const unsigned char &model_id)
This function initializes a given object state.
Definition init.h:47