dynamic_model.cc
Go to the documentation of this file.
1 /******************************************************************************
2 Copyright (c) 2018, Alexander W. Winkler. All rights reserved.
3 
4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following conditions are met:
6 
7 * Redistributions of source code must retain the above copyright notice, this
8  list of conditions and the following disclaimer.
9 
10 * Redistributions in binary form must reproduce the above copyright notice,
11  this list of conditions and the following disclaimer in the documentation
12  and/or other materials provided with the distribution.
13 
14 * Neither the name of the copyright holder nor the names of its
15  contributors may be used to endorse or promote products derived from
16  this software without specific prior written permission.
17 
18 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 ******************************************************************************/
29 
31 
32 namespace towr {
33 
34 DynamicModel::DynamicModel(double mass, int ee_count)
35 {
36  m_ = mass;
37  g_ = 9.80665;
38 
39  com_pos_.setZero();
40  com_acc_.setZero();
41 
42  w_R_b_.setIdentity();
43  omega_.setZero();
44  omega_dot_ .setZero();
45 
46  ee_force_ = EELoad(ee_count);
47  ee_pos_ = EEPos(ee_count);
48 }
49 
50 void
51 DynamicModel::SetCurrent (const ComPos& com_W, const Vector3d com_acc_W,
52  const Matrix3d& w_R_b, const AngVel& omega_W, const Vector3d& omega_dot_W,
53  const EELoad& force_W, const EEPos& pos_W)
54 {
55  com_pos_ = com_W;
56  com_acc_ = com_acc_W;
57 
58  w_R_b_ = w_R_b;
59  omega_ = omega_W;
60  omega_dot_ = omega_dot_W;
61 
62  ee_force_ = force_W;
63  ee_pos_ = pos_W;
64 }
65 
66 } /* namespace towr */
Vector3d com_acc_
x-y-z acceleration of the Center-of-Mass.
Eigen::Vector3d AngVel
Definition: dynamic_model.h:72
Matrix3d w_R_b_
rotation matrix from base (b) to world (w) frame.
std::vector< Eigen::Vector3d > EEPos
Definition: dynamic_model.h:75
Eigen::Matrix3d Matrix3d
Definition: dynamic_model.h:70
Vector3d omega_dot_
angular acceleration expressed in world frame.
ComPos com_pos_
x-y-z position of the Center-of-Mass.
Eigen::Vector3d Vector3d
Definition: dynamic_model.h:69
AngVel omega_
angular velocity expressed in world frame.
Eigen::Vector3d ComPos
Definition: dynamic_model.h:71
void SetCurrent(const ComPos &com_W, const Vector3d com_acc_W, const Matrix3d &w_R_b, const AngVel &omega_W, const Vector3d &omega_dot_W, const EELoad &force_W, const EEPos &pos_W)
Sets the current state and input of the system.
EELoad ee_force_
The endeffector force expressed in world frame.
EEPos ee_pos_
The x-y-z position of each endeffector.
DynamicModel(double mass, int ee_count)
Construct a dynamic object. Protected as this is abstract base class.
double g_
gravity acceleration [m/s^2]
double m_
mass of the robot


towr
Author(s): Alexander W. Winkler
autogenerated on Fri Apr 2 2021 02:14:16