38 #ifdef HAVE_SYS_TIME_H 52 ROS_INFO(
"Error, this implementation can only support up to 16 z values (%d)",
size_z_);
57 uint32_t unknown_col = ~((uint32_t)0)>>16;
58 uint32_t* col =
data_;
79 ROS_INFO(
"Error, this implementation can only support up to 16 z values (%d)", size_z);
84 uint32_t unknown_col = ~((uint32_t)0)>>16;
85 uint32_t* col =
data_;
98 uint32_t unknown_col = ~((uint32_t)0)>>16;
99 uint32_t* col =
data_;
108 ROS_DEBUG(
"Error, line endpoint out of bounds. (%.2f, %.2f, %.2f) to (%.2f, %.2f, %.2f), size: (%d, %d, %d)", x0, y0, z0, x1, y1, z1,
119 ROS_DEBUG(
"Error, line endpoint out of bounds. (%.2f, %.2f, %.2f) to (%.2f, %.2f, %.2f), size: (%d, %d, %d)", x0, y0, z0, x1, y1, z1,
129 unsigned int unknown_threshold,
unsigned int mark_threshold,
unsigned char free_cost,
unsigned char unknown_cost,
unsigned int max_length){
137 ROS_DEBUG(
"Error, line endpoint out of bounds. (%.2f, %.2f, %.2f) to (%.2f, %.2f, %.2f), size: (%d, %d, %d)", x0, y0, z0, x1, y1, z1,
149 ROS_DEBUG(
"Error, voxel out of bounds. (%d, %d, %d)\n", x, y, z);
152 uint32_t full_mask = ((uint32_t)1<<z<<16) | (1<<z);
154 unsigned int bits =
numBits(result);
170 ROS_DEBUG(
"Error, voxel out of bounds. (%d, %d)\n", x, y);
176 unsigned int unknown_bits = uint16_t(*col>>16) ^ uint16_t(*col);
177 unsigned int marked_bits = *col>>16;
204 for(
unsigned int z = 0; z <
size_z_; z++){
205 printf(
"Layer z = %u:\n",z);
206 for(
unsigned int y = 0; y <
size_y_; y++){
207 for(
unsigned int x = 0 ; x <
size_x_; x++){
216 printf(
"Column view:\n");
217 for(
unsigned int y = 0; y <
size_y_; y++){
218 for(
unsigned int x = 0 ; x <
size_x_; x++){
VoxelStatus getVoxelColumn(unsigned int x, unsigned int y, unsigned int unknown_threshold=0, unsigned int marked_threshold=0)
static VoxelStatus getVoxel(unsigned int x, unsigned int y, unsigned int z, unsigned int size_x, unsigned int size_y, unsigned int size_z, const uint32_t *data)
VoxelGrid(unsigned int size_x, unsigned int size_y, unsigned int size_z)
Constructor for a voxel grid.
void clearVoxelLineInMap(double x0, double y0, double z0, double x1, double y1, double z1, unsigned char *map_2d, unsigned int unknown_threshold, unsigned int mark_threshold, unsigned char free_cost=0, unsigned char unknown_cost=255, unsigned int max_length=UINT_MAX)
bool bitsBelowThreshold(unsigned int n, unsigned int bit_threshold)
void resize(unsigned int size_x, unsigned int size_y, unsigned int size_z)
Resizes a voxel grid to the desired size.
void markVoxelLine(double x0, double y0, double z0, double x1, double y1, double z1, unsigned int max_length=UINT_MAX)
static unsigned int numBits(unsigned int n)
void raytraceLine(ActionType at, double x0, double y0, double z0, double x1, double y1, double z1, unsigned int max_length=UINT_MAX)
void clearVoxelLine(double x0, double y0, double z0, double x1, double y1, double z1, unsigned int max_length=UINT_MAX)