You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I have encountered an issue with the Pointcloud.cs script.
The pointcloud constructor(taking subscribed depth and rgb images) gives a Null Reference Error when used to create a PointCloud object. Is anyone else facing this issue?
@MartinBischoff in your comment in a different post, you've mentioned that pointcloud.cs script gets the points in 3D from the 2 2D images. Could you please clarify?
Obtaining the points in 3D from a PointCloud2 message works( but as expected is slow), but the other constructor that takes 2 2D images to give 3D points gives Null Reference error
Code below shows at which line the error occurs:
public PointCloud(Image depthImage, Image rgbImage, float focal)
{
int width = depthImage.width;
int height = depthImage.height;
float invFocal = 1.0f / focal;
Points = new RgbPoint3[width * height];
for (int v = 0; v < height; v++)
{
for (int u = 0; u < width; u++)
{
float depth = 0;
if (depth == 0)
{
Points[u + v * width].x = float.NaN; //**error occurs here**
Points[u + v * width].y = float.NaN;
Points[u + v * width].z = float.NaN;
Points[u + v * width].rgb = new int[] { 0, 0, 0 };
}
else
{
Points[u + v * width].z = depth * invFocal;
Points[u + v * width].x = u * depth * invFocal;
Points[u + v * width].y = v * depth * invFocal;
Points[u + v * width].rgb = new int[] { 0, 0, 0 };
}
}
}
}
Also since there seems to be many who are trying to visualise pointcloud data in unity with Ros-Sharp, I request you to kindly consider sharing your turtlebot application code somewhere outside the Ros-Sharp repository, as it would not need to be administrated outside ros sharp and at the same time would offer a lot of help.
Thanks and Best Regards
The text was updated successfully, but these errors were encountered:
it seems like there is no update. If I had helpful answers to the questions in your mail, I would have answered them already.
Maybe it would help to address your questions not to me personally?
In the end this is a public issue board in an open source project and not a one-person-helpdesk.
Maybe also a more precise formulation of the actual problem you are having would help?
My little or not helpful comments to the questions you wrote above are:
(1) I have not yet faced the issue you described above when creating a PointCloud object with the PointCloud.cs class.
(2) As discussed in the other post, we created a mesh of 3d points out of 2 2d images, an rgb image and a depth image. It is exactly the method you referenced above which I was talking about.
(3) Thank you also for appeciating the turtlebot application code. I am aware that people are interested in our stuff and we are taking your request into consideration. Please let myself decide where and when I upload which of my source code.
Sorry that I can not help futher for the time being.
Hi,
I have encountered an issue with the Pointcloud.cs script.
The pointcloud constructor(taking subscribed depth and rgb images) gives a Null Reference Error when used to create a PointCloud object. Is anyone else facing this issue?
@MartinBischoff in your comment in a different post, you've mentioned that pointcloud.cs script gets the points in 3D from the 2 2D images. Could you please clarify?
Obtaining the points in 3D from a PointCloud2 message works( but as expected is slow), but the other constructor that takes 2 2D images to give 3D points gives Null Reference error
Code below shows at which line the error occurs:
Also since there seems to be many who are trying to visualise pointcloud data in unity with Ros-Sharp, I request you to kindly consider sharing your turtlebot application code somewhere outside the Ros-Sharp repository, as it would not need to be administrated outside ros sharp and at the same time would offer a lot of help.
Thanks and Best Regards
The text was updated successfully, but these errors were encountered: