Choreonoid  1.5
ForceSensor.h
Go to the documentation of this file.
1 
6 #ifndef CNOID_BODY_FORCE_SENSOR_H
7 #define CNOID_BODY_FORCE_SENSOR_H
8 
9 #include "Device.h"
10 #include <boost/scoped_ptr.hpp>
11 #include "exportdecl.h"
12 
13 namespace cnoid {
14 
16 {
17  Vector6 F_; // f (linear force) + tau (torque)
18 
19  struct Spec {
20  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
21  Vector6 F_max;
22  };
23  boost::scoped_ptr<Spec> spec;
24 
25 public:
27 
28  ForceSensor();
29  ForceSensor(const ForceSensor& org, bool copyStateOnly = false);
30 
31  virtual const char* typeName();
32  void copyStateFrom(const ForceSensor& other);
33  virtual void copyStateFrom(const DeviceState& other);
34  virtual DeviceState* cloneState() const;
35  virtual Device* clone() const;
36  virtual void forEachActualType(boost::function<bool(const std::type_info& type)> func);
37  virtual void clearState();
38  virtual int stateSize() const;
39  virtual const double* readState(const double* buf);
40  virtual double* writeState(double* out_buf) const;
41 
42  const Vector6& F() const { return F_; }
43  Vector6& F() { return F_; }
44 
45  Vector6::FixedSegmentReturnType<3>::Type f() { return F_.head<3>(); }
46  Vector6::ConstFixedSegmentReturnType<3>::Type f() const { return F_.head<3>(); }
47 
48  Vector6::FixedSegmentReturnType<3>::Type tau() { return F_.tail<3>(); }
49  Vector6::ConstFixedSegmentReturnType<3>::Type tau() const { return F_.tail<3>(); }
50 
51  const Vector6& F_max() const { return spec->F_max; }
52  Vector6& F_max() { return spec->F_max; }
53 };
54 
56 
57 };
58 
59 #endif
Definition: ForceSensor.h:15
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Definition: ForceSensor.h:26
Vector6::ConstFixedSegmentReturnType< 3 >::Type tau() const
Definition: ForceSensor.h:49
Vector6 & F()
Definition: ForceSensor.h:43
Definition: Referenced.h:128
Definition: Device.h:18
Vector6::ConstFixedSegmentReturnType< 3 >::Type f() const
Definition: ForceSensor.h:46
Defines the minimum processing for performing pasing file for STL.
Definition: AbstractSceneLoader.h:9
Vector6 & F_max()
Definition: ForceSensor.h:52
const Vector6 & F() const
Definition: ForceSensor.h:42
#define CNOID_EXPORT
Definition: Util/exportdecl.h:37
ref_ptr< ForceSensor > ForceSensorPtr
Definition: ForceSensor.h:55
const Vector6 & F_max() const
Definition: ForceSensor.h:51
Vector6::FixedSegmentReturnType< 3 >::Type f()
Definition: ForceSensor.h:45
Eigen::Matrix< double, 6, 1 > Vector6
Definition: EigenTypes.h:63
Definition: Device.h:52
Vector6::FixedSegmentReturnType< 3 >::Type tau()
Definition: ForceSensor.h:48