23 interpolatorPtr = NULL;
29 jointPtr = newJointPtr;
30 duration = newDuration;
31 interpolatorPtr = &interpolator;
32 minimumDuration = newDuration * 0.5;
37 list<VART::DofMover*>::iterator iter;
39 for (iter = dofMoverList.begin(); iter != dofMoverList.end(); ++iter)
47 list<VART::DofMover*>::iterator iter;
55 for (iter = dofMoverList.begin(); iter != dofMoverList.end(); ++iter)
61 float minimumDurationCandidate = (finTime - iniTime) * 0.5;
63 moverPtr->
Initialize(iniTime, finTime, finPos);
64 moverPtr->
SetDof(const_cast<VART::Dof*>(&(jointPtr->GetDof(dof))));
66 dofMoverList.push_back(moverPtr);
67 if (minimumDurationCandidate < minimumDuration)
68 minimumDuration = minimumDurationCandidate;
73 float iniTime,
float finTime,
float finPos)
75 float minimumDurationCandidate = (finTime - iniTime) * 0.5;
78 moverPtr->
Initialize(iniTime, finTime, finPos);
79 moverPtr->
SetDof(const_cast<VART::Dof*>(&(jointPtr->GetDof(dof))));
81 dofMoverList.push_back(moverPtr);
82 if (minimumDurationCandidate < minimumDuration)
83 minimumDuration = minimumDurationCandidate;
89 list<VART::DofMover*>::iterator iter;
90 for (iter = dofMoverList.begin(); iter != dofMoverList.end(); ++iter)
91 (*iter)->active =
false;
96 list<VART::DofMover*>::iterator iter;
98 for (iter = dofMoverList.begin(); iter != dofMoverList.end(); ++iter)
101 (*iter)->initialTime *= value;
103 (*iter)->finalTime *= value;
109 if (jointPtr->HasDof(dofID))
111 const Dof* dofPtr = &(jointPtr->GetDof(dofID));
112 list<DofMover*>::iterator iter = dofMoverList.begin();
113 for (; iter != dofMoverList.end(); ++iter)
115 if ((*iter)->GetTarget() == dofPtr)
124 list<VART::DofMover*>::iterator iter;
126 for (iter = dofMoverList.begin(); iter != dofMoverList.end(); ++iter)
127 (*iter)->GetFinalTime(resultPtr);
135 std::list<VART::DofMover*>::iterator iter;
137 jointPtr = targetJoint;
157 list<DofMover*>::iterator dofIter = dofMoverList.begin();
158 for (; dofIter != dofMoverList.end(); ++dofIter)
162 modifier.
Modify(dofMoverPtr);
168 list<VART::DofMover*>::const_iterator iter = mover.
dofMoverList.begin();
171 << mover.
duration <<
"\">\n <interpolation type=\"";
174 case Interpolator::LINEAR:
175 output <<
"linear\"/>\n";
177 case Interpolator::EASE_IN_EASE_OUT:
178 output <<
"ease-in_ease-out\"/>\n";
181 output <<
"unknown\"/>\n";
186 output <<
" <dof_movement dofID=\""
191 output <<
" </joint_movement>\n";
void GetFinalTimes(std::list< float > *resultPtr)
Returns a list with all different final times for every dof mover.
void ModifyDofMovers(DMModifier &modifier)
Modifies noisy dof movers.
Header file for V-ART class "Dof".
Representation of joints.
Header file for V-ART class "Time".
const Interpolator * interpolatorPtr
static float goalTime
Time of next snapshot, normalized to joint movement's duration.
Dof * targetDofPtr
Target DOF.
const std::string & GetDescription() const
Returns a copy of the object's description.
std::ostream & operator<<(std::ostream &output, const Joint::DofID &dofId)
static float minimumDuration
Minimum duration when computing motion paths.
Joint * jointPtr
Associated joint.
float finalTime
Normalized deactivation time.
virtual void Modify(NoisyDofMover *moverPtr)=0
Header file for V-ART class "JointMover".
void CopyFrom(VART::JointMover &jointMover, VART::Joint *targetJoint)
Copy jointMover data to this jointMover, setting its jointPtr atribute to the targetJoint.
void DeactivateDofMovers()
Deactivates all DOF movers.
An object that modifies noisy dof movers.
static const Interpolator * interpolatorPtr
Position interpolator.
Controller for DOF movement.
Interpolator representation.
Controllers for joint movement.
virtual void Initialize(float iniTime, float finTime, float finPos)
Initializes a noisy DOF mover.
Header file for V-ART class "DofMover".
void MultiplyTimes(float value)
Changes starting/ending times of all dof movers.
Noisy Controller for DOF movement.
float initialTime
Time of predicted activation (normalized).
virtual TypeID GetID() const =0
void Move()
Moves the associated joint.
Header file for V-ART class "NoisyDofMover".
DofID GetDofID(const Dof *dofPtr) const
Returns the DofID of some member Dof.
DofMover * GetDofMover(Joint::DofID dof)
Return the DofMover working on given Dof.
Header file for V-ART class "LinearInterpolator".
void SetDof(Dof *dofPtr)
Sets the target DOF.
std::list< DofMover * > dofMoverList
Degree Of Freedom - basic component of a Joint.
void AddDofMover(Joint::DofID dof, float iniTime, float finTime, float finPos)
Creates a DofMover.
NoisyDofMover * AddNoisyDofMover(Joint::DofID dof, float iniTime, float finTime, float finPos)
Creates a noisy DofMover.
virtual void Initialize(float iniTime, float finTime, float finPos)
float targetPosition
Target position.