Go to the documentation of this file. 1 #include <gtest/gtest.h>
9 int station_id =
randomInt(denm_msgs::StationID::MIN, denm_msgs::StationID::MAX);
10 int protocol_version =
11 randomInt(denm_msgs::ItsPduHeader::PROTOCOL_VERSION_MIN, denm_msgs::ItsPduHeader::PROTOCOL_VERSION_MAX);
13 EXPECT_EQ(denm_msgs::ItsPduHeader::MESSAGE_ID_DENM, denm.header.message_id);
14 EXPECT_EQ(protocol_version, denm.header.protocol_version);
22 uint64_t t_2007 = ((uint64_t)1167609600) * 1e9;
23 denm_msgs::TimestampIts t_its;
25 EXPECT_EQ(94694401000, t_its.value);
29 uint64_t t_2007_off = t_2007 + 5 * 1e9;
32 int stationType_val =
randomInt(denm_msgs::StationType::MIN, denm_msgs::StationType::MAX);
57 EXPECT_NEAR(291827.02, utm.point.x, 1e-1);
58 EXPECT_NEAR(5630349.72, utm.point.y, 1e-1);
59 EXPECT_EQ(altitude, utm.point.z);
61 EXPECT_EQ(
true, northp);
69 denm.denm.location_is_present =
true;
75 denm.denm.location_is_present =
true;
double getLatitude(const CAM &cam)
Get the Latitude value of CAM.
uint8_t getStationType(const CAM &cam)
Get the stationType object.
double getLongitude(const CAM &cam)
Get the Longitude value of CAM.
uint32_t getStationID(const CAM &cam)
Get the Station ID object.
void setReferencePosition(CAM &cam, const double latitude, const double longitude, const double altitude=AltitudeValue::UNAVAILABLE)
Set the ReferencePosition for a CAM.
int randomInt(int min, int max)
TEST(etsi_its_denm_msgs, test_set_get_denm)
double getAltitude(const CAM &cam)
Get the Altitude value of CAM.
uint64_t getUnixNanosecondsFromReferenceTime(const TimestampIts &reference_time)
Get the Unix-Nanoseconds from a given ReferenceTime object.
void setHeading(CAM &cam, const double heading_val, const double confidence=std::numeric_limits< double >::infinity())
Set the Heading for a CAM.
gm::PointStamped getUTMPosition(const CAM &cam, int &zone, bool &northp)
Get the UTM Position defined within the BasicContainer of the CAM.
uint64_t getReferenceTimeValue(const CollectivePerceptionMessage &cpm)
Get the ReferenceTime-Value.
double getHeading(const CAM &cam)
Get the Heading value of CAM.
void 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 setFromUTMPosition(CAM &cam, const gm::PointStamped &utm_position, const int &zone, const bool &northp)
Set the ReferencePosition of a CAM from a given UTM-Position.
double randomDouble(double min, double max)
double getHeadingConfidence(const CAM &cam)
Get the Heading confidence of CAM.
void 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 setSpeed(CAM &cam, const double speed_val, const double confidence=SpeedConfidence::UNAVAILABLE)
Set the vehicle speed.
TimestampIts getReferenceTime(const CollectivePerceptionMessage &cpm)
Get the Reference Time object.
void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version=0)
Set the ItsPduHeader-object for a CAM.
void setStationType(CAM &cam, const uint8_t value)
Set the StationType for a CAM.
double getSpeed(const CAM &cam)
Get the vehicle speed.
etsi_its_msgs_utils
Author(s): Jean-Pierre Busch
, Guido Küppers , Lennart Reiher
autogenerated on Sun May 18 2025 02:32:12