motor_controller.hpp
Go to the documentation of this file.
00001 /*
00002  * Copyright 2015 Fadri Furrer, ASL, ETH Zurich, Switzerland
00003  * Copyright 2015 Michael Burri, ASL, ETH Zurich, Switzerland
00004  * Copyright 2015 Mina Kamel, ASL, ETH Zurich, Switzerland
00005  * Copyright 2015 Janosch Nikolic, ASL, ETH Zurich, Switzerland
00006  * Copyright 2015 Markus Achtelik, ASL, ETH Zurich, Switzerland
00007  *
00008  * Licensed under the Apache License, Version 2.0 (the "License");
00009  * you may not use this file except in compliance with the License.
00010  * You may obtain a copy of the License at
00011  *
00012  *     http://www.apache.org/licenses/LICENSE-2.0
00013 
00014  * Unless required by applicable law or agreed to in writing, software
00015  * distributed under the License is distributed on an "AS IS" BASIS,
00016  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00017  * See the License for the specific language governing permissions and
00018  * limitations under the License.
00019  */
00020 
00021 
00022 #ifndef ROTORS_GAZEBO_PLUGIN_MOTOR_CONTROLLER_H
00023 #define ROTORS_GAZEBO_PLUGIN_MOTOR_CONTROLLER_H
00024 
00025 #include <Eigen/Eigen>
00026 
00027 class MotorController
00028 {
00029   public:
00030     MotorController(int amount_motors) :
00031       ref_rotor_rot_vels_(Eigen::VectorXd::Zero(amount_motors)){};
00032     virtual ~MotorController();
00033     void getMotorVelocities() {
00034       calculateRefMotorVelocities();
00035       return ref_rotor_rot_vels_;
00036     }
00037 
00038     virtual void calculateRefMotorVelocities() = 0;
00039     virtual void initializeParams() = 0;
00040     virtual void publish() = 0;
00041 
00042     EIGEN_MAKE_ALIGNED_OPERATOR_NEW
00043   protected:
00044     // imu_
00045     // odom_
00046 
00047     Eigen::Vector3d position_;
00048     Eigen::Vector3d velocity_;
00049     Eigen::Quaternion attitude_;
00050     Eigen::VectorXd ref_rotor_rot_vels_;
00051 };
00052 
00053 #endif // ROTORS_GAZEBO_PLUGIN_MOTOR_CONTROLLER_H


rotors_gazebo_plugins
Author(s): Fadri Furrer, Michael Burri, Mina Kamel, Janosch Nikolic, Markus Achtelik
autogenerated on Thu Apr 18 2019 02:43:43