##

ImuSensor.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GAZEBO_SENSORS_IMUSENSOR_HH_
#define GAZEBO_SENSORS_IMUSENSOR_HH_
#include <memory>
#include <string>
#include <ignition/math/Quaternion.hh>
#include <ignition/math/Vector3.hh>
#include "gazebo/sensors/Sensor.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace sensors
{
// Forward declare private data class.
class ImuSensorPrivate;
class GZ_SENSORS_VISIBLE ImuSensor: public Sensor
{
public: ImuSensor();
public: virtual ~ImuSensor();
// Documentation inherited.
protected: void Load(const std::string &_worldName, sdf::ElementPtr _sdf);
// Documentation inherited.
protected: virtual void Load(const std::string &_worldName);
public: virtual void Init();
// Documentation inherited
protected: virtual bool UpdateImpl(const bool _force);
// Documentation inherited
protected: virtual void Fini();
public: msgs::IMU ImuMessage() const;
public: ignition::math::Vector3d AngularVelocity(
const bool _noiseFree = false) const;
public: ignition::math::Vector3d LinearAcceleration(
const bool _noiseFree = false) const;
public: ignition::math::Quaterniond Orientation() const;
public: void SetReferencePose();
// Documentation inherited.
public: virtual bool IsActive() const;
public: void SetWorldToReferenceOrientation(
const ignition::math::Quaterniond &_orientation);
private: void OnLinkData(ConstLinkDataPtr &_msg);
private: std::unique_ptr<ImuSensorPrivate> dataPtr;
};
}
}
#endif
gazebo::sensors::ImuSensor::Orientation
ignition::math::Quaterniond Orientation() const
get orientation of the IMU relative to a reference pose Initially, the reference pose is the boot up ...
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::sensors::ImuSensor::SetWorldToReferenceOrientation
void SetWorldToReferenceOrientation(const ignition::math::Quaterniond &_orientation)
Sets the rotation transform from world frame to IMU's reference frame.
gazebo::sensors::ImuSensor::UpdateImpl
virtual bool UpdateImpl(const bool _force)
This gets overwritten by derived sensor types.
sensors
sensors
Definition: SensorManager.hh:35
system.hh
gazebo::sensors::ImuSensor::Load
void Load(const std::string &_worldName, sdf::ElementPtr _sdf)
Load the sensor with SDF parameters.
Sensor.hh
gazebo::sensors::ImuSensor::LinearAcceleration
ignition::math::Vector3d LinearAcceleration(const bool _noiseFree=false) const
Returns the imu linear acceleration in the IMU sensor local frame.
gazebo::sensors::ImuSensor::ImuMessage
msgs::IMU ImuMessage() const
Returns the imu message.
gazebo::sensors::ImuSensor::Init
virtual void Init()
Initialize the IMU.
gazebo::sensors::ImuSensor::SetReferencePose
void SetReferencePose()
Sets the current IMU pose as the reference NED pose, i.e.
gazebo::sensors::ImuSensor::ImuSensor
ImuSensor()
Constructor.
gazebo::sensors::ImuSensor::Fini
virtual void Fini()
Finalize the sensor.
gazebo::sensors::ImuSensor::~ImuSensor
virtual ~ImuSensor()
Destructor.
gazebo::msgs::Init
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
gazebo::sensors::Sensor
Base class for sensors.
Definition: Sensor.hh:51
gazebo::sensors::ImuSensor::IsActive
virtual bool IsActive() const
Returns true if sensor generation is active.
gazebo::sensors::ImuSensor::AngularVelocity
ignition::math::Vector3d AngularVelocity(const bool _noiseFree=false) const
Returns the angular velocity in the IMU sensor local frame.
gazebo::sensors::ImuSensor
An IMU sensor.
Definition: ImuSensor.hh:40