30 #ifndef COSTMAP_CSPACE_CSPACE3_CACHE_H 31 #define COSTMAP_CSPACE_CSPACE3_CACHE_H 42 std::unique_ptr<char[]>
c_;
53 size_[0] = size_[1] = size_[2] = 0;
54 center_[0] = center_[1] = center_[2] = 0;
55 stride_[0] = stride_[1] = stride_[2] = 0;
57 void reset(
const int& x,
const int& y,
const int& yaw)
65 array_size_ = size_[0] * size_[1] * size_[2];
66 c_.reset(
new char[array_size_]);
67 memset(c_.get(), 0, array_size_ *
sizeof(char));
69 stride_[1] = size_[0];
70 stride_[2] = size_[0] * size_[1];
73 char&
e(
const int& x,
const int& y,
const int& yaw)
75 const size_t addr = yaw * stride_[2] + (y + center_[1]) * stride_[1] + (x + center_[0]);
80 const char&
e(
const int& x,
const int& y,
const int& yaw)
const 82 const size_t addr = yaw * stride_[2] + (y + center_[1]) * stride_[1] + (x + center_[0]);
87 void getSize(
int& x,
int& y,
int& a)
const 102 #endif // COSTMAP_CSPACE_CSPACE3_CACHE_H
void getCenter(int &x, int &y, int &a) const
std::unique_ptr< char[]> c_
void getSize(int &x, int &y, int &a) const
const char & e(const int &x, const int &y, const int &yaw) const
void reset(const int &x, const int &y, const int &yaw)
char & e(const int &x, const int &y, const int &yaw)