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
28#include "gazebo/util/system.hh"
29
30namespace gazebo
31{
34 namespace sensors
35 {
36 // Forward declare private data class.
37 class ForceTorqueSensorPrivate;
38
41
44 class GZ_SENSORS_VISIBLE ForceTorqueSensor: public Sensor
45 {
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
83 std::function<void (msgs::WrenchStamped)> _subscriber);
84
85 // Documentation inherited.
86 protected: virtual bool UpdateImpl(const bool _force);
87
88 // Documentation inherited.
89 protected: virtual void Fini();
90
93 private: std::unique_ptr<ForceTorqueSensorPrivate> dataPtr;
94 };
96 }
97}
98#endif
sensors
Definition SensorManager.hh:35
Forward declarations for transport.
Sensor for measure force and torque on a joint.
Definition ForceTorqueSensor.hh:45
physics::JointPtr Joint() const
Get Parent Joint.
void Load(const std::string &_worldName, sdf::ElementPtr _sdf)
Load the sensor with SDF parameters.
ignition::math::Vector3d Force() const
Get the current joint force.
virtual void Fini()
Finalize the sensor.
virtual void Init()
Initialize the sensor.
virtual ~ForceTorqueSensor()
Destructor.
virtual void Load(const std::string &_worldName)
Load the sensor with default parameters.
virtual bool IsActive() const
Returns true if sensor generation is active.
virtual std::string Topic() const
Returns the topic name as set in SDF.
virtual bool UpdateImpl(const bool _force)
This gets overwritten by derived sensor types.
event::ConnectionPtr ConnectUpdate(std::function< void(msgs::WrenchStamped)> _subscriber)
Connect a to the update signal.
ignition::math::Vector3d Torque() const
Get the current joint torque.
Base class for sensors.
Definition Sensor.hh:53
boost::shared_ptr< Connection > ConnectionPtr
Definition CommonTypes.hh:134
boost::shared_ptr< Joint > JointPtr
Definition PhysicsTypes.hh:117
Forward declarations for the common classes.
Definition Animation.hh:27