V-ART
jointmover.h
Go to the documentation of this file.
1 
5 #ifndef VART_JOINTMOVER_H
6 #define VART_JOINTMOVER_H
7 
8 #include "vart/joint.h"
9 #include <list>
10 
11 namespace VART {
12  class DofMover;
13  class NoisyDofMover;
14  class Interpolator;
15  class DMModifier;
16 
22  class JointMover {
23  friend std::ostream& operator<<(std::ostream& output, const JointMover& mover);
24  public:
25  // PUBLIC METHODS
26  JointMover();
27  JointMover(Joint* newJointPtr, float newDuration, const Interpolator& interpolator);
28  ~JointMover();
29 
31  void Move();
32 
34  void AttachToJoint(Joint* newJointPtr) { jointPtr = newJointPtr; }
35 
37  const VART::Joint* GetAttachedJoint() const { return jointPtr; }
38 
44  void AddDofMover(Joint::DofID dof, float iniTime, float finTime, float finPos);
45 
51  NoisyDofMover* AddNoisyDofMover(Joint::DofID dof, float iniTime, float finTime, float finPos);
52 
56 
58  void SetDuration(float newDuration) { duration = newDuration; }
59 
61  float GetDuration() { return duration; }
62 
64  void SetInterpolator(const Interpolator& interp) { interpolatorPtr = &interp; }
65 
69 
71  void DeactivateDofMovers();
72 
78  void MultiplyTimes(float value);
79 
81  void GetFinalTimes(std::list<float>* resultPtr);
82 
85  void CopyFrom( VART::JointMover& jointMover, VART::Joint* targetJoint );
86 
88  void ModifyDofMovers(DMModifier& modifier);
89 
90  // PUBLIC STATIC ATTRIBUTES
91  //static bool cycle;
92  static float goalTime;
93  //static unsigned int priority;
94  protected:
95  // PROTECTED ATTRIBUTES
98  float duration;
101  std::list<DofMover*> dofMoverList;
102  }; // end class declaration
103 } // end namespace
104 
105 #endif
void GetFinalTimes(std::list< float > *resultPtr)
Returns a list with all different final times for every dof mover.
Definition: jointmover.cpp:122
void ModifyDofMovers(DMModifier &modifier)
Modifies noisy dof movers.
Definition: jointmover.cpp:155
void SetDuration(float newDuration)
Sets the total movement duration (in seconds).
Definition: jointmover.h:58
Representation of joints.
Definition: joint.h:34
float minimumDuration
Definition: jointmover.h:99
const Interpolator * interpolatorPtr
Definition: jointmover.h:100
static float goalTime
Definition: jointmover.h:92
Joint * jointPtr
Associated joint.
Definition: jointmover.h:97
void CopyFrom(VART::JointMover &jointMover, VART::Joint *targetJoint)
Copy jointMover data to this jointMover, setting its jointPtr atribute to the targetJoint.
Definition: jointmover.cpp:130
void DeactivateDofMovers()
Deactivates all DOF movers.
Definition: jointmover.cpp:87
float GetDuration()
Return the total movement duration (in seconds).
Definition: jointmover.h:61
An object that modifies noisy dof movers.
Definition: dmmodifier.h:15
Header file for V-ART class "Joint".
Controller for DOF movement.
Definition: dofmover.h:24
Interpolator representation.
Definition: interpolator.h:17
void AttachToJoint(Joint *newJointPtr)
Sets the associated joint.
Definition: jointmover.h:34
friend std::ostream & operator<<(std::ostream &output, const JointMover &mover)
Controllers for joint movement.
Definition: jointmover.h:22
void MultiplyTimes(float value)
Changes starting/ending times of all dof movers.
Definition: jointmover.cpp:94
Noisy Controller for DOF movement.
Definition: noisydofmover.h:17
void Move()
Moves the associated joint.
Definition: jointmover.cpp:43
DofMover * GetDofMover(Joint::DofID dof)
Return the DofMover working on given Dof.
Definition: jointmover.cpp:107
std::list< DofMover * > dofMoverList
Definition: jointmover.h:101
void SetInterpolator(const Interpolator &interp)
Changes the associated interpolator.
Definition: jointmover.h:64
const VART::Joint * GetAttachedJoint() const
Returns the associated joint.
Definition: jointmover.h:37
void AddDofMover(Joint::DofID dof, float iniTime, float finTime, float finPos)
Creates a DofMover.
Definition: jointmover.cpp:59
const Interpolator * GetInterpolator()
Returns a pointer to the associated interpolator. NULL is returned if there are no interpolator assoc...
Definition: jointmover.h:68
NoisyDofMover * AddNoisyDofMover(Joint::DofID dof, float iniTime, float finTime, float finPos)
Creates a noisy DofMover.
Definition: jointmover.cpp:72