cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
osaJR3ForceSensor.h
Go to the documentation of this file.
1 /*-*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab:*/
3 
4 /*
5  $Id: osaJR3ForceSensor.h 3181 2011-11-15 15:41:28Z sleonard $
6 
7  Author(s): Simon Leonard
8  Created on: 2013-06-21
9 
10  (C) Copyright 2012 Johns Hopkins University (JHU), All Rights Reserved.
11 
12 --- begin cisst license - do not edit ---
13 
14 This software is provided "as is" under an open source license, with
15 no warranty. The complete license can be found in license.txt and
16 http://www.cisst.org/cisst/license.txt.
17 
18 --- end cisst license ---
19 */
20 
26 #ifndef _osaJR3ForceSensor_h
27 #define _osaJR3ForceSensor_h
28 
29 #include <comedilib.h>
34 
36 
37 public:
38 
39  enum Errno { ESUCCESS, EFAILURE };
40 
41  // Typedef for force and torque readings
44 
45  enum Units{ METRIC };
46 
47 private:
48 
49  struct Internals;
50  osaJR3ForceSensor::Internals* internals;
51 
52  Units units; // unit standard
53 
54  Wrench bias; // bias wrench
55 
56  vctFrame4x4<double> Rtst; // force tip w.r.t. JR3 frame
57 
58  double mass; // tool mass
59  vctFixedSizeVector<double,3> com; // tool center of mass
60 
61 public:
62 
65 
67 
75  osaJR3ForceSensor( const std::string& name,
76  Units u = METRIC,
77  const osaJR3ForceSensor::Wrench& bias = Wrench( 0.0 ),
79  double mass = 0.0,
81 
84 
87 
90 
91 
93 
101  bool transform = true,
102  int filterId = 0 ) const;
103 
105 
111  bool transform = true,
112  int filterId = 0 ) const;
113 
115  void SetMass( double m ) { mass = m; }
116 
118  void SetCOM( const vctFixedSizeVector<double,3>& xyz ) { com = xyz; }
119 
121  void SetBias( const Wrench& vw ) { bias = vw; }
122 
124 
130  void Zero( const vctFrame4x4<double>& Rtws );
131 
133  void SetTransform( const vctFrame4x4<double>& Rt ){ Rtst = Rt; }
134 
136  Wrench US2SI( const Wrench& wus ) const;
137 
140 
142  static vctAdjoint Adjoint( const vctFrame4x4<double>& Rt );
143 
144 };
145 
146 #endif //_osaJR3ForceSensor_h
Definition: osaJR3ForceSensor.h:45
vctFixedSizeVector< double, 6 > Wrench
Definition: osaJR3ForceSensor.h:42
vctFixedSizeMatrix< double, 6, 6 > vctAdjoint
Definition: osaJR3ForceSensor.h:43
static vctAdjoint Adjoint(const vctFrame4x4< double > &Rt)
Compute adjoint matrix of Rt.
Declaration of vctMatrixRotation3.
void Zero(const vctFrame4x4< double > &Rtws)
Set bias.
Definition: osaJR3ForceSensor.h:35
void SetTransform(const vctFrame4x4< double > &Rt)
Set frame transformation.
Definition: osaJR3ForceSensor.h:133
osaJR3ForceSensor::Errno Read(osaJR3ForceSensor::Wrench &wrench, const vctMatrixRotation3< double > &R, bool transform=true, int filterId=0) const
Read with tool compenstation.
Wrench US2SI(const Wrench &wus) const
Convert US to SI.
Declaration of vctFrame4x4.
Definition: osaJR3ForceSensor.h:39
Declaration of vctFixedSizeVector.
~osaJR3ForceSensor()
Destructor.
void SetCOM(const vctFixedSizeVector< double, 3 > &xyz)
Set tool center of mass.
Definition: osaJR3ForceSensor.h:118
Implementation of a fixed-size matrix using template metaprogramming.
Definition: vctFixedSizeMatrix.h:52
Units
Definition: osaJR3ForceSensor.h:45
void SetMass(double m)
Set tool mass.
Definition: osaJR3ForceSensor.h:115
Definition: osaJR3ForceSensor.h:39
Wrench CompensateToolMass(const vctMatrixRotation3< double > &R) const
Compensate for tool mass.
Errno
Definition: osaJR3ForceSensor.h:39
osaJR3ForceSensor::Errno Close()
Close.
osaJR3ForceSensor()
Default constructor.
Definition: osaJR3ForceSensor.h:64
void SetBias(const Wrench &vw)
Set bias.
Definition: osaJR3ForceSensor.h:121
osaJR3ForceSensor::Errno Open()
Open.