Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load trace.csv, navvis artifact. #58

Merged
merged 20 commits into from
Mar 27, 2024
Merged

Conversation

pablospe
Copy link
Contributor

@pablospe pablospe commented Feb 2, 2024

From: https://knowledge.navvis.com/docs/mapping-path

For every dataset, the file trace.csv contains position, orientation, and magnetic field information in frequent intervals. Example:

#nsecs,  x, y, z,  ori_w, ori_x, ori_y, ori_z,  mag_x, mag_y, mag_z
1478254247676381327, 8.84298e-07, 1.28572e-06, -0.2, 0.999992, 0.000376351, 0.00401342, 1.90039e-07,  -6.51576e-07, -3.18442e-06, -3.36381e-05
1478254247783401487, 0.00150315, 0.000978242, -0.2, 0.999992, 0.000330729, 0.00398468, -6.80018e-05,  -1.30323e-06, -3.18672e-06, -3.33109e-05

sensors['trace'] = create_sensor('trace', name='Mapping path')
for trace in nv.get_trace():
timestamp_us = int(trace["nsecs"]) // 1_000 # convert from ns to us
qvec = np.array([trace["ori_w"], trace["ori_x"], trace["ori_y"], trace["ori_z"]], dtype=np.float64)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure about the convetion used for this file? (i.e., rig to world vs world to rig). Should the trace "sensor" be added to the rig?

Copy link
Collaborator

@mihaidusmanu mihaidusmanu Feb 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah nevermind, just saw the documentation above (maybe worth adding that link to the parsing fo trace in the navvis class)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I need to re-iterate on this PR, I will mark it as draft for the moment, apologies. Thanks for noticing this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conversion in this file was actually imu to world! I fixed it in the commits now. It should be ready for review again

Copy link
Contributor Author

@pablospe pablospe Mar 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the trace "sensor" be added to the rig?

I was moving everything suck that the trace entry in the trajectory matches to the "navvis_rig" sensor (when we export as rig). So "trace" is the same as "navvis_rig" but I changed the name so we can filter it (the trace data are a lot of entries). I don't know if this is the best option, perhaps @MarioGini can comment here.

Maybe you are right in adding a new sensor to the rig. I can actually add all the cameras now since we read the sensor_frame.xml so I could create the rig based on this file, rather than faking it from the first frame (the rig now is defined in the cam0, calculated in the first frame).

@pablospe pablospe marked this pull request as draft February 13, 2024 21:15
@pablospe pablospe marked this pull request as ready for review March 12, 2024 14:23
@pablospe pablospe requested a review from vjlux March 12, 2024 14:23
@pablospe
Copy link
Contributor Author

I fixed some issues with cam0 (upright problems and tile_id 0 is not actually identity, so I needed to apply this rotation only to the trace data, if I wanted to put in the same reference frame).

scantools/capture/session.py Outdated Show resolved Hide resolved
scantools/run_navvis_to_capture.py Show resolved Hide resolved
scantools/run_navvis_to_capture.py Show resolved Hide resolved
scantools/run_navvis_to_capture.py Show resolved Hide resolved
scantools/run_navvis_to_capture.py Show resolved Hide resolved
pipelines/pipeline_navvis_rig.py Outdated Show resolved Hide resolved
scantools/run_navvis_to_capture.py Show resolved Hide resolved
@vjlux vjlux merged commit 746f9d9 into microsoft:main Mar 27, 2024
2 checks passed
@pablospe pablospe deleted the pablo/trace branch March 28, 2024 15:40
@pablospe pablospe restored the pablo/trace branch March 28, 2024 15:41
@pablospe
Copy link
Contributor Author

This was merged without squash, I will revert and merged again to keep the git history short.

@sarlinpe
Copy link
Collaborator

sarlinpe commented Mar 28, 2024

Yes please! You could disable merge commits (I don't have permission to do so).

@pablospe
Copy link
Contributor Author

The github button for reverting simply create a new PR reverting the changes, which won't remove the commits from history. I will have to probably do "hard reset" and then "force push" to remove from history from main. Any other alternative?

@sarlinpe
Copy link
Collaborator

You can squash the N commits introduced by the PR (with interactive rebase) and force push - you might need to temporarily disable the branch protection.

pablospe added a commit that referenced this pull request Apr 3, 2024
@pablospe pablospe deleted the pablo/trace branch April 3, 2024 14:26
@pablospe
Copy link
Contributor Author

pablospe commented Apr 3, 2024

Done.

Steps:

  1. # Remove the rules for the main protection (allowing temporally force pushes).
  2. git checkout main
  3. git merge --squash pablo/trace
  4. git commit -m "Load trace.csv, navvis artifact. (#58)"
  5. # Disable force push in main again.

@pablospe
Copy link
Contributor Author

pablospe commented Apr 3, 2024

And final step, now we only "Allow squash merging".

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants