Fix generationDeltaTime

Signed-off-by: Tiago Garcia <tiago.rgarcia@av.it.pt>
This commit is contained in:
Tiago Garcia 2024-07-10 17:37:24 +01:00
parent f1b160d1f7
commit 579f6fe16f
No known key found for this signature in database
GPG Key ID: A3B1096AD19E1688
4 changed files with 20 additions and 23 deletions

View File

@ -23,7 +23,7 @@ public:
void set_interval(vanetza::Clock::duration); void set_interval(vanetza::Clock::duration);
void updateMGRS(double *, double *); void updateMGRS(double *, double *);
void updateRP(double *, double *, double *); void updateRP(double *, double *, double *);
void updateGenerationTime(int *, long *); void updateGenerationDeltaTime(int *, long *);
void updateHeading(double *); void updateHeading(double *);
void setVehicleDimensions(const autoware_adapi_v1_msgs::msg::VehicleDimensions &); void setVehicleDimensions(const autoware_adapi_v1_msgs::msg::VehicleDimensions &);
void updateVelocityReport(const autoware_auto_vehicle_msgs::msg::VelocityReport::ConstSharedPtr); void updateVelocityReport(const autoware_auto_vehicle_msgs::msg::VelocityReport::ConstSharedPtr);
@ -130,7 +130,7 @@ private:
}; };
VehicleStatus vehicleStatus_; VehicleStatus vehicleStatus_;
int generationTime_; int generationDeltaTime_;
long gdt_timestamp_; long gdt_timestamp_;
double objectConfidenceThreshold_; double objectConfidenceThreshold_;
@ -140,7 +140,6 @@ private:
bool sending_; bool sending_;
bool is_sender_; bool is_sender_;
bool reflect_packet_; bool reflect_packet_;
bool include_all_persons_and_animals_;
int cam_num_; int cam_num_;
int received_cam_num_; int received_cam_num_;

View File

@ -41,14 +41,13 @@ namespace v2x
positionConfidenceEllipse_(), positionConfidenceEllipse_(),
velocityReport_(), velocityReport_(),
vehicleStatus_(), vehicleStatus_(),
generationTime_(0), generationDeltaTime_(0),
updating_velocity_report_(false), updating_velocity_report_(false),
updating_vehicle_status_(false), updating_vehicle_status_(false),
sending_(false), sending_(false),
is_sender_(is_sender), is_sender_(is_sender),
reflect_packet_(false), reflect_packet_(false),
objectConfidenceThreshold_(0.0), objectConfidenceThreshold_(0.0),
include_all_persons_and_animals_(false),
cam_num_(0), cam_num_(0),
received_cam_num_(0), received_cam_num_(0),
use_dynamic_generation_rules_(false) use_dynamic_generation_rules_(false)
@ -96,8 +95,8 @@ namespace v2x
positionConfidenceEllipse_.y.insert(*lon); positionConfidenceEllipse_.y.insert(*lon);
} }
void CamApplication::updateGenerationTime(int *gdt, long *gdt_timestamp) { void CamApplication::updateGenerationDeltaTime(int *gdt, long *gdt_timestamp) {
generationTime_ = *gdt; generationDeltaTime_ = *gdt;
gdt_timestamp_ = *gdt_timestamp; // ETSI-epoch milliseconds timestamp gdt_timestamp_ = *gdt_timestamp; // ETSI-epoch milliseconds timestamp
} }
@ -175,9 +174,8 @@ namespace v2x
CoopAwareness_t &cam = message->cam; CoopAwareness_t &cam = message->cam;
// Set GenerationTime
RCLCPP_INFO(node_->get_logger(), "[CpmApplication::send] %ld", gdt_timestamp_); RCLCPP_INFO(node_->get_logger(), "[CpmApplication::send] %ld", gdt_timestamp_);
cam.generationDeltaTime = gdt_timestamp_; cam.generationDeltaTime = generationDeltaTime_;
BasicContainer_t &basic_container = cam.camParameters.basicContainer; BasicContainer_t &basic_container = cam.camParameters.basicContainer;
basic_container.stationType = StationType_passengerCar; basic_container.stationType = StationType_passengerCar;

View File

@ -128,7 +128,7 @@ namespace v2x
cam->updateMGRS(&x, &y); cam->updateMGRS(&x, &y);
cam->updateRP(&lat, &lon, &z); cam->updateRP(&lat, &lon, &z);
cam->updateHeading(&yaw); cam->updateHeading(&yaw);
cam->updateGenerationTime(&gdt, &timestamp_msec); cam->updateGenerationDeltaTime(&gdt, &timestamp_msec);
} }
} }