ISAAC  0.2.11
Flight software for the ISAAC project, adding functionality to the Astrobee robot, operating inside the International Space Station.
All Classes Functions Variables Pages
panorama_survey.h
1 /* Copyright (c) 2021, United States Government, as represented by the
2  * Administrator of the National Aeronautics and Space Administration.
3  *
4  * All rights reserved.
5  *
6  * The "ISAAC - Integrated System for Autonomous and Adaptive Caretaking
7  * platform" software is licensed under the Apache License, Version 2.0
8  * (the "License"); you may not use this file except in compliance with the
9  * License. You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16  * License for the specific language governing permissions and limitations
17  * under the License.
18  */
19 
20 #ifndef INSPECTION_PANORAMA_SURVEY_H_
21 #define INSPECTION_PANORAMA_SURVEY_H_
22 
23 #include <cstdint>
24 #include <unordered_map>
25 #include <utility>
26 #include <vector>
27 
28 #define RAD_FROM_DEG(x) ((x) * M_PI / 180.0)
29 #define DEG_FROM_RAD(x) ((x) * 180.0 / M_PI)
30 
31 namespace inspection {
32 
33 class PanoAttitude {
34  public:
35  double pan; // radians, 0=forward, increases to the right
36  double tilt; // radians, 0=forward, increases upward
37  int16_t iy; // row index, 0=top row
38  int16_t ix; // column index, 0=left column
39 
40  inline PanoAttitude(double _pan, double _tilt, int16_t _iy, int16_t _ix) :
41  pan(_pan),
42  tilt(_tilt),
43  iy(_iy),
44  ix(_ix)
45  {}
46 };
47 
48 typedef std::pair<int, int> OrientLookupKey;
49 typedef std::pair<int, inspection::PanoAttitude> OrientLookupValue;
50 typedef std::unordered_map<OrientLookupKey, OrientLookupValue, boost::hash<OrientLookupKey> > OrientLookupMap;
51 
52 void get_orient_lookup(OrientLookupMap* orient_lookup_out,
53  const std::vector<PanoAttitude>& orientations);
54 
55 void GeneratePanoOrientations(std::vector<PanoAttitude>* orientations_out,
56  int* nrows_out,
57  int* ncols_out,
58  double pan_radius, double tilt_radius,
59  double h_fov, double v_fov,
60  double overlap, double attitude_tolerance);
61 
62 } // namespace inspection
63 
64 #endif // INSPECTION_PANORAMA_SURVEY_H_
inspection::PanoAttitude
Definition: panorama_survey.h:33