octomap castRay returns a point in opposite direction
PointOutT origin;
origin.x = -1;
origin.y = 1.2;
origin.z = -0.5;
PointOutT d; // direction
d.x = 0;
d.y = 1;
d.z = 0;
tree.castRay(origin,d,end,true,-1)
returns true and end=(-1.0198,0.9802,-0.5198)
Can I be assured that this happens only if there is no point in the actual direction .
More Details:
PointOutT is of type PointXYZRGBCamSL as defined in: https://github.com/aa755/scene_labelling_rgbd/blob/release2/scene_processing/src/includes/point_types.h
tree is a member of my class OccupancyMap ... I have included the relevant snippets . How do I get the version of OctomapStack?
class OccupancyMap
{
float resolution;
octomap::OcTreeROS tree;
pcl::PointCloud<pcl::PointXYZ> xyzcloud;
public:
OccupancyMap(pcl::PointCloud<PointOutT> & cloud, float resolution_ = 0.02) : tree(resolution_)
{
cloudSeg=& cloud;
resolution = resolution_;
convertToXYZ(cloud, xyzcloud);
tree.insertScan(xyzcloud, convertFromVector(cloud.sensor_origin_), -1, true);
}
static void convertToXYZ(const pcl::PointCloud<PointOutT> &cloud, pcl::PointCloud<pcl::PointXYZ> & cloudxyz)
{
cloudxyz.points.resize(cloud.size());
for (size_t i = 0; i < cloud.size(); i++)
{
cloudxyz.points[i].x = cloud.points[i].x;
cloudxyz.points[i].y = cloud.points[i].y;
cloudxyz.points[i].z = cloud.points[i].z;
}
}
...
version is ros-diamondback-octomap-mapping_0.3.3-s1313567137~maverick_amd64.deb .Please let me know if you have more questions .. I can send the entire code and pointcloud if you wish