cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
osaWAM.h
Go to the documentation of this file.
1 /*
2  Author(s): Simon Leonard
3  Created on: Dec 02 2009
4 
5  (C) Copyright 2009 Johns Hopkins University (JHU), All Rights
6  Reserved.
7 
8 --- begin cisst license - do not edit ---
9 
10 This software is provided "as is" under an open source license, with
11 no warranty. The complete license can be found in license.txt and
12 http://www.cisst.org/cisst/license.txt.
13 
14 --- end cisst license ---
15 */
16 
17 #ifndef _osaWAM_h
18 #define _osaWAM_h
19 
21 
22 #include <sawBarrett/osaPuck.h>
23 #include <sawBarrett/osaGroup.h>
25 
27 
44 
45  public:
46 
47  enum Errno{ ESUCCESS, EFAILURE };
48 
49  enum Configuration{ WAM_4DOF, WAM_7DOF };
50 
51  enum Mode{ MODE_IDLE, MODE_ACTIVATED };
52 
53  private:
54 
55  osaWAM::Configuration configuration;
56 
58  osaGroup broadcast;
59  osaGroup uppertorques;
60  osaGroup lowertorques;
61  osaGroup upperpositions;
62  osaGroup lowerpositions;
63 
65  std::vector< osaPuck > pucks;
66 
68  osaPuck safetymodule;
69 
71 
73 
79  vctDynamicMatrix<double> mpos2jpos;
80 
82 
88  vctDynamicMatrix<double> jpos2mpos;
89 
91 
97  vctDynamicMatrix<double> jtrq2mtrq;
98 
100 
108  MotorsPos2JointsPos( const vctDynamicVector<double>& q );
109 
111 
119  JointsPos2MotorsPos( const vctDynamicVector<double>& q );
120 
122 
130  JointsTrq2MotorsTrq( const vctDynamicVector<double>& t );
131 
132  public:
133 
135 
143  osaWAM( osaCANBus* canbus, osaWAM::Configuration configuration = WAM_7DOF );
144 
146  ~osaWAM();
147 
149 
152  osaWAM::Errno Initialize();
153 
155  osaWAM::Configuration GetConfiguration() const { return configuration; }
156 
158 
165  osaWAM::Errno GetPositions( vctDynamicVector<double>& positions );
166 
168 
180  osaWAM::Errno SetPositions( const vctDynamicVector<double>& positions );
181 
183 
191  osaWAM::Errno SetTorques( const vctDynamicVector<double>& torques );
192 
194 
205  osaWAM::Errno SetVelocityWarning( Barrett::Value velocitywarning );
206 
208 
217  osaWAM::Errno SetVelocityFault( Barrett::Value velocityfault );
218 
220 
230  osaWAM::Errno SetTorqueWarning( Barrett::Value torquewarning );
231 
233 
242  osaWAM::Errno SetTorqueFault( Barrett::Value torquefault );
243 
245  osaWAM::Errno SetMode( Barrett::Value mode );
246 
247  osaWAM::Errno GetMode( osaWAM::Mode& mode );
248 
249 };
250 
251 #endif
252 
253 
254 
255 
256 
257 
258 
259 
260 
261 
262 
263 
264 
265 
266 
267 
268 
269 
270 
271 
272 
273 
274 
275 
276 
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
Declaration of vctDynamicMatrix.
A logical group of pucks.
Definition: osaGroup.h:33
Mode
Definition: osaWAM.h:51
osaWAM::Configuration GetConfiguration() const
Return the configuration of the WAM (4/7DOF)
Definition: osaWAM.h:155
Implements a Barrett puck.
Definition: osaPuck.h:36
int64_t Value
Define the value of a property (4-6 bytes)
Definition: Barrett.h:28
Errno
Definition: osaWAM.h:47
A clas for a WAM device.
Definition: osaWAM.h:43
Generic CAN bus.
Definition: osaCANBus.h:15
Definition: osaWAM.h:51
Definition: osaWAM.h:47
Configuration
Definition: osaWAM.h:49