I have a RCP project that apparently is missing the 2D structure for its stations, since I can't see the “mirror balls” in Recap.
Still, the RCScan::isStructured() returns true.
But, then, when I call RCScan::getStructuredScan(), I get a null pointer.
Is this a bug?
Solved! Go to Solution.
Solved by martin.graner. Go to Solution.
It is possible that the rcp project is somehow damaged. I was able to write an unstructured rcp project where strucutured rcs files were in the support folder. Simplest way to check that is to upload it here to get the project checked, or try to import the rcs files in ReCap and see if then there are mirrorballs. If in the support folder are only RCS files and nothing else then I guess it might be unstructured.
Did you call getScanAt(...), or something prior befor calling getStructuredScan()?
Is your project loaded correctly before that? loadFromFile(...)
Thanks Martin for your help.
Indeed:
So it seems the RCP is damaged.
To get the structured scan, I call RCProject::loadFromFile(), then getScanAt(), then isStructured(), then getStructuredScan().
Xavier
Could you help to upload your .rcp file here so that we can investigate on the issue? Thank you!
Got it. No problem. We will try to reproduce it and will let you know when it is ready for release.
Thanks,
Yan
Hi @yan.fu,
I can share a point cloud with you where I got this issue vice versa. The RCS point cloud is unstructured, while the project returns true when calling RCScan->isStructured().
You can download it from:
RCP Project unstructured issue
Edit: Sry for the project size
My workaround for this would be to check in addition RCScan->getStructuredScanWidth() and RCScan->getStructuredScanHeight() and if one of these returns 0 I'd switch to unstructured.
Hi @martin.graner , @lamorlette,
Thank you both for valuable feedback.
I have tried your .rcp and can reproduce this issue. For the .rcp file, what I can see if that this scan was originally from some structured scan because it has been segmented using structured scan information and the segment information is written into. rcs file. So Reality Solutions SDK returns true for isStructuredScan(). We will fix it this issue by more checking.
For now, check RCScan::getStructuredScan()==nullptr is more reliable to use.
Thanks again for your feedback.
Yan
@martin.graner I have a case where:
I'm trying to see if I can share this project for investigations.
@lamorletteThanks for mentioning this. Then we should indeed take the way @yan.fu mentioned.
@yan.fu: It should be possible to use
RCScan::createPointIterator() IRCPointIterator->moveToNextPoint(); const IRCPointAccessor &point = IRCPointIterator->getPoint();
on a structured scan to read it like an unstructured scan or?
So if the opposite happens, that the scan is structured but RCScan->isstructured() returns false I can import it as an unstructured scan without my application crashing?
IRCPointIterator only iterates the points inside .rcs file for now, no matter it is structured scan or not.
If you want to get structured scan (.rcc) information, you can use RCStructuredScan to read point for each grid point.
This sounds like an unusual case.
If you could share your data for us to investigate, it would be helpful. We don't use it for any other purpose.
Thanks,
Yan
I don't have a data set for the mentioned case.
It was only theoretical to prevent application crash if this (ever) happens.
Thanks for the answer.
Can't find what you're looking for? Ask the community or share your knowledge.
