Skip to content

Commit 5bbf034

Browse files
committed
Bump minimum MRPT version to 2.15.4 (and remove now old dead code)
1 parent e0dd101 commit 5bbf034

14 files changed

Lines changed: 10 additions & 194 deletions

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ endif()
5555
add_subdirectory(3rdparty)
5656

5757
# find dependencies:
58-
find_package(MRPT 2.15.0 REQUIRED COMPONENTS
58+
find_package(MRPT 2.15.4 REQUIRED COMPONENTS
5959
containers
6060
tfest
6161
maps

agents.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Quick-start reference for AI agents and new contributors.
99
- **Version**: 2.7.1 (March 2026)
1010
- **License**: BSD-3-Clause
1111
- **Maintainer**: Jose Luis Blanco-Claraco
12-
- **Minimum MRPT**: 2.15.0
12+
- **Minimum MRPT**: 2.15.4
1313

1414
---
1515

@@ -172,7 +172,7 @@ SIMD-optimized translation units are compiled separately with `-mavx` / `-msse2`
172172

173173
| Dependency | Notes |
174174
|-----------|-------|
175-
| MRPT ≥ 2.15.0 | containers, tfest, maps, gui, topography — mandatory |
175+
| MRPT ≥ 2.15.4 | containers, tfest, maps, gui, topography — mandatory |
176176
| TBB | Optional; enables parallel ICP iterations |
177177
| mola_common | CMake scripts; fetched as git submodule |
178178
| mola_imu_preintegration | Optional; advanced deskew in FilterDeskew |

apps/txt2mm/main.cpp

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,13 @@
2121

2222
#include <mp2p_icp/metricmap.h>
2323
#include <mrpt/3rdparty/tclap/CmdLine.h>
24+
#include <mrpt/maps/CGenericPointsMap.h>
2425
#include <mrpt/maps/CSimplePointsMap.h>
2526
#include <mrpt/math/CMatrixDynamic.h>
2627
#include <mrpt/obs/CObservationPointCloud.h>
2728
#include <mrpt/system/filesystem.h>
2829
#include <mrpt/version.h>
2930

30-
#if MRPT_VERSION >= 0x20f00 // 2.15.0
31-
#include <mrpt/maps/CGenericPointsMap.h>
32-
#else
33-
#include <mrpt/maps/CColouredPointsMap.h>
34-
#include <mrpt/maps/CPointsMapXYZI.h>
35-
#include <mrpt/maps/CPointsMapXYZIRT.h>
36-
#endif
37-
3831
const char* VALID_FORMATS = "(xyz|xyzi|xyzirt|xyzrgb|xyzrgb_normalized)";
3932

4033
// Replicated here from CGenericPointsMap until MRPT 2.15.3 is minimum required version:
@@ -214,14 +207,10 @@ int main(int argc, char** argv)
214207
{
215208
ASSERT_GE_(nCols, 6U);
216209
const bool rgb_normalized = (format == "xyzrgb_normalized");
217-
#if MRPT_VERSION >= 0x20f00 // 2.15.0
218-
auto pts = mrpt::maps::CGenericPointsMap::Create();
210+
auto pts = mrpt::maps::CGenericPointsMap::Create();
219211
pts->registerField_float("color_r");
220212
pts->registerField_float("color_g");
221213
pts->registerField_float("color_b");
222-
#else
223-
auto pts = mrpt::maps::CColouredPointsMap::Create();
224-
#endif
225214
pts->reserve(nRows);
226215
if (nCols > 6)
227216
{
@@ -250,15 +239,9 @@ int main(int argc, char** argv)
250239
b_val = mrpt::u8tof(static_cast<uint8_t>(data(i, idxBlue)));
251240
}
252241

253-
#if MRPT_VERSION >= 0x20f00 // 2.15.0
254242
pts->insertPointField_float("color_r", r_val);
255243
pts->insertPointField_float("color_g", g_val);
256244
pts->insertPointField_float("color_b", b_val);
257-
#else
258-
pts->insertPointField_color_R(r_val);
259-
pts->insertPointField_color_G(g_val);
260-
pts->insertPointField_color_B(b_val);
261-
#endif
262245
}
263246

264247
pc = pts;

mp2p_icp_filters/src/FilterAdjustTimestamps.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,7 @@ void FilterAdjustTimestamps::filter(mp2p_icp::metric_map_t& inOut) const
8282
return;
8383
}
8484

85-
#if MRPT_VERSION >= 0x020f00 // 2.15.0
8685
auto* TsPtr = pc.getPointsBufferRef_float_field("t");
87-
#else
88-
auto* TsPtr = pc.getPointsBufferRef_timestamp();
89-
#endif
9086

9187
if (TsPtr == nullptr || (TsPtr->empty() && !pc.empty()))
9288
{

mp2p_icp_filters/src/FilterBoundingBox.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ void FilterBoundingBox::filter(mp2p_icp::metric_map_t& inOut) const
106106
outsidePc->reserve(outsidePc->size() + pc.size() / 10);
107107
}
108108

109-
#if MRPT_VERSION >= 0x020f00 // 2.15.0
110109
mrpt::maps::CPointsMap::InsertCtx ctxOutside, ctxInside;
111110
if (insidePc)
112111
{
@@ -118,7 +117,6 @@ void FilterBoundingBox::filter(mp2p_icp::metric_map_t& inOut) const
118117
outsidePc->registerPointFieldsFrom(pc);
119118
ctxOutside = outsidePc->prepareForInsertPointsFrom(pc);
120119
}
121-
#endif
122120

123121
const auto& xs = pc.getPointsBufferRef_x();
124122
const auto& ys = pc.getPointsBufferRef_y();
@@ -129,18 +127,10 @@ void FilterBoundingBox::filter(mp2p_icp::metric_map_t& inOut) const
129127
const bool isInside = params.bounding_box.containsPoint({xs[i], ys[i], zs[i]});
130128

131129
auto* targetPc = isInside ? insidePc.get() : outsidePc.get();
132-
#if MRPT_VERSION >= 0x020f00 // 2.15.0
133-
auto* ctx = isInside ? &ctxInside : &ctxOutside;
134-
#endif
130+
auto* ctx = isInside ? &ctxInside : &ctxOutside;
135131
if (targetPc)
136132
{
137-
#if MRPT_VERSION >= 0x020f03 // 2.15.3
138133
targetPc->insertPointFrom(i, *ctx);
139-
#elif MRPT_VERSION >= 0x020f00 // 2.15.0
140-
targetPc->insertPointFrom(pc, i, *ctx);
141-
#else
142-
targetPc->insertPointFrom(pc, i);
143-
#endif
144134
}
145135
}
146136

