imu_sensor_interface.h
Go to the documentation of this file.
00001 
00002 // Copyright (C) 2013, PAL Robotics S.L.
00003 //
00004 // Redistribution and use in source and binary forms, with or without
00005 // modification, are permitted provided that the following conditions are met:
00006 //   * Redistributions of source code must retain the above copyright notice,
00007 //     this list of conditions and the following disclaimer.
00008 //   * Redistributions in binary form must reproduce the above copyright
00009 //     notice, this list of conditions and the following disclaimer in the
00010 //     documentation and/or other materials provided with the distribution.
00011 //   * Neither the name of hiDOF, Inc. nor the names of its
00012 //     contributors may be used to endorse or promote products derived from
00013 //     this software without specific prior written permission.
00014 //
00015 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00016 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00017 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00018 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
00019 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00020 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00021 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00022 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00023 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00024 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00025 // POSSIBILITY OF SUCH DAMAGE.
00027 
00029 
00030 #ifndef HARDWARE_INTERFACE_IMU_SENSOR_INTERFACE_H
00031 #define HARDWARE_INTERFACE_IMU_SENSOR_INTERFACE_H
00032 
00033 #include <hardware_interface/internal/hardware_resource_manager.h>
00034 #include <string>
00035 
00036 namespace hardware_interface
00037 {
00038 
00044 class ImuSensorHandle
00045 {
00046 public:
00047   struct Data
00048   {
00049     Data()
00050       : name(),
00051         frame_id(),
00052         orientation(0),
00053         orientation_covariance(0),
00054         angular_velocity(0),
00055         angular_velocity_covariance(0),
00056         linear_acceleration(0),
00057         linear_acceleration_covariance(0) {}
00058 
00059     std::string name;                       
00060     std::string frame_id;                   
00061     double* orientation;                    
00062     double* orientation_covariance;         
00063     double* angular_velocity;               
00064     double* angular_velocity_covariance;    
00065     double* linear_acceleration;            
00066     double* linear_acceleration_covariance; 
00067   };
00068 
00069   ImuSensorHandle(const Data& data = Data())
00070     : name_(data.name),
00071       frame_id_(data.frame_id),
00072       orientation_(data.orientation),
00073       orientation_covariance_(data.orientation_covariance),
00074       angular_velocity_(data.angular_velocity),
00075       angular_velocity_covariance_(data.angular_velocity_covariance),
00076       linear_acceleration_(data.linear_acceleration),
00077       linear_acceleration_covariance_(data.linear_acceleration_covariance)
00078   {}
00079 
00080   std::string getName()                           const {return name_;}
00081   std::string getFrameId()                        const {return frame_id_;}
00082   const double* getOrientation()                  const {return orientation_;}
00083   const double* getOrientationCovariance()        const {return orientation_covariance_;}
00084   const double* getAngularVelocity()              const {return angular_velocity_;}
00085   const double* getAngularVelocityCovariance()    const {return angular_velocity_covariance_;}
00086   const double* getLinearAcceleration()           const {return linear_acceleration_;}
00087   const double* getLinearAccelerationCovariance() const {return linear_acceleration_covariance_;}
00088 
00089 private:
00090   std::string name_;
00091   std::string frame_id_;
00092 
00093   double* orientation_;
00094   double* orientation_covariance_;
00095   double* angular_velocity_;
00096   double* angular_velocity_covariance_;
00097   double* linear_acceleration_;
00098   double* linear_acceleration_covariance_;
00099 };
00100 
00102 class ImuSensorInterface : public HardwareResourceManager<ImuSensorHandle> {};
00103 
00104 }
00105 
00106 #endif // HARDWARE_INTERFACE_IMU_SENSOR_INTERFACE_H


hardware_interface
Author(s): Wim Meeussen, Adolfo Rodriguez Tsouroukdissian
autogenerated on Sat Jun 8 2019 20:09:17