Skip to content

Commit a62de0d

Browse files
authored
Integration with radar udp publisher (#282)
* Fix compilation error * Store last sample value in RunningStats * Micro optimization * Add missing class * Rename RuningStats -> RunningStats * Change target branch for udp extension to run CI properly
1 parent c8ea5a1 commit a62de0d

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

extensions.repos

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ repositories:
22
extensions/udp:
33
type: git
44
url: [email protected]:RobotecAI/RGL-extension-udp.git
5-
version: develop
5+
version: feature/q2-features
66

77
extensions/snow:
88
type: git

src/GPUFieldDescBuilder.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919

2020
#include <RGLExceptions.hpp>
2121
#include <gpu/GPUFieldDesc.hpp>
22-
#include <graph/Interfaces.hpp>
23-
#include <graph/NodesCore.hpp>
2422
#include <memory/Array.hpp>
2523

2624
// Builder for GPUFieldDesc. Separated struct to avoid polluting gpu-visible header (gpu/GPUFieldDesc.hpp).

src/graph/NodesCore.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include <gpu/nodeKernels.hpp>
3131
#include <CacheManager.hpp>
3232
#include <GPUFieldDescBuilder.hpp>
33-
#include <math/RuningStats.hpp>
33+
#include <math/RunningStats.hpp>
3434
#include <gpu/MultiReturn.hpp>
3535

3636

@@ -621,6 +621,7 @@ struct RadarTrackObjectsNode : IPointsNodeSingleInput
621621
uint8_t classPedestrian{0};
622622
uint8_t classAnimal{0};
623623
uint8_t classHazard{0};
624+
uint8_t classUnknown{0};
624625
};
625626

626627
struct ObjectState

src/math/RuningStats.hpp renamed to src/math/RunningStats.hpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2023 Robotec.AI
1+
// Copyright 2024 Robotec.AI
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -29,14 +29,17 @@ class RunningStats
2929
return stats;
3030
}
3131

32-
void addSample(StatType sample)
32+
void addSample(const StatType& sample)
3333
{
3434
++counter;
35-
StatType delta = sample - mean;
35+
const StatType delta = sample - mean;
3636
mean += delta / counter;
3737
m2 += delta * (sample - mean);
38+
lastSample = sample;
3839
}
3940

41+
StatType getLastSample() const { return lastSample; }
42+
4043
StatType getMean() const { return mean; }
4144

4245
StatType getVariance() const { return counter < 2 ? StatType{} : m2 / counter; }
@@ -71,4 +74,5 @@ class RunningStats
7174
size_t counter{0};
7275
StatType mean{0};
7376
StatType m2{0};
77+
StatType lastSample{0};
7478
};

0 commit comments

Comments
 (0)