include
rotors_gazebo_plugins
motor_model.hpp
Go to the documentation of this file.
1
/*
2
* Copyright 2015 Fadri Furrer, ASL, ETH Zurich, Switzerland
3
* Copyright 2015 Michael Burri, ASL, ETH Zurich, Switzerland
4
* Copyright 2015 Mina Kamel, ASL, ETH Zurich, Switzerland
5
* Copyright 2015 Janosch Nikolic, ASL, ETH Zurich, Switzerland
6
* Copyright 2015 Markus Achtelik, ASL, ETH Zurich, Switzerland
7
*
8
* Licensed under the Apache License, Version 2.0 (the "License");
9
* you may not use this file except in compliance with the License.
10
* You may obtain a copy of the License at
11
*
12
* http://www.apache.org/licenses/LICENSE-2.0
13
14
* Unless required by applicable law or agreed to in writing, software
15
* distributed under the License is distributed on an "AS IS" BASIS,
16
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
* See the License for the specific language governing permissions and
18
* limitations under the License.
19
*/
20
21
22
#ifndef ROTORS_GAZEBO_PLUGINS_MOTOR_MODEL_H
23
#define ROTORS_GAZEBO_PLUGINS_MOTOR_MODEL_H
24
25
#include <Eigen/Eigen>
26
27
class
MotorModel
28
{
29
public
:
30
MotorModel
()
31
:
motor_rot_vel_
(0.0),
32
ref_motor_rot_vel_
(0.0),
33
prev_sim_time_
(0.0),
34
sampling_time_
(0.01) {}
35
virtual
~MotorModel
() {}
36
void
GetMotorVelocity
(
double
&
result
)
const
{
37
result =
motor_rot_vel_
;
38
}
39
void
SetReferenceMotorVelocity
(
double
ref_motor_rot_vel) {
40
ref_motor_rot_vel_
= ref_motor_rot_vel;
41
}
42
43
virtual
void
InitializeParams
() = 0;
44
virtual
void
Publish
() = 0;
45
46
protected
:
47
double
motor_rot_vel_
;
48
double
ref_motor_rot_vel_
;
49
double
prev_ref_motor_rot_vel_
;
50
double
prev_sim_time_
;
51
double
sampling_time_
;
52
53
54
virtual
void
UpdateForcesAndMoments
() = 0;
55
};
56
57
#endif // ROTORS_GAZEBO_PLUGINS_MOTOR_MODEL_H
MotorModel
Definition:
motor_model.hpp:27
MotorModel::~MotorModel
virtual ~MotorModel()
Definition:
motor_model.hpp:35
MotorModel::motor_rot_vel_
double motor_rot_vel_
Definition:
motor_model.hpp:47
MotorModel::SetReferenceMotorVelocity
void SetReferenceMotorVelocity(double ref_motor_rot_vel)
Definition:
motor_model.hpp:39
MotorModel::InitializeParams
virtual void InitializeParams()=0
MotorModel::MotorModel
MotorModel()
Definition:
motor_model.hpp:30
MotorModel::UpdateForcesAndMoments
virtual void UpdateForcesAndMoments()=0
MotorModel::GetMotorVelocity
void GetMotorVelocity(double &result) const
Definition:
motor_model.hpp:36
MotorModel::prev_ref_motor_rot_vel_
double prev_ref_motor_rot_vel_
Definition:
motor_model.hpp:49
MotorModel::prev_sim_time_
double prev_sim_time_
Definition:
motor_model.hpp:50
result
uint8_t result
MotorModel::ref_motor_rot_vel_
double ref_motor_rot_vel_
Definition:
motor_model.hpp:48
MotorModel::Publish
virtual void Publish()=0
MotorModel::sampling_time_
double sampling_time_
Definition:
motor_model.hpp:51
rotors_gazebo_plugins
Author(s): Fadri Furrer, Michael Burri, Mina Kamel, Janosch Nikolic, Markus Achtelik
autogenerated on Mon Feb 28 2022 23:39:04