3 #include <affx/affine.hpp>
12 struct DenavitHartenbergParameter {
16 Affine get_transformation(
double theta)
const {
17 Affine rot1 {0, 0, 0, theta, 0, 0};
18 Affine trans1 {0, 0, d, 0, 0, 0};
19 Affine trans2 {a, 0, 0, 0, 0, 0};
20 Affine rot2 {0, 0, 0, 0, 0, alpha};
21 return rot2 * trans2 * rot1 * trans1;
25 std::array<DenavitHartenbergParameter, DoFs> parameters;
29 explicit KinematicChain(
const std::array<DenavitHartenbergParameter, DoFs>& parameters,
const Affine& base): parameters(parameters), base(base) { }
33 for (
size_t i = 0; i < DoFs; ++i) {
34 result = result * parameters[i].get_transformation(q[i]);