mp2p_icp_filters/src/FilterByIntensity.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ void FilterByIntensity::filter(mp2p_icp::metric_map_t& inOut) const
126126
ASSERT_EQUAL_(Is.size(), xs.size());
127127
const size_t N = xs.size();
128128

129-
#if MRPT_VERSION >= 0x020f00 // 2.15.0
130129
mrpt::maps::CPointsMap::InsertCtx ctxLow, ctxHigh, ctxMid;
131130
if (outLow)
132131
{
@@ -143,7 +142,6 @@ void FilterByIntensity::filter(mp2p_icp::metric_map_t& inOut) const
143142
outMid->registerPointFieldsFrom(pc);
144143
ctxMid = outMid->prepareForInsertPointsFrom(pc);
145144
}
146-
#endif
147145

148146
size_t countLow = 0, countMid = 0, countHigh = 0;
149147

@@ -153,43 +151,29 @@ void FilterByIntensity::filter(mp2p_icp::metric_map_t& inOut) const
153151

154152
mrpt::maps::CPointsMap* trg = nullptr;
155153

156-
#if MRPT_VERSION >= 0x020f00 // 2.15.0
157154
mrpt::maps::CPointsMap::InsertCtx* ctx = nullptr;
158-
#endif
159155
if (I < params.low_threshold)
160156
{
161157
trg = outLow.get();
162158
++countLow;
163-
#if MRPT_VERSION >= 0x020f00 // 2.15.0
164159
ctx = &ctxLow;
165-
#endif
166160
}
167161
else if (I > params.high_threshold)
168162
{
169163
trg = outHigh.get();
170164
++countHigh;
171-
#if MRPT_VERSION >= 0x020f00 // 2.15.0
172165
ctx = &ctxHigh;
173-
#endif
174166
}
175167
else
176168
{
177169
trg = outMid.get();
178170
++countMid;
179-
#if MRPT_VERSION >= 0x020f00 // 2.15.0
180171
ctx = &ctxMid;
181-
#endif
182172
}
183173

184174
if (trg)
185175
{
186-
#if MRPT_VERSION >= 0x020f03 // 2.15.3
187176
trg->insertPointFrom(i, *ctx);
188-
#elif MRPT_VERSION >= 0x020f00 // 2.15.0
189-
trg->insertPointFrom(pc, i, *ctx);
190-
#else
191-
trg->insertPointFrom(pc, i);
192-
#endif
193177
}
194178
}
195179

mp2p_icp_filters/src/FilterByRange.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ void FilterByRange::filter(mp2p_icp::metric_map_t& inOut) const
115115
const float sqrMin = mrpt::square(params.range_min);
116116
const float sqrMax = mrpt::square(params.range_max);
117117

