bmegli / ev3dev-mapping-ui

A cross-platform real-time 3D spatial data visualization
GNU General Public License v3.0
9 stars 4 forks source link

Snapshot function for Laser components #48

Closed bmegli closed 7 years ago

bmegli commented 7 years ago

Add possibility to take 360 degree snapshots from lasers to simple csv files.

For now:

bmegli commented 7 years ago

Already working in snapshot branch but:

This is good enough for what I need now.

bmegli commented 7 years ago

Now I need gyroscope/odometry corrected snapshots (non-stationary, during movement)

This can be either:

Global reference frame seems easier to implement now.

bmegli commented 7 years ago

Implemented in #50 including:

bmegli commented 7 years ago

This implementation still can result in scans from 2 revolultions mixed.

The reasons may be following:

In 960 scans taken around 3 were corrupted this way. This has to be fixed now, it will be extremely difficult to spot when scanning continously.

bmegli commented 7 years ago

Ok, this is how problem manifests (in snapshots, it doesn't affect the main mapping engine)

This is what should be seen (this is next snapshot):

should_be

This is what I get:

is

So it seems that one or 2 UDP packets have not yet been converted to global reference frame when dumping snapshot

bmegli commented 7 years ago

Ok, I believe this is what is happening:

  1. Laser packet arrives
  2. It's calculated in local reference frame
  3. Odometry data has not yet arrived, so it's marked as pending for local2global transform
  4. Second laser packet has arrived
  5. Odometry data for first packet still hasn't arrived
  6. The second packet local-global transform sets pending state to false
  7. The second packet eventually gets transformed but the first was left in local reference frame

The reason this happens is timing - we are not on real time OS and always some lag (even unlikely) is possible.

bmegli commented 7 years ago

I can either:

bmegli commented 7 years ago

The second aproach taken:

As a side effect now also thread internal/thread shared data push has to be circular