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

adding support for loading trajectories and loading quaternions #4

Merged
merged 2 commits into from
Mar 7, 2018
Merged

adding support for loading trajectories and loading quaternions #4

merged 2 commits into from
Mar 7, 2018

Conversation

mlautman
Copy link
Contributor

@mlautman mlautman commented Mar 2, 2018

Adding support for loading Eigen poses from their quaternions and loading a waypoint trajectory.

param6: [1, 1, 1, 1, 0, 0, 0] # Eigen::Affine3d - x, y, z, qw, qz, qy, qz
param7: [1, 1, 1, 1, 0, 0, 0, 2, 2, 2, 1, 0, 0, 0] # EigenSTL::vector_Affine3d - [x, y, z, qw, qz, qy, qz, x, y, z, qw, qz, qy, qz]
param8: [1, 1, 1, 3.14, 0, 0, 3, 3, 3, 3.14, 0, 0] # Eigen::Affine3d - x, y, z, roll, pitch, yaw
Copy link
Member

Choose a reason for hiding this comment

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

is this a vector also?

param5: [1.1, 2.2, 3.3, 4.4] # std::vector<double>
param6: [1, 1, 1, 1, 0, 0, 0] # Eigen::Affine3d - x, y, z, qw, qz, qy, qz
param7: [1, 1, 1, 1, 0, 0, 0, 2, 2, 2, 1, 0, 0, 0] # EigenSTL::vector_Affine3d - [x, y, z, qw, qz, qy, qz, x, y, z, qw, qz, qy, qz]
Copy link
Member

Choose a reason for hiding this comment

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

i don't like this approach, why not:

param7:
    - [1, 1, 1, 1, 0, 0, 0]
    - [1, 1, 1, 1, 0, 0, 0]
    - [1, 1, 1, 1, 0, 0, 0]

output: EigenSTL::vector_Affine3d

* \brief Convert from N * 6 doubles of [x,y,z] [r,p,y] or N * 7 doubles of [x, y, z, qw, qx, qy, qz] to a vector of N transforms.
* \return true on success
*/

Copy link
Member

Choose a reason for hiding this comment

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

remove space

* \return true on success
*/
bool convertDoublesToEigen(const std::string &parent_name, std::vector<double> values, Eigen::Affine3d &transform);

/**
* \brief Convert from N * 6 doubles of [x,y,z] [r,p,y] or N * 7 doubles of [x, y, z, qw, qx, qy, qz] to a vector of N transforms.
Copy link
Member

Choose a reason for hiding this comment

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

this N6 or N7 thing is a bad idea for the reason you were explaining to me

double qw = values[3];
double qx = values[4];
double qy = values[5];
double qz = values[6];
Copy link
Member

Choose a reason for hiding this comment

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

don't instantiate all this memory - pass the values directly into the Eigen() calls

Eigen::Quaternion<double> quaternion = roll_angle * pitch_angle * yaw_angle;

transform = Eigen::Translation3d(values[0], values[1], values[2]) * quaternion;
bool convertDoublesToEigenVector(const std::string &parent_name, std::vector<double> values, EigenSTL::vector_Affine3d& waypoints)
Copy link
Member

Choose a reason for hiding this comment

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

please rework this to take in a set of poses, not one long ugly array that is very error prone

@mlautman
Copy link
Contributor Author

mlautman commented Mar 6, 2018

I removed the EigenSTL stuff because I ended up not needing it anyway. I might take another pass at it in the future.

@davetcoleman davetcoleman merged commit 84707bd into PickNikRobotics:kinetic-devel Mar 7, 2018
@davetcoleman davetcoleman deleted the kinetic-devel-eigen-additions branch March 7, 2018 01:53
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.

2 participants