118-
#if MRPT_VERSION >= 0x020f00 // 2.15.0
119118
std::optional<mrpt::maps::CPointsMap::InsertCtx> ctxBetween;
120119
std::optional<mrpt::maps::CPointsMap::InsertCtx> ctxOutside;
121120
if (outBetween)
@@ -128,7 +127,6 @@ void FilterByRange::filter(mp2p_icp::metric_map_t& inOut) const
128127
outOutside->registerPointFieldsFrom(pc);
129128
ctxOutside = outOutside->prepareForInsertPointsFrom(pc);
130129
}
131-
#endif
132130

133131
for (size_t i = 0; i < xs.size(); i++)
134132
{
@@ -154,15 +152,8 @@ void FilterByRange::filter(mp2p_icp::metric_map_t& inOut) const
154152

155153
if (targetPc)
156154
{
157-
#if MRPT_VERSION >= 0x020f03 // 2.15.3
158155
const auto& ctx = isInside ? ctxBetween : ctxOutside;
159156
targetPc->insertPointFrom(i, ctx.value());
160-
#elif MRPT_VERSION >= 0x020f00 // 2.15.0
161-
const auto& ctx = isInside ? ctxBetween : ctxOutside;
162-
targetPc->insertPointFrom(pc, i, ctx.value());
163-
#else
164-
targetPc->insertPointFrom(pc, i);
165-
#endif
166157
}
167158
}
168159

mp2p_icp_filters/src/FilterByRing.cpp

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,7 @@ void FilterByRing::filter(mp2p_icp::metric_map_t& inOut) const
111111

112112
const auto& xs = pc.getPointsBufferRef_x();
113113

114-
#if MRPT_VERSION >= 0x020f04 // 2.15.4
115114
const auto* ptrR = pc.getPointsBufferRef_uint16_field("ring");
116-
#elif MRPT_VERSION >= 0x020f00 // 2.15.0
117-
const auto* ptrR = pc.getPointsBufferRef_uint_field("ring");
118-
#else
119-
const auto* ptrR = pc.getPointsBufferRef_ring();
120-
#endif
121115

122116
if (!ptrR || ptrR->empty())
123117
{
@@ -127,7 +121,6 @@ void FilterByRing::filter(mp2p_icp::metric_map_t& inOut) const
127121
params.input_pointcloud_layer.c_str());
128122
}
129123

130-
#if MRPT_VERSION >= 0x020f00 // 2.15.0
131124
mrpt::maps::CPointsMap::InsertCtx ctxSelected;
132125
if (outSelected)
133126
{
@@ -140,7 +133,6 @@ void FilterByRing::filter(mp2p_icp::metric_map_t& inOut) const
140133
outNonSel->registerPointFieldsFrom(pc);
141134
ctxNotSelected = outNonSel->prepareForInsertPointsFrom(pc);
142135
}
143-
#endif
144136

145137
const auto& Rs = *ptrR;
146138
ASSERT_EQUAL_(Rs.size(), xs.size());
@@ -152,37 +144,25 @@ void FilterByRing::filter(mp2p_icp::metric_map_t& inOut) const
152144
{
153145
const auto R = Rs[i];
154146

155-
mrpt::maps::CPointsMap* trg = nullptr;
156-
#if MRPT_VERSION >= 0x020f00 // 2.15.0
147+
mrpt::maps::CPointsMap* trg = nullptr;
157148
mrpt::maps::CPointsMap::InsertCtx* ctx = nullptr;
158-
#endif
159149

160150
if (params.selected_ring_ids.count(R) != 0)
161151
{
162152
trg = outSelected.get();
163153
++countSel;
164-
#if MRPT_VERSION >= 0x020f00 // 2.15.0
165154
ctx = &ctxSelected;
166-
#endif
167155
}
168156
else
169157
{
170158
trg = outNonSel.get();
171159
++countNon;
172-
#if MRPT_VERSION >= 0x020f00 // 2.15.0
173160
ctx = &ctxNotSelected;
174-
#endif
175161
}
176162

177163
if (trg)
178164
{
179-
#if MRPT_VERSION >= 0x020f03 // 2.15.3
180165
trg->insertPointFrom(i, *ctx);
181-
#elif MRPT_VERSION >= 0x020f00 // 2.15.0
182-
trg->insertPointFrom(pc, i, *ctx);
183-
#else
184-
trg->insertPointFrom(pc, i);
185-
#endif
186166
}
187167
}
188168

mp2p_icp_filters/src/FilterCurvature.cpp

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,7 @@ void FilterCurvature::filter(mp2p_icp::metric_map_t& inOut) const
113113
const auto& ys = pc.getPointsBufferRef_y();
114114
const auto& zs = pc.getPointsBufferRef_z();
115115

