XBotInterface  2.4.1
XBotInterface provides a generic API to model and control a robot.
ForceTorqueSensor.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 IIT-ADVR
3  * Author: Arturo Laurenzi, Luca Muratore
4  * email: arturo.laurenzi@iit.it, luca.muratore@iit.it
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>
18 */
19 
20 #ifndef __XBOT_FORCE_TORQUE_SENSOR_H__
21 #define __XBOT_FORCE_TORQUE_SENSOR_H__
22 
23 #include <string>
24 #include <memory>
25 #include <iostream>
26 #include <kdl/kdl.hpp>
27 #include <eigen_conversions/eigen_kdl.h>
28 #include <Eigen/Geometry>
29 #include <srdfdom_advr/model.h>
31 
32 namespace XBot {
33 
34  class KinematicChain;
35 
41 
42 
43 public:
44 
45  typedef std::shared_ptr<ForceTorqueSensor> Ptr;
46  typedef std::shared_ptr<const ForceTorqueSensor> ConstPtr;
47 
48  friend XBot::KinematicChain;
49 
55 
62  ForceTorqueSensor(urdf::LinkConstSharedPtr ft_link, int sensor_id);
63 
70  void getWrench(Eigen::Matrix<double, 6, 1>& wrench) const;
71 
78  void getForce(Eigen::Vector3d& force) const;
79 
86  void getTorque(Eigen::Vector3d& torque) const;
87 
94  void getWrench(KDL::Wrench& wrench) const;
95 
102  void getForce(KDL::Vector& force) const;
103 
110  void getTorque(KDL::Vector& torque) const;
111 
112  friend std::ostream& operator<< ( std::ostream& os, const XBot::ForceTorqueSensor& j );
113 
121  void setWrench(const Eigen::Matrix<double, 6, 1>& wrench, double timestamp);
122 
130  void setForce(const Eigen::Vector3d& force, double timestamp);
131 
139  void setTorque(const Eigen::Vector3d& torque, double timestamp);
140 
141 private:
142 
143 
144  double _fx, _fy, _fz, _tx, _ty, _tz;
145 
146 
147 };
148 }
149 #endif
XBot::ForceTorqueSensor::getForce
void getForce(Eigen::Vector3d &force) const
Getter for the Force-Torque measured force.
Definition: ForceTorqueSensor.cpp:45
XBot::KinematicChain
Kinematic chain abstraction as a set of joints and sensors.
Definition: KinematicChain.h:49
XBot::ForceTorqueSensor::getWrench
void getWrench(Eigen::Matrix< double, 6, 1 > &wrench) const
Getter for the Force-Torque measured wrench.
XBot::GenericSensor
Generic sensor abstraction.
Definition: GenericSensor.h:36
GenericSensor.h
XBot::ForceTorqueSensor::ConstPtr
std::shared_ptr< const ForceTorqueSensor > ConstPtr
Definition: ForceTorqueSensor.h:46
XBot::ForceTorqueSensor::setTorque
void setTorque(const Eigen::Vector3d &torque, double timestamp)
Setter for the Force-Torque torque.
Definition: ForceTorqueSensor.cpp:90
XBot::ForceTorqueSensor::Ptr
std::shared_ptr< ForceTorqueSensor > Ptr
Definition: ForceTorqueSensor.h:45
XBot::ForceTorqueSensor
Force - Torque sensor abstraction:
Definition: ForceTorqueSensor.h:40
XBot::ForceTorqueSensor::ForceTorqueSensor
ForceTorqueSensor()
Default Contructor.
Definition: ForceTorqueSensor.cpp:31
XBot::ForceTorqueSensor::operator<<
friend std::ostream & operator<<(std::ostream &os, const XBot::ForceTorqueSensor &j)
Definition: ForceTorqueSensor.cpp:109
XBot::ForceTorqueSensor::setWrench
void setWrench(const Eigen::Matrix< double, 6, 1 > &wrench, double timestamp)
Setter for the Force-Torque wrench.
Definition: ForceTorqueSensor.cpp:98
XBot::ForceTorqueSensor::getTorque
void getTorque(Eigen::Vector3d &torque) const
Getter for the Force-Torque measured torque.
Definition: ForceTorqueSensor.cpp:59
XBot::ForceTorqueSensor::setForce
void setForce(const Eigen::Vector3d &force, double timestamp)
Setter for the Force-Torque wrench.
Definition: ForceTorqueSensor.cpp:82
XBot
Definition: IXBotModel.h:20