NavMap
Loading...
Searching...
No Matches
Combine.hpp
Go to the documentation of this file.
1// Copyright 2026 Intelligent Robotics Lab
2//
3// This file is part of the project Easy Navigation (EasyNav in short)
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
26
27#ifndef NAVMAP_CORE__COMBINE_HPP_
28#define NAVMAP_CORE__COMBINE_HPP_
29
30#include <cstddef>
31#include <cstdint>
32#include <limits>
33#include <string>
34#include <vector>
35
37
38namespace navmap
39{
40
51
54{
56 std::vector<NavCelId> cells;
59 double cap{std::numeric_limits<double>::infinity()};
61 std::string provenance;
63 std::uint8_t source_id{1};
64};
65
81std::ptrdiff_t combine_layer(
82 NavMap & nm, const std::string & dst, const std::string & src, CombineOp op,
83 const CombineOptions & options = {});
84
85} // namespace navmap
86
87#endif // NAVMAP_CORE__COMBINE_HPP_
Core container and data structures for EasyNav navigable meshes.
Definition Combine.hpp:39
CombineOp
How a source value s is combined into the destination value d (as costmap_2d's update modes).
Definition Combine.hpp:43
@ OVERWRITE
d = s, except where s is unknown
Definition Combine.hpp:44
@ MAX
d = max(d, s); s replaces an unknown d; an unknown s is ignored
Definition Combine.hpp:46
@ ADD
d = min(d + s, cap); s replaces an unknown d; an unknown s is ignored
Definition Combine.hpp:49
@ MIN
d = min(d, s); s replaces an unknown d; an unknown s is ignored
Definition Combine.hpp:48
@ MAX_KEEP_UNKNOWN
as MAX, but an unknown d stays unknown
Definition Combine.hpp:47
@ TRUE_OVERWRITE
d = s, unknown included
Definition Combine.hpp:45
std::ptrdiff_t combine_layer(NavMap &nm, const std::string &dst, const std::string &src, CombineOp op, const CombineOptions &options={})
Combine layer src into layer dst cell by cell with op.
Definition Combine.cpp:141
Options of combine_layer().
Definition Combine.hpp:54
Options of combine_layer().
Definition Combine.hpp:54
std::string provenance
U8 layer recording which source set each cell (created if absent, 0 = none). Empty: no record.
Definition Combine.hpp:61
std::vector< NavCelId > cells
Cells to combine (e.g. the source's changed()); all cells if empty.
Definition Combine.hpp:56
double cap
ADD saturates here (and at the range of the destination type).
Definition Combine.hpp:59
std::uint8_t source_id
Value written to the provenance layer for this source.
Definition Combine.hpp:63
CombineOp
How a source value s is combined into the destination value d (as costmap_2d's update modes).
Definition Combine.hpp:43