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

C++ implementation #8

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

sujaygarlanka
Copy link

@sujaygarlanka sujaygarlanka commented Dec 2, 2024

Hello @vaheta and @albertodallolio,

I am Sujay Garlanka. As I was looking into Intrinsic AI to apply to its robotics software engineering opening, I found this repo. After reading the paper and looking through the code, I thought implementing a C++ interface would be a cool opportunity to learn some C++ (this is actually my first C++ project), contribute to open source and understand some of the work done at Intrinsic.

This PR is some of the preliminary work I have done. It is far from complete, however I am putting this PR up to ask some questions I have. I initially used Eigen as the library to deal with all the numpy operations in the python code since this seems to be the default vector/matrix library in C++. However, I am encountering a lot of issues where I have to use for loops to implement vectorized operations in numpy. An alternative is using the tensor class in Eigen, however it is unsupported. I am thinking the best is to use the pytorch tensor library and rewrite the code with that. Before I progress further, I was curious to know what you both recommend. Also, is a C++ interface a useful contribution to this repo?

P.S. Also, this is meant to be a PR for a separate branch, but since no C++ branch exists, just putting it up against main.

Thanks!
Sujay

Copy link

google-cla bot commented Dec 2, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@sujaygarlanka
Copy link
Author

sujaygarlanka commented Dec 30, 2024

Hello @vaheta and @albertodallolio,

I implemented the code using the xtensor library because it provided similar functionality to numpy. The CPP implementation closely mimics the python implementation and I validated it by ensuring test.cpp produced the same output as a similar script using the python implementation (Could always use more testing though!). Some additional feedback I am looking for and work remaining is below.

Feedback

  • Google C++ style formatting, not sure if this what you want.
  • Tried using pass by reference and consts and other CPP best practices, but new to CPP so any advice/feedback here would be really appreciated.
  • Also, any syntactic advice on when to use auto for types, usage of namespaces, etc.

Working remaining

  • Add ability to accept file paths to point clouds instead of only point clouds (minor addition)
  • Build system/CMake for publishing code
  • Update INSTRUCTIONS.md and README.md

Thanks!
Sujay

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.

1 participant