ForceTorqueSensor.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2016 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 #ifndef _GAZEBO_SENSORS_FORCETORQUESENSOR_HH_
18 #define _GAZEBO_SENSORS_FORCETORQUESENSOR_HH_
19 
20 #include <functional>
21 #include <memory>
22 #include <string>
23 
24 #include <ignition/math/Vector3.hh>
25 
26 #include "gazebo/sensors/Sensor.hh"
28 #include "gazebo/util/system.hh"
29 
30 namespace gazebo
31 {
34  namespace sensors
35  {
36  // Forward declare private data class.
37  class ForceTorqueSensorPrivate;
38 
41 
45  {
47  public: ForceTorqueSensor();
48 
50  public: virtual ~ForceTorqueSensor();
51 
52  // Documentation inherited.
53  protected: void Load(const std::string &_worldName, sdf::ElementPtr _sdf);
54 
55  // Documentation inherited.
56  public: virtual void Load(const std::string &_worldName);
57 
58  // Documentation inherited.
59  public: virtual void Init();
60 
61  // Documentation inherited.
62  public: virtual std::string Topic() const;
63 
66  public: ignition::math::Vector3d Torque() const;
67 
70  public: ignition::math::Vector3d Force() const;
71 
75  public: physics::JointPtr GetJoint() const GAZEBO_DEPRECATED(7.0);
76 
79  public: physics::JointPtr Joint() const;
80 
81  // Documentation inherited.
82  public: virtual bool IsActive() const;
83 
89  public: event::ConnectionPtr ConnectUpdate(
90  std::function<void (msgs::WrenchStamped)> _subscriber);
91 
94  public: void DisconnectUpdate(event::ConnectionPtr &_conn);
95 
96  // Documentation inherited.
97  protected: virtual bool UpdateImpl(const bool _force);
98 
99  // Documentation inherited.
100  protected: virtual void Fini();
101 
104  private: std::unique_ptr<ForceTorqueSensorPrivate> dataPtr;
105  };
107  }
108 }
109 #endif
Forward declarations for transport.
#define GAZEBO_DEPRECATED(version)
Definition: CommonTypes.hh:48
boost::shared_ptr< Joint > JointPtr
Definition: PhysicsTypes.hh:117
Sensor for measure force and torque on a joint.
Definition: ForceTorqueSensor.hh:44
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:153
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
Base class for sensors.
Definition: Sensor.hh:50
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:59