GCC Code Coverage Report


Directory: ./
File: examples/overview-lie.cpp
Date: 2024-08-27 18:20:05
Exec Total Coverage
Lines: 0 19 0.0%
Branches: 0 56 0.0%

Line Branch Exec Source
1 #include <iostream>
2 #include "pinocchio/multibody/liegroup/liegroup.hpp"
3
4 using namespace pinocchio;
5
6 int main()
7 {
8 typedef double Scalar;
9 enum
10 {
11 Options = 0
12 };
13
14 typedef SpecialEuclideanOperationTpl<2, Scalar, Options> SE2Operation;
15 SE2Operation aSE2;
16 SE2Operation::ConfigVector_t pose_s, pose_g;
17 SE2Operation::TangentVector_t delta_u;
18 delta_u.setZero();
19
20 // Starting configuration
21 pose_s(0) = 1.0;
22 pose_s(1) = 1.0;
23 pose_s(2) = cos(M_PI / 4.0);
24 pose_s(3) = sin(M_PI / 4.0);
25
26 // Goal configuration
27 pose_g(0) = 3.0;
28 pose_g(1) = -1.0;
29 pose_g(2) = cos(-M_PI / 2.0);
30 pose_g(3) = sin(-M_PI / 2.0);
31
32 // Computes the differences (expressed in the tangent space of the configuration space) between
33 // the starting and the goal configuration
34 aSE2.difference(pose_s, pose_g, delta_u);
35 std::cout << "difference: " << delta_u.transpose() << std::endl;
36
37 // Check that the composition of the starting configuration and the difference vector gives the
38 // goal configuration
39 SE2Operation::ConfigVector_t pose_check;
40 aSE2.integrate(pose_s, delta_u, pose_check);
41 std::cout << "goal configuration (from composition): " << pose_check.transpose() << std::endl;
42 std::cout << "goal configuration: " << pose_g.transpose() << std::endl;
43 }
44