NASA Astrobee Robot Software  0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
keepout.h
Go to the documentation of this file.
1 /* Copyright (c) 2017, United States Government, as represented by the
2  * Administrator of the National Aeronautics and Space Administration.
3  *
4  * All rights reserved.
5  *
6  * The Astrobee platform is licensed under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with the
8  * License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15  * License for the specific language governing permissions and limitations
16  * under the License.
17  */
18 
19 #ifndef JSONLOADER_KEEPOUT_H_
20 #define JSONLOADER_KEEPOUT_H_
21 
22 #include <Eigen/Geometry>
23 
24 #include <vector>
25 
26 namespace jsonloader {
27 
28 // Represents a single keepout zone
29 class Keepout {
30  public:
31  using BoundingBox = Eigen::AlignedBox3f;
32  using Sequence = std::vector<BoundingBox>;
33 
34  Keepout(Sequence const& boxes, bool const safe);
35  explicit Keepout(bool const safe);
36 
37  // Get the bounding boxes of this keepout zone
38  Sequence const& GetBoxes() const;
39 
40  // Merge another zone into this one
41  void Merge(Keepout const& zone);
42 
43  // Is this a safe area for the robot to be or not?
44  bool IsSafe() const noexcept;
45 
46  private:
47  Sequence bboxes_; // [ (x0, y0, z0, x1, y1, z1), ... ]
48  bool safe_zone_; // if true, positive spacesz
49 };
50 
51 } // end namespace jsonloader
52 
53 #endif // JSONLOADER_KEEPOUT_H_
jsonloader::Keepout::Keepout
Keepout(Sequence const &boxes, bool const safe)
Definition: keepout.cc:23
jsonloader::Keepout::IsSafe
bool IsSafe() const noexcept
Definition: keepout.cc:36
jsonloader::Keepout::GetBoxes
Sequence const & GetBoxes() const
Definition: keepout.cc:32
jsonloader
Definition: command.h:28
jsonloader::Keepout::BoundingBox
Eigen::AlignedBox3f BoundingBox
Definition: keepout.h:31
jsonloader::Keepout::Sequence
std::vector< BoundingBox > Sequence
Definition: keepout.h:32
jsonloader::Keepout::Merge
void Merge(Keepout const &zone)
Definition: keepout.cc:40
jsonloader::Keepout
Definition: keepout.h:29