Actin®  Version 5.2.0
Software for Robotics Simulation and Control
ecGenMotionFilter.h
Go to the documentation of this file.
1 #ifndef ecGenMotionFilter_H_
2 #define ecGenMotionFilter_H_
3 //------------------------------------------------------------------------------
4 // Copyright (c) 2002-2013 Energid Technologies. All rights reserved.
5 //
12 //
13 //------------------------------------------------------------------------------
14 #include <actinCore/actinCore_config.h> // Required to be first header.
15 #include "ecBaseMotionFilter.h"
17 #include <xml/ecXmlVector.h>
18 #include <xml/ecXmlVectorType.h>
20 
26 
28 
33 {
34 public:
35 
38  (
39  );
40 
42  virtual ~EcGeneralMotionFilter
43  (
44  );
45 
48  (
49  const EcGeneralMotionFilter& orig
50  );
51 
53  EcGeneralMotionFilter& operator=
54  (
55  const EcGeneralMotionFilter& orig
56  );
57 
59  EcBoolean operator==
60  (
61  const EcGeneralMotionFilter& orig
62  ) const;
63 
65  virtual EcBoolean xmlInit
66  (
67  ) EC_OVERRIDE;
68 
70  virtual EcXmlObject* clone
71  (
72  ) const EC_OVERRIDE;
73 
75  virtual void registerComponents
76  (
77  ) EC_OVERRIDE;
78 
80  virtual EcBoolean equality
81  (
82  const EcXmlObject* other
83  ) const EC_OVERRIDE;
84 
86  virtual EcXmlObject* newObject
87  (
88  ) const EC_OVERRIDE;
89 
91  virtual const EcVector& offset
92  (
93  ) const;
94 
96  virtual void setOffset
97  (
98  const EcVector& offset
99  );
100 
102  virtual EcReal angularWeight
103  (
104  ) const;
105 
107  virtual void setAngularWeight
108  (
109  EcReal angularWeight
110  );
111 
113  virtual EcReal threshold
114  (
115  ) const;
116 
118  virtual void setThreshold
119  (
120  EcReal threshold
121  );
122 
124  virtual EcReal linearVelocityThreshold
125  (
126  ) const;
127 
129  virtual void setLinearVelocityThreshold
130  (
131  EcReal threshold
132  );
133 
135  virtual EcReal angularVelocityThreshold
136  (
137  ) const;
138 
140  virtual void setAngularVelocityThreshold
141  (
142  EcReal threshold
143  );
144 
146  virtual EcReal linearAccelerationThreshold
147  (
148  ) const;
149 
151  virtual void setLinearAccelerationThreshold
152  (
153  EcReal threshold
154  );
155 
157  virtual EcReal angularAccelerationThreshold
158  (
159  ) const;
160 
162  virtual void setAngularAccelerationThreshold
163  (
164  EcReal threshold
165  );
166 
168  virtual EcReal linearDecelerationThreshold
169  (
170  ) const;
171 
176  virtual void setLinearDecelerationThreshold
177  (
178  EcReal threshold
179  );
180 
182  virtual EcReal angularDecelerationThreshold
183  (
184  ) const;
185 
190  virtual void setAngularDecelerationThreshold
191  (
192  EcReal threshold
193  );
194 
196  virtual EcReal linearGain
197  (
198  ) const;
199 
201  virtual void setLinearGain
202  (
203  EcReal linearGain
204  );
205 
207  virtual EcReal angularGain
208  (
209  ) const;
210 
212  virtual void setAngularGain
213  (
214  EcReal angularGain
215  );
216 
218  virtual EcReal linearJerkThreshold
219  (
220  ) const;
221 
223  virtual EcReal angularJerkThreshold
224  (
225  ) const;
226 
228  virtual void setLinearJerkThreshold
229  (
230  EcReal linearJerkThreshold
231  );
232 
234  virtual void setAngularJerkThreshold
235  (
236  EcReal angularJerkThreshold
237  );
238 
252  virtual EcBoolean calculateGeneralMotion
253  (
256  const EcGeneralVelocity& desiredVelocity,
257  const EcGeneralVelocity& lastVelocity,
258  const EcGeneralAcceleration& lastAcceleration,
259  EcReal timeStep,
260  EcGeneralVelocity& filteredVelocity,
261  EcGeneralAcceleration& filteredAcceleration,
262  EcBoolean coordinatedMotion = EcTrue,
263  EcBoolean freeSpinInZ = EcFalse,
264  EcBoolean applyFilter = EcTrue
265  ) const;
266 
282 
283  virtual EcBoolean calculateGeneralMotionGS
284  (
287  const EcGeneralVelocity& desiredVelocity,
288  const EcGeneralVelocity& lastVelocity,
289  const EcGeneralAcceleration& lastAcceleration,
290  EcReal timeStep,
291  EcGeneralVelocity& filteredVelocity,
292  EcGeneralAcceleration& filteredAcceleration,
293  const EcBoolean coordinatedMotion,
294  const EcBoolean applyFilter,
295  const EcBoolean systemOrEE,
296  const EcXmlBooleanVector& flags,
297  const EcBoolean& fixedGuideFrame,
298  EcVector& pe,
299  const EcBoolean& changed
300  ) const;
301 
303  virtual EcBoolean calculateDeltasGS
304  (
307  const EcBoolean systemOrEE,
308  const EcXmlBooleanVector& flags,
309  const EcBoolean& fixedGuideFrame,
310  EcVector& deltaPosition,
311  EcVector& angleTimesAxis,
312  EcVector& positionError
313  ) const;
314 
316  virtual EcBoolean filterVelocity
317  (
318  const EcGeneralVelocity& desiredVelocity,
319  const EcGeneralVelocity& lastVelocity,
320  const EcGeneralAcceleration& lastGeneralAcceleration,
321  EcReal timeStep,
322  EcGeneralVelocity& filteredVelocity,
323  EcGeneralAcceleration& filteredGeneralAcceleration
324  ) const;
325 
327  virtual const EcToken& token
328  (
329  ) const EC_OVERRIDE;
330 
332  virtual EcBoolean read
333  (
334  EcXmlReader& stream
335  ) EC_OVERRIDE;
336 
338  virtual EcBoolean write
339  (
340  EcXmlWriter& stream
341  ) const EC_OVERRIDE;
342 
344  static EcGeneralMotionFilter nullObject
345  (
346  );
347 
348 protected:
350  virtual EcReal applyFilter
351  (
352  const EcVector &delta,
353  EcReal gain,
354  EcReal velocityThreshold,
355  EcReal decelerationThreshold,
356  EcReal timeStep,
357  EcVector &filteredVelocity
358  ) const;
359 
361  void imposeVelocityThresholds
362  (
363  EcReal linearVelThreshold,
364  EcReal angularVelThreshold,
365  EcVector& linearVelocity,
366  EcVector& angularVelocity
367  ) const;
368 
370  void imposeAccelerationThresholds
371  (
372  const EcGeneralMotion& lastVelocity,
373  const EcGeneralMotion& lastAcceleration,
374  EcReal linearAccThreshold,
375  EcReal angularAccThreshold,
376  EcReal integratedMaxDeltaLinearVelocity,
377  EcReal integratedMaxDeltaAngularVelocity,
378  EcReal timeStep,
379  EcVector& linearVelocity,
380  EcVector& angularVelocity,
381  EcVector& linearAcceleration,
382  EcVector& angularAcceleration
383  ) const;
384 protected:
385 
389 
394 
399 
404 
409 
414 
417  static const EcReal m_theCosThreshold;
418 
423 
428 
431  mutable EcJerkLimitMotionFilter m_AngularJerkFilter;
432 
435  EcXmlReal m_AngularJerkThreshold;
436 };
437 
440 
441 #endif // ecGenMotionFilter_H_
virtual const EcToken & token() const =0
gets the xml token used for writing out.
A rotation and a translation to describe a new frame.
#define EC_OVERRIDE
Add wrapper around c++11 override keyword.
Definition: ecMacros.h:36
This compound type is added as wrapper to the EcVector basic type. This allows flexibility in the XML...
Definition: ecXmlVector.h:21
EcXmlReal m_LinearDecelerationThreshold
the linear deceleration threshold
#define EC_ACTINCORE_CONTROLCORE_DECL
controlCore directory
const EcBoolean EcTrue
gives a representation of true
Definition: ecConstants.h:23
Filter for motion of the base of the robot TODO.
virtual EcBoolean xmlInit() EC_OVERRIDE
initialize XML components for reading and writing
virtual void registerComponents() EC_OVERRIDE
register components with the parent
An EcString-like class that holds a tag and a namespace.
Definition: ecToken.h:41
A base class for xml objects.
Definition: ecXmlObject.h:23
EcGeneralMotion EcGeneralVelocity
type definition of EcGeneralVelocity
EcXmlVectorType< EcGeneralMotionFilter > EcGeneralMotionFilterVector
a vector of individual velocity control descriptions
EcXmlReal m_LinearVelocityThreshold
the linear velocity threshold
virtual EcBoolean read(EcXmlReader &stream) EC_OVERRIDE
read object from an XML stream
Configuration header for the foundation hierarchy.
virtual EcBoolean write(EcXmlWriter &stream) const EC_OVERRIDE
write object to an XML stream
EcXmlReal m_LinearJerkThreshold
jerk threshold
virtual EcXmlObject * clone() const =0
clone
bool EcBoolean
Boolean (0 or 1)
Definition: ecTypes.h:21
Holds a description of a general-motion filter system.
static const EcReal m_theCosThreshold
EcXmlReal m_AngularVelocityThreshold
the angular velocity threshold
const EcBoolean EcFalse
gives a representation of false
Definition: ecConstants.h:26
EcXmlReal m_AngularDecelerationThreshold
the angular deceleration threshold
XML file writer.
Definition: ecXmlWriter.h:19
virtual EcBoolean equality(const EcXmlObject *other) const =0
equality - a virtual equality to an EcXmlObject pointer
EcF64 EcReal
Alias for 64-bit float.
Definition: ecTypes.h:30
EcGeneralMotion EcGeneralAcceleration
a general acceleration
virtual EcXmlObject * newObject() const =0
creates new object - a virtual new to an EcXmlObject pointer
EcXmlReal m_AngularAccelerationThreshold
the angular acceleration threshold
An XML file reader.
Definition: ecXmlReader.h:17
Contains functions for jerk limiting planning.
EcXmlReal m_LinearAccelerationThreshold
the linear acceleration threshold
EcJerkLimitMotionFilter m_LinearJerkFilter
pointer to jerk limit filter
A three-element vector.
Definition: ecVector.h:20
Created by Energid Technologies www.energid.com
Copyright © 2016 Energid. All trademarks mentioned in this document are property of their respective owners.