util.h
Go to the documentation of this file.
1 
2 /**
3  * This file is part of ArmarX.
4  *
5  * ArmarX is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation.
8  *
9  * ArmarX is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  *
17  * @author Fabian Reister ( fabian dot reister at kit dot edu )
18  * @date 2022
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
25 #include <VirtualRobot/VirtualRobot.h>
26 #include <VirtualRobot/Workspace/WorkspaceGrid.h>
27 
30 
31 
33 {
34  SceneBounds computeSceneBounds(const VirtualRobot::SceneObjectSetPtr& obstacles, const SceneBounds& init = SceneBounds());
35 
36  SceneBounds toSceneBounds(const VirtualRobot::WorkspaceGrid::Extends& extends);
37 
38  SceneBounds merge(const std::vector<SceneBounds>& sceneBounds);
39 
40 
41  Costmap toCostmap(const VirtualRobot::WorkspaceGrid& workspaceGrid);
42 
43 
44  // Costmap mergeUnaligned(const std::vector<Costmap>& costmaps,
45  // const std::vector<float>& weights,
46  // float cellSize = -1,
47  // const Eigen::Array2f& offset = Eigen::Array2f::Zero());
48 
49  void checkSameSize(const std::vector<Costmap>& costmaps);
50 
51  /**
52  * @brief Defines how the
53  *
54  */
55  enum class CostmapMergeMode
56  {
57  MAX,
58  MIN,
59  AVERAGE
60  };
61 
62  Costmap mergeAligned(const std::vector<Costmap>& costmaps, CostmapMergeMode mode);
63  Costmap mergeAligned(const std::vector<Costmap>& costmaps, const std::vector<float>& weights);
64 
65  Costmap scaleCostmap(const Costmap& costmap, float cellSize);
66 
67  std::optional<core::Pose2D> sampleValidPositionInMap(const algorithms::Costmap& costmap);
68 
69 } // namespace armarx::navigation::algorithms
armarx::navigation::algorithms::CostmapMergeMode
CostmapMergeMode
Defines how the.
Definition: util.h:55
armarx::navigation::algorithms::merge
SceneBounds merge(const std::vector< SceneBounds > &sceneBounds)
Definition: util.cpp:82
armarx::navigation::algorithms::CostmapMergeMode::AVERAGE
@ AVERAGE
armarx::navigation::algorithms
This file is part of ArmarX.
Definition: aron_conversions.cpp:13
armarx::navigation::algorithms::checkSameSize
void checkSameSize(const std::vector< Costmap > &costmaps)
Definition: util.cpp:190
armarx::navigation::algorithms::mergeAligned
Costmap mergeAligned(const std::vector< Costmap > &costmaps, CostmapMergeMode mode)
Definition: util.cpp:205
Costmap.h
armarx::navigation::algorithms::scaleCostmap
Costmap scaleCostmap(const Costmap &costmap, float cellSize)
Definition: util.cpp:277
armarx::navigation::algorithms::computeSceneBounds
SceneBounds computeSceneBounds(const VirtualRobot::SceneObjectSetPtr &obstacles, const SceneBounds &init)
Definition: util.cpp:54
armarx::navigation::algorithms::CostmapMergeMode::MAX
@ MAX
armarx::navigation::algorithms::CostmapMergeMode::MIN
@ MIN
armarx::navigation::algorithms::sampleValidPositionInMap
std::optional< core::Pose2D > sampleValidPositionInMap(const algorithms::Costmap &costmap)
Definition: util.cpp:335
armarx::navigation::algorithms::toSceneBounds
SceneBounds toSceneBounds(const VirtualRobot::WorkspaceGrid::Extends &extends)
Definition: util.cpp:75
armarx::navigation::algorithms::toCostmap
Costmap toCostmap(const VirtualRobot::WorkspaceGrid &workspaceGrid)
Definition: util.cpp:104
types.h
armarx::navigation::algorithms::Costmap
Definition: Costmap.h:13