43 int main(
int argc,
char** argv) {
45 cout <<
"generating example map" << endl;
51 for (
float x = -2; x <= 0; x += 0.02f) {
52 for (
float y = -2; y <= 0; y += 0.02f) {
53 for (
float z = -2; z <= 0; z += 0.02f) {
61 for (
float x = -1; x <= 0; x += 0.01f) {
62 for (
float y = -1; y <= 0; y += 0.01f) {
63 for (
float z = -1; z <= 0; z += 0.01f) {
70 point3d origin(-1.5, -1.5, -0.5);
75 for(
float z = 0; z <= 0.25; z += 0.125){
78 cout <<
"casting ray from " << origin <<
" in the " << direction <<
" direction"<< endl;
79 bool success = tree.
castRay(origin, direction, ray_end);
82 cout <<
"ray hit cell with center " << ray_end << endl;
87 cout <<
"entrance point is " << intersection << endl;
virtual bool castRay(const point3d &origin, const point3d &direction, point3d &end, bool ignoreUnknownCells=false, double maxRange=-1.0) const
virtual NODE * updateNode(const OcTreeKey &key, float log_odds_update, bool lazy_eval=false)
This class represents a three-dimensional vector.
int main(int argc, char **argv)
octomath::Vector3 point3d
Use Vector3 (float precision) as a point3d in octomap.
virtual bool getRayIntersection(const point3d &origin, const point3d &direction, const point3d ¢er, point3d &intersection, double delta=0.0) const