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 
32 {
33 
34  SceneBounds computeSceneBounds(const VirtualRobot::SceneObjectSetPtr& obstacles,
35  const std::vector<VirtualRobot::RobotPtr>& articulatedObjects,
36  const SceneBounds& init = SceneBounds(),
37  float margin = 0);
38 
39  SceneBounds toSceneBounds(const VirtualRobot::WorkspaceGrid::Extends& extends);
40 
41  SceneBounds merge(const std::vector<SceneBounds>& sceneBounds);
42 
43 
44  Costmap toCostmap(const VirtualRobot::WorkspaceGrid& workspaceGrid);
45 
46 
47  // Costmap mergeUnaligned(const std::vector<Costmap>& costmaps,
48  // const std::vector<float>& weights,
49  // float cellSize = -1,
50  // const Eigen::Array2f& offset = Eigen::Array2f::Zero());
51 
52  void checkSameSize(const std::vector<Costmap>& costmaps);
53 
54  /**
55  * @brief Defines how the
56  *
57  */
58  enum class CostmapMergeMode
59  {
60  MAX,
61  MIN,
62  AVERAGE
63  };
64 
65  Costmap mergeAligned(const std::vector<Costmap>& costmaps, CostmapMergeMode mode);
66  Costmap mergeAligned(const std::vector<Costmap>& costmaps, const std::vector<float>& weights);
67 
68  Costmap scaleCostmap(const Costmap& costmap, float cellSize);
69 
70  std::optional<core::Pose2D> sampleValidPositionInMap(const algorithms::Costmap& costmap);
71 
72 } // namespace armarx::navigation::algorithms
armarx::navigation::algorithms::CostmapMergeMode
CostmapMergeMode
Defines how the.
Definition: util.h:58
armarx::navigation::algorithms::merge
SceneBounds merge(const std::vector< SceneBounds > &sceneBounds)
Definition: util.cpp:119
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:225
armarx::navigation::algorithms::mergeAligned
Costmap mergeAligned(const std::vector< Costmap > &costmaps, CostmapMergeMode mode)
Definition: util.cpp:239
Costmap.h
armarx::navigation::algorithms::computeSceneBounds
SceneBounds computeSceneBounds(const VirtualRobot::SceneObjectSetPtr &obstacles, const std::vector< VirtualRobot::RobotPtr > &articulatedObjects, const SceneBounds &init, const float margin)
Definition: util.cpp:56
armarx::navigation::algorithms::scaleCostmap
Costmap scaleCostmap(const Costmap &costmap, float cellSize)
Definition: util.cpp:311
armarx::navigation::util::articulatedObjects
objpose::ObjectPoseSeq articulatedObjects(objpose::ObjectPoseSeq objects)
Definition: util.cpp:95
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:368
armarx::navigation::algorithms::toSceneBounds
SceneBounds toSceneBounds(const VirtualRobot::WorkspaceGrid::Extends &extends)
Definition: util.cpp:112
armarx::navigation::algorithms::toCostmap
Costmap toCostmap(const VirtualRobot::WorkspaceGrid &workspaceGrid)
Definition: util.cpp:140
types.h
armarx::navigation::algorithms::Costmap
Definition: Costmap.h:13