ForceTorqueSensor.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 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 
74  public: physics::JointPtr Joint() const;
75 
76  // Documentation inherited.
77  public: virtual bool IsActive() const;
78 
84  public: event::ConnectionPtr ConnectUpdate(
85  std::function<void (msgs::WrenchStamped)> _subscriber);
86 
90  public: void DisconnectUpdate(event::ConnectionPtr &_conn)
91  GAZEBO_DEPRECATED(8.0);
92 
93  // Documentation inherited.
94  protected: virtual bool UpdateImpl(const bool _force);
95 
96  // Documentation inherited.
97  protected: virtual void Fini();
98 
101  private: std::unique_ptr<ForceTorqueSensorPrivate> dataPtr;
102  };
104  }
105 }
106 #endif
Forward declarations for transport.
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:134
#define GAZEBO_DEPRECATED(version)
Definition: system.hh:302
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
Base class for sensors.
Definition: Sensor.hh:51
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:58