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

Perform check that input point is homogeneous, or take non-homogeneous points as input #30

Open
cglwn opened this issue Jan 27, 2017 · 0 comments

Comments

@cglwn
Copy link

cglwn commented Jan 27, 2017

Ran into this making an example while sleepy. We should anticipate users doing things wrong.

Code Sample

#include <iostream>

#include <lgmath/lgmath.hpp>
#include <Eigen/Core>

int main() {
  // Create a transformation.
  Eigen::Matrix<double, 6, 1> transformation_vector;
  transformation_vector << 2.0, 0.0, 0.0, 0.0, 0.0, 0.0;
  lgmath::se3::Transformation transformation(transformation_vector);

  // Try to transform a non-homogeneous point.
  Eigen::Vector4d point;
  point << 1.0, 2.0, 3.0, 0.0;
  std::cout << "Point after transformation:\n" << transformation * point << "\n";
}

Expected Output

Some error message.

Actual Output

Point after transformation:
1
2
3
0

Solution

Could either:

  1. Throw an exception, or
  2. Change the interfaces to take Eigen::Vector3d.
@cglwn cglwn self-assigned this Jan 27, 2017
@cglwn cglwn changed the title Perform check that input point is homogeneous, or take non homogeneous points as input Perform check that input point is homogeneous, or take non-homogeneous points as input Jan 27, 2017
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

No branches or pull requests

1 participant