params.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /******************************************************************************
  2. * Copyright 2020 The Apollo Authors. All Rights Reserved.
  3. *
  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. *****************************************************************************/
  16. #pragma once
  17. #include <vector>
  18. namespace apollo {
  19. namespace perception {
  20. namespace lidar {
  21. class Params {
  22. public:
  23. static constexpr float kPillarXSize = 0.25f;
  24. static constexpr float kPillarYSize = 0.25f;
  25. static constexpr float kPillarZSize = 8.0f;
  26. static constexpr float kMinXRange = -100.0f;
  27. static constexpr float kMinYRange = -70.0f;
  28. static constexpr float kMinZRange = -5.0f;
  29. static constexpr float kMaxXRange = 100.0f;
  30. static constexpr float kMaxYRange = 70.0f;
  31. static constexpr float kMaxZRange = 3.0f;
  32. static constexpr int kNumClass = 9;
  33. static constexpr int kMaxNumPillars = 30000;
  34. static constexpr int kMaxNumPointsPerPillar = 60;
  35. static constexpr int kNumPointFeature = 5; // x, y, z, i, delta of time
  36. static constexpr int kNumGatherPointFeature = 9;
  37. static constexpr int kNumAnchor = 200 * 140 * 8 + 220 * 140 * 8;
  38. static constexpr int kNumOutputBoxFeature = 7;
  39. static constexpr int kBatchSize = 1;
  40. static constexpr int kNumIndsForScan = 1024;
  41. static constexpr int kNumThreads = 64;
  42. static constexpr int kNumBoxCorners = 4;
  43. static std::vector<int> AnchorStrides() { return std::vector<int>{4, 2}; }
  44. static std::vector<int> NumAnchorSets() { return std::vector<int>{8, 8}; }
  45. static std::vector<std::vector<float>> AnchorDxSizes() {
  46. return std::vector<std::vector<float>>{
  47. std::vector<float>{2.94046906f, 1.95017717f, 2.73050468f, 2.4560939f},
  48. std::vector<float>{2.49008838f, 0.60058911f, 0.76279481f, 0.66344886f,
  49. 0.39694519f}};
  50. }
  51. static std::vector<std::vector<float>> AnchorDySizes() {
  52. return std::vector<std::vector<float>>{
  53. std::vector<float>{11.1885991, 4.60718145f, 6.38352896f, 6.73778078f},
  54. std::vector<float>{0.48578221f, 1.68452161f, 2.09973778f, 0.7256437f,
  55. 0.40359262f}};
  56. }
  57. static std::vector<std::vector<float>> AnchorDzSizes() {
  58. return std::vector<std::vector<float>>{
  59. std::vector<float>{3.47030982f, 1.72270761f, 3.13312415f, 2.73004906f},
  60. std::vector<float>{0.98297065f, 1.27192197f, 1.44403034f, 1.75748069f,
  61. 1.06232151f}};
  62. }
  63. static std::vector<std::vector<float>> AnchorZCoors() {
  64. return std::vector<std::vector<float>>{
  65. std::vector<float>{-0.0715754f, -0.93897414f, -0.08168083f,
  66. -0.37937912f},
  67. std::vector<float>{-1.27247968f, -1.03743013f, -0.99194854f,
  68. -0.73911038f, -1.27868911f}};
  69. }
  70. static std::vector<std::vector<int>> NumAnchorRo() {
  71. return std::vector<std::vector<int>>{std::vector<int>{2, 2, 2, 2},
  72. std::vector<int>{2, 2, 2, 1, 1}};
  73. }
  74. static std::vector<std::vector<float>> AnchorRo() {
  75. return std::vector<std::vector<float>>{
  76. std::vector<float>{0, M_PI / 2, 0, M_PI / 2, 0, M_PI / 2, 0, M_PI / 2},
  77. std::vector<float>{0, M_PI / 2, 0, M_PI / 2, 0, M_PI / 2, 0, 0}};
  78. }
  79. private:
  80. Params() = default;
  81. ~Params() = default;
  82. }; // class Params
  83. } // namespace lidar
  84. } // namespace perception
  85. } // namespace apollo