forward_kinematics.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_FORWARD_KINEMATICS_H
  9. #define IGL_FORWARD_KINEMATICS_H
  10. #include <Eigen/Core>
  11. #include <Eigen/Geometry>
  12. #include <Eigen/StdVector>
  13. #include <vector>
  14. namespace igl
  15. {
  16. // Given a skeleton and a set of relative bone rotations compute absolute
  17. // rigid transformations for each bone.
  18. //
  19. // Inputs:
  20. // C #C by dim list of joint positions
  21. // BE #BE by 2 list of bone edge indices
  22. // P #BE list of parent indices into BE
  23. // dQ #BE list of relative rotations
  24. // Outputs:
  25. // vQ #BE list of absolute rotations
  26. // vT #BE list of absolute translations
  27. void forward_kinematics(
  28. const Eigen::MatrixXd & C,
  29. const Eigen::MatrixXi & BE,
  30. const Eigen::VectorXi & P,
  31. const std::vector<
  32. Eigen::Quaterniond,Eigen::aligned_allocator<Eigen::Quaterniond> > & dQ,
  33. std::vector<
  34. Eigen::Quaterniond,Eigen::aligned_allocator<Eigen::Quaterniond> > & vQ,
  35. std::vector<Eigen::Vector3d> & vT);
  36. };
  37. #ifdef IGL_HEADER_ONLY
  38. # include "forward_kinematics.cpp"
  39. #endif
  40. #endif