Sole.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-2019, CNRS-UM LIRMM
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25  * POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 #pragma once
29 
30 #include <mc_rtc/Configuration.h>
31 
32 namespace lipm_walking
33 {
34 
38 struct Sole
39 {
40  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
41 
42  Eigen::Vector2d leftAnkleOffset =
43  Eigen::Vector2d::Zero();
44  double friction = 0.7;
45  double halfLength = 0.112;
46  double halfWidth = 0.065;
47 };
48 
49 } // namespace lipm_walking
50 
54 namespace mc_rtc
55 {
56 
57 template<>
58 struct ConfigurationLoader<lipm_walking::Sole>
59 {
60  static lipm_walking::Sole load(const mc_rtc::Configuration & config)
61  {
62  lipm_walking::Sole sole;
63  config("friction", sole.friction);
64  config("half_length", sole.halfLength);
65  config("half_width", sole.halfWidth);
66  return sole;
67  }
68 
69  static mc_rtc::Configuration save(const lipm_walking::Sole & sole)
70  {
71  mc_rtc::Configuration config;
72  config.add("friction", sole.friction);
73  config.add("half_length", sole.halfLength);
74  config.add("half_width", sole.halfWidth);
75  return config;
76  }
77 };
78 
79 } // namespace mc_rtc
double halfLength
Half-length of the sole in [m].
Definition: Sole.h:45
double halfWidth
Half-width of the sole in [m].
Definition: Sole.h:46
Framework namespace, only used to add a configuration loader.
Definition: Contact.h:340
double friction
Friction coefficient.
Definition: Sole.h:44
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Eigen::Vector2d leftAnkleOffset
Offset from center to ankle frames in the left sole frame.
Definition: Sole.h:42
Main controller namespace.
Definition: build.dox:1
static lipm_walking::Sole load(const mc_rtc::Configuration &config)
Definition: Sole.h:60
Foot sole properties.
Definition: Sole.h:38
static mc_rtc::Configuration save(const lipm_walking::Sole &sole)
Definition: Sole.h:69