116-
#if MRPT_VERSION >= 0x020f00 // 2.15.0
117116
const auto* ptrRings = pc.getPointsBufferRef_float_field("ring");
118-
#else
119-
const auto* ptrRings = pc.getPointsBufferRef_ring();
120-
#endif
121117
if (!ptrRings || ptrRings->empty())
122118
{
123119
THROW_EXCEPTION_FMT(
@@ -131,7 +127,6 @@ void FilterCurvature::filter(mp2p_icp::metric_map_t& inOut) const
131127

132128
const size_t N = xs.size();
133129

134-
#if MRPT_VERSION >= 0x020f00 // 2.15.0
135130
mrpt::maps::CPointsMap::InsertCtx ctxLarger;
136131
if (outPcLarger)
137132
{
@@ -150,7 +145,6 @@ void FilterCurvature::filter(mp2p_icp::metric_map_t& inOut) const
150145
outPcOther->registerPointFieldsFrom(pc);
151146
ctxOther = outPcOther->prepareForInsertPointsFrom(pc);
152147
}
153-
#endif
154148

155149
const uint16_t nRings = 1 + *std::max_element(ringPerPt.begin(), ringPerPt.end());
156150

@@ -230,13 +224,7 @@ void FilterCurvature::filter(mp2p_icp::metric_map_t& inOut) const
230224
counterLarger++;
231225
if (outPcLarger)
232226
{
233-
#if MRPT_VERSION >= 0x020f03 // 2.15.3
234227
outPcLarger->insertPointFrom(i, ctxLarger);
235-
#elif MRPT_VERSION >= 0x020f00 // 2.15.0
236-
outPcLarger->insertPointFrom(pc, i, ctxLarger);
237-
#else
238-
outPcLarger->insertPointFrom(pc, i);
239-
#endif
240228
}
241229
}
242230
continue;
@@ -263,26 +251,14 @@ void FilterCurvature::filter(mp2p_icp::metric_map_t& inOut) const
263251
counterLarger++;
264252
if (outPcLarger)
265253
{
266-
#if MRPT_VERSION >= 0x020f03 // 2.15.3
267254
outPcLarger->insertPointFrom(i, ctxLarger);
268-
#elif MRPT_VERSION >= 0x020f00 // 2.15.0
269-
outPcLarger->insertPointFrom(pc, i, ctxLarger);
270-
#else
271-
outPcLarger->insertPointFrom(pc, i);
272-
#endif
273255
}
274256
}
275257
else
276258
{
277259
if (outPcOther)
278260
{
279-
#if MRPT_VERSION >= 0x020f03 // 2.15.3
280261
outPcOther->insertPointFrom(i, ctxOther);
281-
#elif MRPT_VERSION >= 0x020f00 // 2.15.0
282-
outPcOther->insertPointFrom(pc, i, ctxOther);
283-
#else
284-
outPcOther->insertPointFrom(pc, i);
285-
#endif
286262
}
287263
}
288264
continue;
@@ -300,27 +276,15 @@ void FilterCurvature::filter(mp2p_icp::metric_map_t& inOut) const
300276
counterLarger++;
301277
if (outPcLarger)
302278
{
303-
#if MRPT_VERSION >= 0x020f03 // 2.15.3
304279
outPcLarger->insertPointFrom(i, ctxLarger);
305-
#elif MRPT_VERSION >= 0x020f00 // 2.15.0
306-
outPcLarger->insertPointFrom(pc, i, ctxLarger);
307-
#else
308-
outPcLarger->insertPointFrom(pc, i);
309-
#endif
310280
}
311281
}
312282
else
313283
{
314284
counterLess++;
315285
if (outPcSmaller)
316286
{
317-
#if MRPT_VERSION >= 0x020f03 // 2.15.3
318287
outPcSmaller->insertPointFrom(i, ctxSmaller);
319-
#elif MRPT_VERSION >= 0x020f00 // 2.15.0
320-
outPcSmaller->insertPointFrom(pc, i, ctxSmaller);
321-
#else
322-
outPcSmaller->insertPointFrom(pc, i);
323-
#endif
324288
}
325289
}
326290
}

mp2p_icp_filters/src/FilterDeskew.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,6 @@ auto findBeforeAfter(const mola::imu::Trajectory& trajectory, const double t)
152152
}
153153
#endif // MP2P_ICP_HAS_MOLA_IMU_PREINTEGRATION
154154

155-
#if MRPT_VERSION < 0x020f00 // 2.15.0
156-
#error "MRPT >= 2.15.0 is required to compile FilterDeskew"
157-
#endif
158-
159155
struct CorrectPointsArguments
160156
{
161157
mrpt::aligned_std_vector<float>& xs;

0 commit comments

Comments
 (0)