##

ForceTorqueSensor.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_FORCETORQUESENSOR_HH_
#define _GAZEBO_SENSORS_FORCETORQUESENSOR_HH_
#include <functional>
#include <memory>
#include <string>
#include <ignition/math/Vector3.hh>
#include "gazebo/sensors/Sensor.hh"
#include "gazebo/transport/TransportTypes.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace sensors
{
// Forward declare private data class.
class ForceTorqueSensorPrivate;
class GZ_SENSORS_VISIBLE ForceTorqueSensor: public Sensor
{
public: ForceTorqueSensor();
public: virtual ~ForceTorqueSensor();
// Documentation inherited.
protected: void Load(const std::string &_worldName, sdf::ElementPtr _sdf);
// Documentation inherited.
public: virtual void Load(const std::string &_worldName);
// Documentation inherited.
public: virtual void Init();
// Documentation inherited.
public: virtual std::string Topic() const;
public: ignition::math::Vector3d Torque() const;
public: ignition::math::Vector3d Force() const;
public: physics::JointPtr Joint() const;
// Documentation inherited.
public: virtual bool IsActive() const;
public: event::ConnectionPtr ConnectUpdate(
std::function<void (msgs::WrenchStamped)> _subscriber);
// Documentation inherited.
protected: virtual bool UpdateImpl(const bool _force);
// Documentation inherited.
protected: virtual void Fini();
private: std::unique_ptr<ForceTorqueSensorPrivate> dataPtr;
};
}
}
#endif
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::sensors::ForceTorqueSensor
Sensor for measure force and torque on a joint.
Definition: ForceTorqueSensor.hh:44
sensors
sensors
Definition: SensorManager.hh:35
TransportTypes.hh
Forward declarations for transport.
gazebo::sensors::ForceTorqueSensor::Init
virtual void Init()
Initialize the sensor.
system.hh
gazebo::sensors::ForceTorqueSensor::IsActive
virtual bool IsActive() const
Returns true if sensor generation is active.
gazebo::sensors::ForceTorqueSensor::Topic
virtual std::string Topic() const
Returns the topic name as set in SDF.
Sensor.hh
gazebo::sensors::ForceTorqueSensor::Fini
virtual void Fini()
Finalize the sensor.
gazebo::sensors::ForceTorqueSensor::~ForceTorqueSensor
virtual ~ForceTorqueSensor()
Destructor.
gazebo::event::ConnectionPtr
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:134
gazebo::msgs::Init
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
gazebo::sensors::ForceTorqueSensor::Joint
physics::JointPtr Joint() const
Get Parent Joint.
gazebo::physics::JointPtr
boost::shared_ptr< Joint > JointPtr
Definition: PhysicsTypes.hh:117
gazebo::sensors::ForceTorqueSensor::ConnectUpdate
event::ConnectionPtr ConnectUpdate(std::function< void(msgs::WrenchStamped)> _subscriber)
Connect a to the update signal.
gazebo::sensors::Sensor
Base class for sensors.
Definition: Sensor.hh:51
gazebo::sensors::ForceTorqueSensor::Force
ignition::math::Vector3d Force() const
Get the current joint force.
gazebo::sensors::ForceTorqueSensor::Torque
ignition::math::Vector3d Torque() const
Get the current joint torque.
gazebo::sensors::ForceTorqueSensor::UpdateImpl
virtual bool UpdateImpl(const bool _force)
This gets overwritten by derived sensor types.
gazebo::sensors::ForceTorqueSensor::ForceTorqueSensor
ForceTorqueSensor()
Constructor.
gazebo::sensors::ForceTorqueSensor::Load
void Load(const std::string &_worldName, sdf::ElementPtr _sdf)
Load the sensor with SDF parameters.