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

Lidar Scene Transforms #265

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft

Lidar Scene Transforms #265

wants to merge 16 commits into from

Conversation

patrick-scale
Copy link

No description provided.

@sasha-scale sasha-scale changed the title adding some files Lidar Scene Transforms Apr 7, 2022
@sasha-scale
Copy link
Contributor

Random style comments:
In python, it is conventional to name variables and filenames in snake_case, so I suggest you rename your files to:

IngestDevelopmentScripts/TestScript.py -> ingest_development_dcripts/test_script.py

etc.

@@ -0,0 +1,138 @@
import numpy as np
Copy link
Contributor

Choose a reason for hiding this comment

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

the ordering of these imports is off, we have a pre-commit hook that fixes import oordering automatically, my bet is that you just don't have it installed.

Try running the following in your repo:
poetry run pre-commit install

Copy link
Author

Choose a reason for hiding this comment

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

Having trouble running this

nucleus/sensorfusion.py Outdated Show resolved Hide resolved
nucleus/sensorfusion.py Show resolved Hide resolved
nucleus/sensorfusion.py Show resolved Hide resolved
nucleus/sensorfusion.py Outdated Show resolved Hide resolved
for frame in self.frames:
frame.dev_pose = offset @ frame.dev_pose

def apply_transforms(self, relative: bool = False):
Copy link
Contributor

Choose a reason for hiding this comment

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

what happens if a user double applies make_transforms_relative? is it bad? if yes, we should prevent them from doing it twice (maybe add a boolean flag to represent if it's already been applied)

Copy link
Author

Choose a reason for hiding this comment

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

Commited new changes to handle double transformation

self.make_transforms_relative()
for frame in self.frames:
for item in frame.items:
if isinstance(frame.items[item], RawPointCloud):
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe can get rid of this check, what other class would it be an instance of?

Copy link
Author

Choose a reason for hiding this comment

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

It could be a CameraCalibration object

nucleus/transform.py Outdated Show resolved Hide resolved
def __add__(self, other):
return Transform(other) @ self

def __matmul__(self, other):
Copy link
Contributor

Choose a reason for hiding this comment

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

fancy

Copy link
Author

Choose a reason for hiding this comment

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

this would be the work of a 3d engineer

from pyquaternion import Quaternion


class Transform:
Copy link
Contributor

Choose a reason for hiding this comment

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

seems like the user can supply a lot of different values in the constructor. Do all class methods apply to all possible types of values? if not, you may want to separate into different class types (maybe use inheritance?)

@patrick-scale patrick-scale requested review from tetranoir, ardila, jean-lucas, gatli and pfmark and removed request for jean-lucas April 8, 2022 23:28
@tetranoir tetranoir requested a review from jean-lucas April 11, 2022 16:43
@@ -0,0 +1,43 @@
from nucleus.sensorfusion import *
Copy link
Contributor

Choose a reason for hiding this comment

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

We do this elsewhere in the code but it's generally not good style, so good to avoid if possible

@@ -0,0 +1,43 @@
from nucleus.sensorfusion import *
Copy link
Contributor

@ardila ardila Apr 11, 2022

Choose a reason for hiding this comment

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

This is close to being a real unit test but

A) The test data you use isn't being checked in
B) There are no automatic checks for expected results (i.e. using assert)

Since this is a first pass, fine to skip for now, just letting you know this is VERY close!

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok wait I changed my mind, we need to turn this into a unit test and at least check that it runs. Ok if you don't know how to add checks for the expected results, but somewhere else in the code review I saw we are missing a dependency. If we make this a real unit test, this would have caught that issue.

For an example of a unit test, see any of the files under test/

Copy link
Author

Choose a reason for hiding this comment

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

Will check this out!

@@ -0,0 +1,19 @@
import open3d as o3d
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be added as a project dependency using

poetry add

I think it's as simple as

poetry add open3d

@@ -0,0 +1,275 @@
import numpy as np
import transforms3d as t3d
Copy link
Contributor

Choose a reason for hiding this comment

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

2 more undeclared dependency that needs to be added so when users

pip install scale-nucleus

they won't get an error when running this file.

Copy link
Contributor

@ardila ardila left a comment

Choose a reason for hiding this comment

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

I think this is clean, self contained at a high level. Nice job patrick. I really like where you landed with the high level design of this. There are few concepts for users to learn and they appear to be easy to use.

We do need to add unit tests to ensure that it works as expected for our users. For example, right now users would get import errors, because some of the dependencies of this code have not been added to the project.

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.

3 participants