motor_controller.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_PLUGIN_MOTOR_CONTROLLER_H
23 #define ROTORS_GAZEBO_PLUGIN_MOTOR_CONTROLLER_H
24 
25 #include <Eigen/Eigen>
26 
27 class MotorController
28 {
29  public:
30  MotorController(int amount_motors) :
31  ref_rotor_rot_vels_(Eigen::VectorXd::Zero(amount_motors)){};
32  virtual ~MotorController();
33  void getMotorVelocities() {
34  calculateRefMotorVelocities();
35  return ref_rotor_rot_vels_;
36  }
37 
38  virtual void calculateRefMotorVelocities() = 0;
39  virtual void initializeParams() = 0;
40  virtual void publish() = 0;
41 
42  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
43  protected:
44  // imu_
45  // odom_
46 
47  Eigen::Vector3d position_;
48  Eigen::Vector3d velocity_;
49  Eigen::Quaternion attitude_;
50  Eigen::VectorXd ref_rotor_rot_vels_;
51 };
52 
53 #endif // ROTORS_GAZEBO_PLUGIN_MOTOR_CONTROLLER_H
virtual ~MotorController()


rotors_gazebo_plugins
Author(s): Fadri Furrer, Michael Burri, Mina Kamel, Janosch Nikolic, Markus Achtelik
autogenerated on Mon Feb 28 2022 23:39:04