49 ROS_INFO(
"Error, this implementation can only support up to 16 z values (%d)",
size_z_);
54 uint32_t unknown_col = ~((uint32_t)0)>>16;
55 uint32_t* col =
data_;
76 ROS_INFO(
"Error, this implementation can only support up to 16 z values (%d)", size_z);
81 uint32_t unknown_col = ~((uint32_t)0)>>16;
82 uint32_t* col =
data_;
95 uint32_t unknown_col = ~((uint32_t)0)>>16;
96 uint32_t* col =
data_;
105 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,
116 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,
126 unsigned int unknown_threshold,
unsigned int mark_threshold,
unsigned char free_cost,
unsigned char unknown_cost,
unsigned int max_length){
134 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,
146 ROS_DEBUG(
"Error, voxel out of bounds. (%d, %d, %d)\n", x, y, z);
149 uint32_t full_mask = ((uint32_t)1<<z<<16) | (1<<z);
151 unsigned int bits =
numBits(result);
167 ROS_DEBUG(
"Error, voxel out of bounds. (%d, %d)\n", x, y);
173 unsigned int unknown_bits = uint16_t(*col>>16) ^ uint16_t(*col);
174 unsigned int marked_bits = *col>>16;
201 for(
unsigned int z = 0; z <
size_z_; z++){
202 printf(
"Layer z = %u:\n",z);
203 for(
unsigned int y = 0; y <
size_y_; y++){
204 for(
unsigned int x = 0 ; x <
size_x_; x++){
213 printf(
"Column view:\n");
214 for(
unsigned int y = 0; y <
size_y_; y++){
215 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)