30 #ifndef COSTMAP_CSPACE_CSPACE3_CACHE_H 31 #define COSTMAP_CSPACE_CSPACE3_CACHE_H 40 std::unique_ptr<char[]>
c_;
51 size_[0] = size_[1] = size_[2] = 0;
52 center_[0] = center_[1] = center_[2] = 0;
53 stride_[0] = stride_[1] = stride_[2] = 0;
55 void reset(
const int& x,
const int& y,
const int& yaw)
63 array_size_ = size_[0] * size_[1] * size_[2];
64 c_.reset(
new char[array_size_]);
65 memset(c_.get(), 0, array_size_ *
sizeof(char));
67 stride_[1] = size_[0];
68 stride_[2] = size_[0] * size_[1];
71 char&
e(
const int& x,
const int& y,
const int& yaw)
73 const size_t addr = yaw * stride_[2] + (y + center_[1]) * stride_[1] + (x + center_[0]);
78 const char&
e(
const int& x,
const int& y,
const int& yaw)
const 80 const size_t addr = yaw * stride_[2] + (y + center_[1]) * stride_[1] + (x + center_[0]);
85 void getSize(
int& x,
int& y,
int& a)
const 100 #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)