Skip to content

Commit

Permalink
fix(autoware_bytetrack): fix clang-diagnostic-implicit-const-int-floa…
Browse files Browse the repository at this point in the history
…t-conversion (#9513)

fix: clang-diagnostic-implicit-const-int-float-conversion

Signed-off-by: kobayu858 <[email protected]>
  • Loading branch information
kobayu858 authored Dec 2, 2024
1 parent df241f7 commit adb6101
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions perception/autoware_bytetrack/lib/src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "lapjv.h"

#include <cstddef>
#include <limits>

std::vector<STrack *> ByteTracker::joint_stracks(
std::vector<STrack *> & tlista, std::vector<STrack> & tlistb)
Expand Down Expand Up @@ -292,14 +293,14 @@ double ByteTracker::lapjv(
}
}

if (extend_cost || cost_limit < LONG_MAX) {
if (extend_cost || cost_limit < std::numeric_limits<float>::max()) {
std::vector<std::vector<float>> cost_c_extended;

n = n_rows + n_cols;
cost_c_extended.resize(n);
for (size_t i = 0; i < cost_c_extended.size(); i++) cost_c_extended[i].resize(n);

if (cost_limit < LONG_MAX) {
if (cost_limit < std::numeric_limits<float>::max()) {
for (size_t i = 0; i < cost_c_extended.size(); i++) {
for (size_t j = 0; j < cost_c_extended[i].size(); j++) {
cost_c_extended[i][j] = cost_limit / 2.0;
Expand Down

0 comments on commit adb6101

Please sign in to comment.