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

Construct and convert CartesianPose from rotation or transformation matrices #146

Closed
eeberhard opened this issue Oct 20, 2023 · 2 comments · Fixed by #214
Closed

Construct and convert CartesianPose from rotation or transformation matrices #146

eeberhard opened this issue Oct 20, 2023 · 2 comments · Fixed by #214
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@eeberhard
Copy link
Member

It would be convenient to be able to construct a CartesianPose object from a 4x4 transformation object. Similarly, it would be convenient to have a direct method get_transformation_matrix() or similar to return the pose as a 4x4 transformation matrix.

The 3x3 rotation matrix could be handled similarly, though for construction it would take either a 3vector for position or set position to 0.

This feature would make operations with other standard representations even easier.

@eeberhard eeberhard added enhancement New feature or request good first issue Good for newcomers labels Oct 20, 2023
@domire8
Copy link
Member

domire8 commented Jan 7, 2025

  1. get_transformation_matrix() already exists as function of CartesianState
  2. Adding constructors like
    explicit CartesianPose(const std::string& name, const Eigen::Matrix4d& transformation_matrix, const std::string& reference = "world");
    
    is not as easy as it looks because it conflicts with existing constructors that Eigen is not able to resolve. We already have
    explicit CartesianPose(const std::string& name, const Eigen::Vector3d& position, const std::string& reference = "world");
    
    so then everything thats something like CartesianPose("A", 10 * Eigen::Vector3d::Random()) becomes ambiguous to the compiler.
  3. One way to avoid this is to make a static method CartesianPose CartesianPose::from_transformation_matrix, if we want that

@eeberhard
Copy link
Member Author

get_transformation_matrix() already exists as function of CartesianState

Since 4 years no less, how lovely!

Option 3 with a static method could be nice 👍

@domire8 domire8 linked a pull request Jan 10, 2025 that will close this issue
1 task
@domire8 domire8 self-assigned this Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants