Gazebo Physics
API Reference
8.0.0
insert_drive_file
Tutorials
library_books
Classes
toc
Namespaces
insert_drive_file
Files
launch
Gazebo Website
Index
List
Hierarchy
Members: All
Members: Functions
Members: Variables
Members: Typedefs
Members: Enumerations
Members: Enumerator
List
Members
Functions
Typedefs
Variables
Enumerations
Enumerator
src
gz-physics
include
gz
physics
AddedMass.hh
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2022 Open Source Robotics Foundation
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*
16
*/
17
18
#ifndef GZ_PHYSICS_ADDED_MASS_HH_
19
#define GZ_PHYSICS_ADDED_MASS_HH_
20
21
#include <
gz/math/Matrix6.hh
>
22
23
#include <
gz/physics/FeatureList.hh
>
24
25
26
namespace
gz::physics
27
{
28
29
class
AddedMass
:
public
virtual
Feature
30
{
31
public
:
template
<
typename
PolicyT,
typename
FeaturesT>
32
class
Link
:
public
virtual
Feature::Link
<PolicyT, FeaturesT>
33
{
34
public
:
void
SetAddedMass
(
const
gz::math::Matrix6d
&_addedMass);
35
public
:
gz::math::Matrix6d
GetAddedMass
()
const
;
36
};
37
38
public
:
template
<
typename
PolicyT>
39
class
Implementation
:
public
virtual
Feature::Implementation
<PolicyT>
40
{
41
public
:
virtual
void
SetLinkAddedMass
(
const
Identity &_link,
42
const
gz::math::Matrix6d
&_addedMass) = 0;
43
public
:
virtual
gz::math::Matrix6d
GetLinkAddedMass
(
44
const
Identity &_link)
const
= 0;
45
};
46
};
47
48
template
<
typename
PolicyT,
typename
FeaturesT>
49
auto
AddedMass::Link<PolicyT, FeaturesT>::SetAddedMass
(
50
const
gz::math::Matrix6d
&_addedMass) ->
void
51
{
52
this->
template
Interface<AddedMass>()
53
->SetLinkAddedMass(this->identity, _addedMass);
54
}
55
template
<
typename
PolicyT,
typename
FeaturesT>
56
57
auto
AddedMass::Link<PolicyT, FeaturesT>::GetAddedMass
(
58
) const ->
gz
::math::Matrix6d
59
{
60
return
this->
template
Interface<AddedMass>()
61
->GetLinkAddedMass(this->identity);
62
}
63
64
}
// namespace gz::physics
65
66
#endif
// GZ_PHYSICS_ADDED_MASS_HH_)