Setter functions for the ETSI ITS CPM (TS) More...
#include <etsi_its_msgs_utils/impl/checks.h>
#include <etsi_its_msgs_utils/impl/constants.h>
#include <etsi_its_msgs_utils/impl/cdd/cdd_v2-1-1_setters.h>
Go to the source code of this file.
Functions | |
template<typename T1, typename T2> | |
void | etsi_its_cpm_ts_msgs::access::throwIfOutOfRange (const T1 &val, const T2 &min, const T2 &max, const std::string val_desc) |
Throws an exception if a given value is out of a defined range. | |
void | etsi_its_cpm_ts_msgs::access::throwIfNotPresent (const bool is_present, const std::string val_desc) |
Throws an exception if the given value is not present. | |
uint16_t | etsi_its_cpm_ts_msgs::access::etsi_its_msgs::getLeapSecondInsertionsSince2004 (const uint64_t unix_seconds) |
Get the leap second insertions since 2004 for given unix seconds. | |
void | etsi_its_cpm_ts_msgs::access::setTimestampITS (TimestampIts ×tamp_its, const uint64_t unix_nanosecs, const uint16_t n_leap_seconds=etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.rbegin() ->second) |
Set the TimestampITS object. | |
void | etsi_its_cpm_ts_msgs::access::setLatitude (Latitude &latitude, const double deg) |
Set the Latitude object. | |
void | etsi_its_cpm_ts_msgs::access::setLongitude (Longitude &longitude, const double deg) |
Set the Longitude object. | |
void | etsi_its_cpm_ts_msgs::access::setAltitudeValue (AltitudeValue &altitude, const double value) |
Set the AltitudeValue object. | |
void | etsi_its_cpm_ts_msgs::access::setAltitude (Altitude &altitude, const double value) |
Set the Altitude object. | |
void | etsi_its_cpm_ts_msgs::access::setSpeedValue (SpeedValue &speed, const double value) |
Set the SpeedValue object. | |
void | etsi_its_cpm_ts_msgs::access::setSpeedConfidence (SpeedConfidence &speed_confidence, const double value) |
Set the Speed Confidence object. | |
void | etsi_its_cpm_ts_msgs::access::setSpeed (Speed &speed, const double value, const double confidence=std::numeric_limits< double >::infinity()) |
Set the Speed object. | |
template<typename AccelerationConfidence> | |
void | etsi_its_cpm_ts_msgs::access::setAccelerationConfidence (AccelerationConfidence &accel_confidence, const double value) |
Set the Acceleration Confidence object. | |
template<typename T> | |
void | etsi_its_cpm_ts_msgs::access::setReferencePosition (T &ref_position, const double latitude, const double longitude, const double altitude=AltitudeValue::UNAVAILABLE) |
Sets the reference position in the given ReferencePostion object. | |
template<typename T> | |
void | etsi_its_cpm_ts_msgs::access::setFromUTMPosition (T &reference_position, const gm::PointStamped &utm_position, const int zone, const bool northp) |
Set the ReferencePosition from a given UTM-Position. | |
template<typename HeadingValue> | |
void | etsi_its_cpm_ts_msgs::access::setHeadingValue (HeadingValue &heading, const double value) |
Set the HeadingValue object. | |
template<typename HeadingConfidence> | |
void | etsi_its_cpm_ts_msgs::access::setHeadingConfidence (HeadingConfidence &heading_confidence, const double value) |
Set the Heading Confidence object. | |
template<typename Heading, typename HeadingConfidence = decltype(Heading::heading_confidence)> | |
void | etsi_its_cpm_ts_msgs::access::setHeadingCDD (Heading &heading, const double value, double confidence=std::numeric_limits< double >::infinity()) |
Set the Heading object. | |
template<typename SemiAxisLength> | |
void | etsi_its_cpm_ts_msgs::access::setSemiAxis (SemiAxisLength &semi_axis_length, const double length) |
Set the Semi Axis length. | |
template<typename PosConfidenceEllipse> | |
void | etsi_its_cpm_ts_msgs::access::setPosConfidenceEllipse (PosConfidenceEllipse &position_confidence_ellipse, const double semi_major_axis, const double semi_minor_axis, const double orientation) |
Set the Pos Confidence Ellipse object. | |
std::tuple< double, double, double > | etsi_its_cpm_ts_msgs::access::confidenceEllipseFromCovMatrix (const std::array< double, 4 > &covariance_matrix, const double object_heading) |
Gets the values needed to set a confidence ellipse from a covariance matrix. | |
std::tuple< double, double, double > | etsi_its_cpm_ts_msgs::access::confidenceEllipseFromWGSCovMatrix (const std::array< double, 4 > &covariance_matrix) |
Gets the values needed to set a confidence ellipse from a covariance matrix. | |
template<typename PosConfidenceEllipse> | |
void | etsi_its_cpm_ts_msgs::access::setPosConfidenceEllipse (PosConfidenceEllipse &position_confidence_ellipse, const std::array< double, 4 > &covariance_matrix, const double object_heading) |
Set the Pos Confidence Ellipse object. | |
template<typename PosConfidenceEllipse> | |
void | etsi_its_cpm_ts_msgs::access::setWGSPosConfidenceEllipse (PosConfidenceEllipse &position_confidence_ellipse, const std::array< double, 4 > &covariance_matrix) |
Set the Pos Confidence Ellipse object. | |
void | etsi_its_cpm_ts_msgs::access::setStationId (StationId &station_id, const uint32_t id_value) |
Set the Station Id object. | |
void | etsi_its_cpm_ts_msgs::access::setItsPduHeader (ItsPduHeader &header, const uint8_t message_id, const uint32_t station_id, const uint8_t protocol_version=0) |
Set the Its Pdu Header object. | |
void | etsi_its_cpm_ts_msgs::access::setStationType (TrafficParticipantType &station_type, const uint8_t value) |
Set the Station Type. | |
void | etsi_its_cpm_ts_msgs::access::setLongitudinalAccelerationValue (AccelerationValue &accel, const double value) |
Set the LongitudinalAccelerationValue object. | |
void | etsi_its_cpm_ts_msgs::access::setLongitudinalAcceleration (AccelerationComponent &accel, const double value, const double confidence) |
Set the LongitudinalAcceleration object. | |
void | etsi_its_cpm_ts_msgs::access::setLateralAccelerationValue (AccelerationValue &accel, const double value) |
Set the LateralAccelerationValue object. | |
void | etsi_its_cpm_ts_msgs::access::setLateralAcceleration (AccelerationComponent &accel, const double value, const double confidence) |
Set the LateralAcceleration object. | |
template<typename PositionConfidenceEllipse, typename Wgs84AngleValue = decltype(PositionConfidenceEllipse::semi_major_axis_orientation)> | |
void | etsi_its_cpm_ts_msgs::access::setPositionConfidenceEllipse (PositionConfidenceEllipse &position_confidence_ellipse, const double semi_major_axis, const double semi_minor_axis, const double orientation) |
Set the Position Confidence Ellipse object. | |
template<typename PositionConfidenceEllipse> | |
void | etsi_its_cpm_ts_msgs::access::setPositionConfidenceEllipse (PositionConfidenceEllipse &position_confidence_ellipse, const std::array< double, 4 > &covariance_matrix, const double object_heading) |
Set the Position Confidence Ellipse object. | |
template<typename PositionConfidenceEllipse> | |
void | etsi_its_cpm_ts_msgs::access::setWGSPositionConfidenceEllipse (PositionConfidenceEllipse &position_confidence_ellipse, const std::array< double, 4 > &covariance_matrix) |
Set the Position Confidence Ellipse object. | |
void | etsi_its_cpm_ts_msgs::access::setItsPduHeader (CollectivePerceptionMessage &cpm, const uint32_t station_id, const uint8_t protocol_version=0) |
Sets the ITS PDU header of a CPM. | |
void | etsi_its_cpm_ts_msgs::access::setReferenceTime (CollectivePerceptionMessage &cpm, const uint64_t unix_nanosecs, const uint16_t n_leap_seconds=etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.rbegin() ->second) |
Sets the reference time in a CPM. | |
void | etsi_its_cpm_ts_msgs::access::setReferencePosition (CollectivePerceptionMessage &cpm, const double latitude, const double longitude, const double altitude=AltitudeValue::UNAVAILABLE) |
Set the ReferencePositionWithConfidence for a CPM TS. | |
void | etsi_its_cpm_ts_msgs::access::setFromUTMPosition (CollectivePerceptionMessage &cpm, const gm::PointStamped &utm_position, const int &zone, const bool &northp) |
Set the ReferencePosition of a CPM from a given UTM-Position. | |
void | etsi_its_cpm_ts_msgs::access::setIdOfPerceivedObject (PerceivedObject &object, const uint16_t id) |
Set the ID of a PerceivedObject. | |
void | etsi_its_cpm_ts_msgs::access::setMeasurementDeltaTimeOfPerceivedObject (PerceivedObject &object, const int16_t delta_time=0) |
Sets the measurement delta time of a PerceivedObject. | |
void | etsi_its_cpm_ts_msgs::access::setCartesianCoordinateWithConfidence (CartesianCoordinateWithConfidence &coordinate, const double value, const double confidence=std::numeric_limits< double >::infinity()) |
Sets the value and confidence of a CartesianCoordinateWithConfidence object. | |
void | etsi_its_cpm_ts_msgs::access::setPositionOfPerceivedObject (PerceivedObject &object, const gm::Point &point, const double x_std=std::numeric_limits< double >::infinity(), const double y_std=std::numeric_limits< double >::infinity(), const double z_std=std::numeric_limits< double >::infinity()) |
Sets the position of a perceived object (relative to the CPM's reference position). | |
void | etsi_its_cpm_ts_msgs::access::setUTMPositionOfPerceivedObject (CollectivePerceptionMessage &cpm, PerceivedObject &object, const gm::PointStamped &utm_position, const double x_std=std::numeric_limits< double >::infinity(), const double y_std=std::numeric_limits< double >::infinity(), const double z_std=std::numeric_limits< double >::infinity()) |
Sets the position of a perceived object based on a UTM position. | |
void | etsi_its_cpm_ts_msgs::access::setVelocityComponent (VelocityComponent &velocity, const double value, const double confidence=std::numeric_limits< double >::infinity()) |
Sets the value and confidence of a VelocityComponent. | |
void | etsi_its_cpm_ts_msgs::access::setVelocityOfPerceivedObject (PerceivedObject &object, const gm::Vector3 &cartesian_velocity, const double x_std=std::numeric_limits< double >::infinity(), const double y_std=std::numeric_limits< double >::infinity(), const double z_std=std::numeric_limits< double >::infinity()) |
void | etsi_its_cpm_ts_msgs::access::setAccelerationComponent (AccelerationComponent &acceleration, const double value, const double confidence=std::numeric_limits< double >::infinity()) |
Sets the value and confidence of a AccelerationComponent. | |
void | etsi_its_cpm_ts_msgs::access::setAccelerationOfPerceivedObject (PerceivedObject &object, const gm::Vector3 &cartesian_acceleration, const double x_std=std::numeric_limits< double >::infinity(), const double y_std=std::numeric_limits< double >::infinity(), const double z_std=std::numeric_limits< double >::infinity()) |
Sets the acceleration of a perceived object. | |
void | etsi_its_cpm_ts_msgs::access::setYawOfPerceivedObject (PerceivedObject &object, const double yaw, double yaw_std=std::numeric_limits< double >::infinity()) |
Sets the yaw angle of a perceived object. | |
void | etsi_its_cpm_ts_msgs::access::setYawRateOfPerceivedObject (PerceivedObject &object, const double yaw_rate, double yaw_rate_std=std::numeric_limits< double >::infinity()) |
Sets the yaw rate of a perceived object. | |
void | etsi_its_cpm_ts_msgs::access::setObjectDimension (ObjectDimension &dimension, const double value, const double confidence=std::numeric_limits< double >::infinity()) |
Sets the object dimension with the given value and confidence. | |
void | etsi_its_cpm_ts_msgs::access::setXDimensionOfPerceivedObject (PerceivedObject &object, const double value, const double std=std::numeric_limits< double >::infinity()) |
Sets the x-dimension of a perceived object. | |
void | etsi_its_cpm_ts_msgs::access::setYDimensionOfPerceivedObject (PerceivedObject &object, const double value, const double std=std::numeric_limits< double >::infinity()) |
Sets the y-dimension of a perceived object. | |
void | etsi_its_cpm_ts_msgs::access::setZDimensionOfPerceivedObject (PerceivedObject &object, const double value, const double std=std::numeric_limits< double >::infinity()) |
Sets the z-dimension of a perceived object. | |
void | etsi_its_cpm_ts_msgs::access::setDimensionsOfPerceivedObject (PerceivedObject &object, const gm::Vector3 &dimensions, const double x_std=std::numeric_limits< double >::infinity(), const double y_std=std::numeric_limits< double >::infinity(), const double z_std=std::numeric_limits< double >::infinity()) |
Sets all dimensions of a perceived object. | |
void | etsi_its_cpm_ts_msgs::access::initPerceivedObject (PerceivedObject &object, const gm::Point &point, const int16_t delta_time=0) |
Initializes a PerceivedObject with the given point and delta time. | |
void | etsi_its_cpm_ts_msgs::access::initPerceivedObjectWithUTMPosition (CollectivePerceptionMessage &cpm, PerceivedObject &object, const gm::PointStamped &point, const int16_t delta_time=0) |
Initializes a PerceivedObject with the given point (utm-position) and delta time. | |
void | etsi_its_cpm_ts_msgs::access::initPerceivedObjectContainer (WrappedCpmContainer &container, const uint8_t n_objects=0) |
Initializes a WrappedCpmContainer as a PerceivedObjectContainer with the given number of objects. | |
void | etsi_its_cpm_ts_msgs::access::addPerceivedObjectToContainer (WrappedCpmContainer &container, const PerceivedObject &perceived_object) |
Adds a PerceivedObject to the PerceivedObjectContainer / WrappedCpmContainer. | |
void | etsi_its_cpm_ts_msgs::access::addContainerToCPM (CollectivePerceptionMessage &cpm, const WrappedCpmContainer &container) |
Adds a container to the Collective Perception Message (CPM). | |
void | etsi_its_cpm_ts_msgs::access::setWGSRefPosConfidence (CollectivePerceptionMessage &cpm, const std::array< double, 4 > &covariance_matrix) |
Set the confidence of the reference position. | |
Variables | |
const uint64_t | etsi_its_cpm_ts_msgs::access::etsi_its_msgs::UNIX_SECONDS_2004 = 1072915200 |
const std::map< uint64_t, uint16_t > | etsi_its_cpm_ts_msgs::access::etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004 |
std::map that stores all leap second insertions since 2004 with the corresponding unix-date of the insertion | |
constexpr const double | etsi_its_cpm_ts_msgs::access::etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR = 2.0 |
constexpr const double | etsi_its_cpm_ts_msgs::access::etsi_its_msgs::TWO_D_GAUSSIAN_FACTOR = 2.4477 |
Setter functions for the ETSI ITS CPM (TS)
Definition in file cpm_ts_setters.h.
|
inline |
Adds a container to the Collective Perception Message (CPM).
This function adds a WrappedCpmContainer to the CPM's payload. It first checks if the current number of containers is less than the maximum allowed. If so, it appends the container to the array. Otherwise, it throws an exception.
cpm | The Collective Perception Message to which the container will be added. |
container | The WrappedCpmContainer to be added to the CPM. |
std::invalid_argument | if the maximum number of CPM-Containers is reached. |
Definition at line 790 of file cpm_ts_setters.h.
|
inline |
Adds a PerceivedObject to the PerceivedObjectContainer / WrappedCpmContainer.
This function checks if the provided container is a PerceivedObjectContainer. If it is, the function adds the given PerceivedObject to the container's perceived_objects array and updates the number_of_perceived_objects value. If the container is not a PerceivedObjectContainer, the function throws an std::invalid_argument exception.
container | The WrappedCpmContainer to which the PerceivedObject will be added. |
perceived_object | The PerceivedObject to add to the container. |
std::invalid_argument | if the container is not a PerceivedObjectContainer. |
Definition at line 768 of file cpm_ts_setters.h.
|
inline |
Gets the values needed to set a confidence ellipse from a covariance matrix.
covariance_matrix | The four values of the covariance matrix in the order: cov_xx, cov_xy, cov_yx, cov_yy The matrix has to be SPD, otherwise a std::invalid_argument exception is thrown. Its coordinate system is aligned with the object (x = longitudinal, y = lateral) |
object_heading | The heading of the object in rad, with respect to WGS84 |
Definition at line 376 of file cpm_ts_setters.h.
|
inline |
Gets the values needed to set a confidence ellipse from a covariance matrix.
covariance_matrix | The four values of the covariance matrix in the order: cov_xx, cov_xy, cov_yx, cov_yy The matrix has to be SPD, otherwise a std::invalid_argument exception is thrown. Its coordinate system is aligned with the WGS axes (x = North, y = East) |
object_heading | The heading of the object in rad, with respect to WGS84 |
Definition at line 417 of file cpm_ts_setters.h.
|
inline |
Get the leap second insertions since 2004 for given unix seconds.
unix_seconds | the current unix seconds for that the leap second insertions since 2004 shall be provided |
Definition at line 61 of file cpm_ts_setters.h.
|
inline |
Initializes a PerceivedObject with the given point and delta time.
This function sets the position and measurement delta time of the PerceivedObject.
object | The PerceivedObject to be initialized. |
point | The position of the PerceivedObject relative to the CPM's reference position in meters. |
delta_time | The measurement delta time of the PerceivedObject in milliseconds (default = 0). |
Definition at line 718 of file cpm_ts_setters.h.
|
inline |
Initializes a WrappedCpmContainer as a PerceivedObjectContainer with the given number of objects.
This function sets the container ID to CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER and initializes the number of perceived objects in the container to the specified value.
container | A reference to the WrappedCpmContainer to be initialized as a PerceivedObjectContainer. |
n_objects | The number of perceived objects to initialize in the container. Default is 0. |
Definition at line 750 of file cpm_ts_setters.h.
|
inline |
Initializes a PerceivedObject with the given point (utm-position) and delta time.
This function initializes a PerceivedObject within a position and measurement delta time. It sets the position of a perceived object using the provided UTM position and the CPM's reference position. It sets the measurement delta time using the provided delta_time value.
cpm | The CPM to get the reference position from. |
object | The PerceivedObject to be initialized. |
point | The gm::PointStamped representing the UTM position of the object including the frame_id (utm_<zone><N/S>). |
delta_time | The measurement delta time in milliseconds (default: 0). |
Definition at line 735 of file cpm_ts_setters.h.
|
inline |
Sets the value and confidence of a AccelerationComponent.
This function sets the value and confidence of a AccelerationComponent object. The value is limited to a specific range, and the confidence is limited to a specific range as well. If the provided value or confidence is out of range, it will be set to the corresponding out-of-range value.
acceleration | The AccelerationComponent object to set the value and confidence for. |
value | The value to set for the AccelerationComponent in dm/s^2. |
confidence | The confidence to set for the AccelerationComponent in dm/s^2. Default value is infinity, mapping to AccelerationConfidence::UNAVAILABLE. |
Definition at line 475 of file cpm_ts_setters.h.
|
inline |
Set the Acceleration Confidence object.
accel_confidence | object to set |
value | standard deviation in m/s^2 as decimal number |
Definition at line 220 of file cpm_ts_setters.h.
|
inline |
Sets the acceleration of a perceived object.
This function sets the acceleration of a perceived object using the provided Cartesian acceleration components. Optionally, confidence values can be specified for each acceleration component.
object | The perceived object for which the acceleration is being set. |
cartesian_acceleration | The Cartesian acceleration components (x, y, z) of the object (in m/s^2). |
x_std | The standard deviation in m/s^2 for the x acceleration component (default: infinity). |
y_std | The standard deviation in m/s^2 for the y acceleration component (default: infinity). |
z_std | The standard deviation in m/s^2 for the z acceleration component (default: infinity). |
Definition at line 508 of file cpm_ts_setters.h.
|
inline |
Set the Altitude object.
AltitudeConfidence is set to UNAVAILABLE
altitude | object to set |
value | Altitude value (above the reference ellipsoid surface) in meter as decimal number |
Definition at line 166 of file cpm_ts_setters.h.
|
inline |
Set the AltitudeValue object.
altitude | object to set |
value | AltitudeValue value (above the reference ellipsoid surface) in meter as decimal number |
Definition at line 147 of file cpm_ts_setters.h.
|
inline |
Sets the value and confidence of a CartesianCoordinateWithConfidence object.
This function sets the value and confidence of a CartesianCoordinateWithConfidence object. The value is limited to the range defined by CartesianCoordinateLarge::NEGATIVE_OUT_OF_RANGE and CartesianCoordinateLarge::POSITIVE_OUT_OF_RANGE. The confidence is limited to the range defined by CoordinateConfidence::MIN and CoordinateConfidence::MAX. If the provided confidence is out of range, the confidence value is set to CoordinateConfidence::OUT_OF_RANGE.
coordinate | The CartesianCoordinateWithConfidence object to be modified. |
value | The value to be set in centimeters. |
confidence | The confidence to be set in centimeters (default: infinity, which will map to CoordinateConfidence::UNAVAILABLE). |
Definition at line 325 of file cpm_ts_setters.h.
|
inline |
Sets all dimensions of a perceived object.
This function sets the dimensions of a perceived object using the provided dimensions and confidence values.
object | The perceived object to set the dimensions for. |
dimensions | The dimensions of the object as a gm::Vector3 (x, y, z) in meters. |
x_std | The standard deviation in meters for the x dimension (optional, default: infinity). |
y_std | The standard deviation in meters for the y dimension (optional, default: infinity). |
z_std | The standard deviation in meters for the z dimension (optional, default: infinity). |
Definition at line 700 of file cpm_ts_setters.h.
|
inline |
Set the ReferencePosition of a CPM from a given UTM-Position.
The position is transformed to latitude and longitude by using GeographicLib::UTMUPS The z-Coordinate is directly used as altitude value The frame_id of the given utm_position must be set to 'utm_<zone><N/S>'
[out] | cpm | CPM for which to set the ReferencePosition |
[in] | utm_position | geometry_msgs::PointStamped describing the given utm position in meters |
[in] | zone | the UTM zone (zero means UPS) of the given position |
[in] | northp | hemisphere (true means north, false means south) |
Definition at line 275 of file cpm_ts_setters.h.
|
inline |
Set the ReferencePosition from a given UTM-Position.
The position is transformed to latitude and longitude by using GeographicLib::UTMUPS The z-Coordinate is directly used as altitude value The frame_id of the given utm_position must be set to 'utm_<zone><N/S>'
[out] | reference_position | ReferencePostion or ReferencePositionWithConfidence to set |
[in] | utm_position | geometry_msgs::PointStamped describing the given utm position |
[in] | zone | the UTM zone (zero means UPS) of the given position |
[in] | northp | hemisphere (true means north, false means south) |
Definition at line 268 of file cpm_ts_setters.h.
void etsi_its_cpm_ts_msgs::access::setHeadingCDD | ( | Heading & | heading, |
const double | value, | ||
double | confidence = std::numeric_limits<double>::infinity() ) |
Set the Heading object.
0.0° equals WGS84 North, 90.0° equals WGS84 East, 180.0° equals WGS84 South and 270.0° equals WGS84 West HeadingConfidence is set to UNAVAILABLE
heading | object to set |
value | Heading value in degree as decimal number |
confidence | standard deviation of heading in degree as decimal number (default: infinity, mapping to HeadingConfidence::UNAVAILABLE) |
Definition at line 327 of file cpm_ts_setters.h.
|
inline |
Set the Heading Confidence object.
heading_confidence | object to set |
value | standard deviation of heading in degree as decimal number |
Definition at line 306 of file cpm_ts_setters.h.
|
inline |
Set the HeadingValue object.
0.0° equals WGS84 North, 90.0° equals WGS84 East, 180.0° equals WGS84 South and 270.0° equals WGS84 West
heading | object to set |
value | Heading value in degree as decimal number |
Definition at line 293 of file cpm_ts_setters.h.
|
inline |
Set the ID of a PerceivedObject.
Sets the object_id of the PerceivedObject to the given ID.
object | PerceivedObject to set the ID for |
id | ID to set |
Definition at line 288 of file cpm_ts_setters.h.
|
inline |
Sets the ITS PDU header of a CPM.
This function sets the ITS PDU header of a CPM with the provided station ID and protocol version.
cpm | The CPM to set the ITS PDU header for. |
station_id | The station ID to set in the ITS PDU header. |
protocol_version | The protocol version to set in the ITS PDU header. Default is 0. |
Definition at line 222 of file cpm_ts_setters.h.
|
inline |
Set the Its Pdu Header object.
header | ItsPduHeader to be set |
message_id | ID of the message |
station_id | |
protocol_version |
Definition at line 85 of file cpm_ts_setters.h.
|
inline |
Set the LateralAcceleration object.
AccelerationConfidence is set to UNAVAILABLE
accel | object to set |
value | LaterallAccelerationValue in m/s^2 as decimal number (left is positive) |
Definition at line 160 of file cpm_ts_setters.h.
|
inline |
Set the LateralAccelerationValue object.
accel | object to set |
value | LateralAccelerationValue in m/s^2 as decimal number (left is positive) |
Definition at line 141 of file cpm_ts_setters.h.
|
inline |
Set the Latitude object.
latitude | object to set |
deg | Latitude value in degree as decimal number |
Definition at line 123 of file cpm_ts_setters.h.
|
inline |
Set the Longitude object.
longitude | object to set |
deg | Longitude value in degree as decimal number |
Definition at line 135 of file cpm_ts_setters.h.
|
inline |
Set the LongitudinalAcceleration object.
AccelerationConfidence is set to UNAVAILABLE
accel | object to set |
value | LongitudinalAccelerationValue in m/s^2 as decimal number (braking is negative) |
Definition at line 130 of file cpm_ts_setters.h.
|
inline |
Set the LongitudinalAccelerationValue object.
accel | object to set |
value | LongitudinalAccelerationValue in m/s^2 as decimal number (braking is negative) |
Definition at line 111 of file cpm_ts_setters.h.
|
inline |
Sets the measurement delta time of a PerceivedObject.
This function sets the measurement delta time of a PerceivedObject. The measurement delta time represents the time difference between the reference time of the CPM and the measurement of the object.
object | The PerceivedObject to set the measurement delta time for. |
delta_time | The measurement delta time to set in milliseconds. Default value is 0. |
std::invalid_argument | if the delta_time is out of range. |
Definition at line 304 of file cpm_ts_setters.h.
|
inline |
Sets the object dimension with the given value and confidence.
This function sets the value and confidence of the object dimension based on the provided parameters. The value is limited to the range defined by ObjectDimensionValue::MIN and ObjectDimensionValue::MAX. If the provided value is outside this range, the dimension value is set to ObjectDimensionValue::OUT_OF_RANGE.
The confidence is limited to the range defined by ObjectDimensionConfidence::MIN and ObjectDimensionConfidence::MAX. If the provided confidence is outside this range, the confidence value is set to ObjectDimensionConfidence::OUT_OF_RANGE.
dimension | The object dimension to be set. |
value | The value of the object dimension in decimeters. |
confidence | The confidence of the object dimension in decimeters (optional, default is infinty, mapping to ObjectDimensionConfidence::UNAVAILABLE). |
Definition at line 621 of file cpm_ts_setters.h.
|
inline |
Set the Pos Confidence Ellipse object.
[out] | position_confidence_ellipse | The PosConfidenceEllipse to set |
[in] | semi_major_axis | length of the semi-major axis in meters |
[in] | semi_minor_axis | length of the semi-minor axis in meters |
[in] | orientation | of the semi-major axis in degrees, with respect to WGS84 |
Definition at line 360 of file cpm_ts_setters.h.
|
inline |
Set the Pos Confidence Ellipse object.
position_confidence_ellipse | |
covariance_matrix | The four values of the covariance matrix in the order: cov_xx, cov_xy, cov_yx, cov_yy The matrix has to be SPD, otherwise a std::invalid_argument exception is thrown. Its coordinate system is aligned with the object (x = longitudinal, y = lateral) |
object_heading | The heading of the object in rad, with respect to WGS84 |
Definition at line 433 of file cpm_ts_setters.h.
|
inline |
Set the Position Confidence Ellipse object.
position_confidence_ellipse | The position confidence ellipse to set |
semi_major_axis | The length of the semi-major axis in meters |
semi_minor_axis | The length of the semi-minor axis in meters |
orientation | The orientation of the semi-major axis in degrees, relative to WGS84 |
Definition at line 174 of file cpm_ts_setters.h.
|
inline |
Set the Position Confidence Ellipse object.
position_confidence_ellipse | |
covariance_matrix | The four values of the covariance matrix in the order: cov_xx, cov_xy, cov_yx, cov_yy The matrix has to be SPD, otherwise a std::invalid_argument exception is thrown. Its coordinate system is aligned with the object (x = longitudinal, y = lateral) |
object_heading | The heading of the object in rad, with respect to WGS84 |
Definition at line 191 of file cpm_ts_setters.h.
|
inline |
Sets the position of a perceived object (relative to the CPM's reference position).
This function sets the position of a perceived object using the provided coordinates and confidence values.
object | The PerceivedObject to set the position for. |
point | The gm::Point representing the coordinates of the object in meters. |
x_std | The standard deviation in meters for the x-coordinate (default: infinity). |
y_std | The standard deviation in meters for the y-coordinate (default: infinity). |
z_std | The standard deviation in meters for the z-coordinate (default: infinity). |
Definition at line 357 of file cpm_ts_setters.h.
|
inline |
Set the ReferencePositionWithConfidence for a CPM TS.
This function sets the latitude, longitude, and altitude of the CPMs reference position. If the altitude is not provided, it is set to AltitudeValue::UNAVAILABLE.
cpm | CPM to set the ReferencePosition |
latitude | The latitude value position in degree as decimal number. |
longitude | The longitude value in degree as decimal number. |
altitude | The altitude value (above the reference ellipsoid surface) in meter as decimal number (optional). |
Definition at line 258 of file cpm_ts_setters.h.
|
inline |
Sets the reference position in the given ReferencePostion object.
This function sets the latitude, longitude, and altitude of the reference position. If the altitude is not provided, it is set to AltitudeValue::UNAVAILABLE.
ref_position | ReferencePostion or ReferencePositionWithConfidence object to set the reference position in. |
latitude | The latitude value position in degree as decimal number. |
longitude | The longitude value in degree as decimal number. |
altitude | The altitude value (above the reference ellipsoid surface) in meter as decimal number (optional). |
Definition at line 242 of file cpm_ts_setters.h.
|
inline |
Sets the reference time in a CPM.
This function sets the reference time in a CPM object. The reference time is represented by a Unix timestamp in nanoseconds including the number of leap seconds. The reference time is stored in the payload management container of the CPM.
cpm | The CPM object to set the reference time in. |
unix_nanosecs | The Unix timestamp in nanoseconds representing the reference time. |
n_leap_seconds | The number of leap seconds to be considered. Defaults to the todays number of leap seconds since 2004. |
Definition at line 238 of file cpm_ts_setters.h.
|
inline |
Set the Semi Axis length.
// See https://godbolt.org/z/Eceavfo99 on how the OneCentimeterHelper works with this template
semi_axis_length | The SemiAxisLength to set |
length | the desired length in meters |
Definition at line 341 of file cpm_ts_setters.h.
|
inline |
Set the Speed object.
SpeedConfidence is set to UNAVAILABLE
speed | object to set |
value | Speed in in m/s as decimal number |
confidence | standard deviation in m/s as decimal number (Optional. Default is std::numeric_limits<double>::infinity(), mapping to SpeedConfidence::UNAVAILABLE) |
Definition at line 208 of file cpm_ts_setters.h.
|
inline |
Set the Speed Confidence object.
speed_confidence | object to set |
value | standard deviation in m/s as decimal number |
Definition at line 189 of file cpm_ts_setters.h.
|
inline |
Set the SpeedValue object.
speed | object to set |
value | SpeedValue in m/s as decimal number |
Definition at line 177 of file cpm_ts_setters.h.
|
inline |
Set the Station Id object.
station_id | |
id_value |
Definition at line 72 of file cpm_ts_setters.h.
|
inline |
Set the Station Type.
station_type | |
value |
Definition at line 100 of file cpm_ts_setters.h.
|
inline |
Set the TimestampITS object.
[in] | timestamp_its | TimestampITS object to set the timestamp |
[in] | unix_nanosecs | Unix-Nanoseconds to set the timestamp for |
[in] | n_leap_seconds | Number of leap-seconds since 2004. (Defaults to the todays number of leap seconds since 2004.) |
[in] | epoch_offset | Unix-Timestamp in seconds for the 01.01.2004 at 00:00:00 |
Definition at line 109 of file cpm_ts_setters.h.
|
inline |
Sets the position of a perceived object based on a UTM position.
This function sets the position of a perceived object using the provided UTM position and the CPM's reference position. It also allows specifying confidence values for the x, y, and z coordinates.
cpm | The CPM to get the reference position from. |
object | The PerceivedObject to set the position for. |
utm_position | gm::PointStamped representing the UTM position of the object including the frame_id (utm_<zone><N/S>). |
x_confidence | The standard deviation in meters for the x coordinate (default: CoordinateConfidence::UNAVAILABLE). |
y_confidence | The standard deviation in meters for the y coordinate (default: CoordinateConfidence::UNAVAILABLE). |
z_confidence | The standard deviation in meters for the z coordinate (default: CoordinateConfidence::UNAVAILABLE). |
std::invalid_argument | if the UTM-Position frame_id does not match the reference position frame_id. |
Definition at line 384 of file cpm_ts_setters.h.
|
inline |
Sets the value and confidence of a VelocityComponent.
This function sets the value and confidence of a VelocityComponent object. The value is limited to a specific range, and the confidence is limited to a specific range as well. If the provided value or confidence is out of range, it will be set to the corresponding out-of-range value.
velocity | The VelocityComponent object to set the value and confidence for. |
value | The value to set for the VelocityComponent in cm/s. |
confidence | The confidence to set for the VelocityComponent in cm/s. Default value is infinity, mapping to SpeedConfidence::UNAVAILABLE. |
Definition at line 417 of file cpm_ts_setters.h.
|
inline |
Sets the velocity of a perceived object.
This function sets the velocity of a perceived object using the provided Cartesian velocity components. Optionally, confidence values can be specified for each velocity component.
object | The perceived object for which the velocity is being set. |
cartesian_velocity | The Cartesian velocity components (x, y, z) of the object (in m/s). |
x_std | The standard deviation in m/s for the x velocity component (default: infinity). |
y_std | The standard deviation in m/s for the y velocity component (default: infinity). |
z_std | The standard deviation in m/s for the z velocity component (default: infinity). |
Definition at line 450 of file cpm_ts_setters.h.
|
inline |
Set the Pos Confidence Ellipse object.
position_confidence_ellipse | |
covariance_matrix | The four values of the covariance matrix in the order: cov_xx, cov_xy, cov_yx, cov_yy The matrix has to be SPD, otherwise a std::invalid_argument exception is thrown. Its coordinate system is aligned with the WGS axes (x = North, y = East) |
object_heading | The heading of the object in rad, with respect to WGS84 |
Definition at line 448 of file cpm_ts_setters.h.
|
inline |
Set the Position Confidence Ellipse object.
position_confidence_ellipse | |
covariance_matrix | The four values of the covariance matrix in the order: cov_xx, cov_xy, cov_yx, cov_yy The matrix has to be SPD, otherwise a std::invalid_argument exception is thrown. Its coordinate system is aligned with the WGS axes (x = North, y = East) |
object_heading | The heading of the object in rad, with respect to WGS84 |
Definition at line 206 of file cpm_ts_setters.h.
|
inline |
Set the confidence of the reference position.
cpm | CPM-Message to set the confidence |
covariance_matrix | The four values of the covariance matrix in the order: cov_xx, cov_xy, cov_yx, cov_yy The matrix has to be SPD, otherwise a std::invalid_argument exception is thrown. Its coordinate system is WGS84 (x = North, y = East) |
Definition at line 807 of file cpm_ts_setters.h.
|
inline |
Sets the x-dimension of a perceived object.
This function sets the x-dimension of the given PerceivedObject
to the specified value. The x-dimension usually represents the length of the object.
object | The PerceivedObject to modify. |
value | The value to set as the x-dimension in meters. |
std | The standard deviation of the x-dimension value in meters (optional, default is infinity). |
Definition at line 651 of file cpm_ts_setters.h.
|
inline |
Sets the yaw angle of a perceived object.
This function sets the yaw angle of a PerceivedObject. The yaw angle is wrapped to the range [0, 360] degrees. The function also allows specifying the confidence level of the yaw angle.
object | The PerceivedObject to set the yaw angle for. |
yaw | The yaw angle in radians. |
yaw_std | The standard deviation of the yaw angle in radians (optional, default is Infinity). |
Definition at line 535 of file cpm_ts_setters.h.
|
inline |
Sets the yaw rate of a perceived object.
This function sets the yaw rate of a PerceivedObject. The yaw rate is limited to the range defined by CartesianAngularVelocityComponentValue::NEGATIVE_OUTOF_RANGE and CartesianAngularVelocityComponentValue::POSITIVE_OUT_OF_RANGE. The function also allows specifying the confidence level of the yaw rate.
object | The PerceivedObject to set the yaw rate for. |
yaw_rate | The yaw rate in rad/s. |
yaw_rate_std | Standard deviation of the yaw rate in rad/s (optional, default is infinity, mapping to AngularSpeedConfidence::UNAVAILABLE). |
Definition at line 569 of file cpm_ts_setters.h.
|
inline |
Sets the y-dimension of a perceived object.
This function sets the y-dimension of the given PerceivedObject
to the specified value. The y-dimension usually represents the width of the object.
object | The PerceivedObject to modify. |
value | The value to set as the y-dimension in meters. |
std | The standard deviation of the y-dimension value in meters (optional, default is infinity). |
Definition at line 667 of file cpm_ts_setters.h.
|
inline |
Sets the z-dimension of a perceived object.
This function sets the z-dimension of the given PerceivedObject
to the specified value. The z-dimension usually represents the height of the object.
object | The PerceivedObject to modify. |
value | The value to set as the z-dimension in meters. |
std | The standard deviation of the z-dimension value in meters (optional, default is infinity). |
Definition at line 683 of file cpm_ts_setters.h.
|
inline |
Throws an exception if the given value is not present.
is_present | Whether the value is present. |
val_desc | Description of the value for the exception message. |
Definition at line 58 of file cpm_ts_setters.h.
void etsi_its_cpm_ts_msgs::access::throwIfOutOfRange | ( | const T1 & | val, |
const T2 & | min, | ||
const T2 & | max, | ||
const std::string | val_desc ) |
Throws an exception if a given value is out of a defined range.
T1 | |
T2 |
val | The value to check if it is in the range. |
min | The minimum value of the range. |
max | The maximum value of the range. |
val_desc | Description of the value for the exception message. |
Definition at line 47 of file cpm_ts_setters.h.
const std::map<uint64_t, uint16_t> etsi_its_cpm_ts_msgs::access::etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004 |
std::map that stores all leap second insertions since 2004 with the corresponding unix-date of the insertion
Definition at line 46 of file cpm_ts_setters.h.
|
constexpr |
Definition at line 72 of file cpm_ts_setters.h.
|
constexpr |
Definition at line 76 of file cpm_ts_setters.h.
const uint64_t etsi_its_cpm_ts_msgs::access::etsi_its_msgs::UNIX_SECONDS_2004 = 1072915200 |
Definition at line 40 of file cpm_ts_setters.h.