asmaloney / asmaloney/libE57Format

How to access individual points?

Open
#307 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
C++
Stars
191
Forks
82
Avg merge
7h 21m
Merged PRs (30d)
1

Description

Hello, first of all thank you for the library and the fantastic effort. This library seems like the more promising option on vcpkg, compared to the original library I believe this one is forked from. I'm well aware that there are no official tutorials and that the documentation is very limited. In the future, I'd honestly like to help a little bit to help others not lose so much time.

My main issue: I need to use E57 format to access a point cloud because it's the only format that seems to work for other tools I'm working with. I'm trying to work with a toy example, so I made a very simple trapezoid of 8 points and exported the ascii format to e57 via cloud compare. The points are really just the following:
```
0.0 0.0 0.0
4.0 0.0 0.0
4.0 4.0 0.0
0.0 4.0 0.0
1.0 1.0 2.0
3.0 1.0 2.0
3.0 3.0 2.0
1.0 3.0 2.0
```

So, I'm really just dipping my toes in E57 to get what I need (and actually keep working with data in PCL). However, I've spent nearly 2 days trying to access each point in what I feel is a very intuitive way: trying to iterate over some kind of array in a loop and print to screen. However, no matter what I've searched, including in this repo's unittesting files, I can't print the value of a single point to screen. Sorry for the rant, and I'm sorry to ask what seems like a novice question, but could someone please help me complete the code below. Thank you very very much in advance.

``` cpp
// above: #include
// (... int main, etc ...)
// load with e57 lib, then convert to point cloud
e57::ReaderOptions opts;
e57::Reader fe(fpath, opts);
int scanIndex = 0;
e57::Data3D scanHeader;

fe.ReadData3D(scanIndex, scanHeader);
int const npts = scanHeader.pointCount;
cout << "npoints: " << npts << endl;

// this part doesn't work correctly
e57::Data3DPointsFloat pointsData(scanHeader);
e57::CompressedVectorReader vectorReader = fe.SetUpData3DPointsData(scanIndex, npts, pointsData);
pcl::PointXYZ ipt(pointsData.cartesianX[0], pointsData.cartesianY[0], pointsData.cartesianZ[0]);
cout << "sample: " << ipt << endl; // somehow scaled /

```
current output:
```
npoints: 8
sample: (-4.31602e+08,-4.31602e+08,-4.31602e+08)
```

Contributor guide

Open the contributing guide

Research direction

Start with E57Format/E57SimpleReader.h and the repository's unittesting files, then trace the ReadData3D and SetUpData3DPointsData calls shown in the issue. Verify the reader usage against the eight-point E57 example; done means the individual coordinates print with the expected values rather than the reported large negative numbers.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
data
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.