Skip to content

Commit

Permalink
add comparison against epison
Browse files Browse the repository at this point in the history
  • Loading branch information
adev4a committed Nov 27, 2024
1 parent 2fcf399 commit 413a716
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class TrafficIncidentNode : public carma_ros2_utils::CarmaLifecycleNode
double down_track_;
double up_track_;
double min_gap_;
static constexpr double epsilon_ = 1e-6;
};

} // namespace traffic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ bool TrafficIncidentNode::stopTrafficBroadcastCallback(
void TrafficIncidentNode::spin_callback(void)
{
if (
traffic_worker_.getDownTrack() > 0 || traffic_worker_.getUpTrack() > 0 || traffic_worker_.getAdvisorySpeed() > 0) {
std::fabs(traffic_worker_.getDownTrack()) > epsilon_ || std::fabs(traffic_worker_.getUpTrack() > epsilon_) || std::fabs(traffic_worker_.getAdvisorySpeed() > epsilon_)) {
// construct local mobilityOperation msg
carma_v2x_msgs::msg::MobilityOperation traffic_mobility_msg =
traffic_worker_.mobilityMessageGenerator(traffic_worker_.getPinPoint());
Expand Down

0 comments on commit 413a716

Please sign in to comment.