TwiceAsNice  2019-02-18
Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
Basda::MoConModuleDummy Class Reference

#include <ModuleDummy.h>

Inheritance diagram for Basda::MoConModuleDummy:
Inheritance graph
Collaboration diagram for Basda::MoConModuleDummy:
Collaboration graph

Classes

struct  PositionBlock
 

Public Member Functions

 MoConModuleDummy (std::string _name, const Nice::JointPtr &_config)
 
virtual ~MoConModuleDummy ()
 
void setBasicSettings (const SelectBasicSettings::Constant _selectID, const double _parameter)
 
With this method a value of the basic configuration can be changed. More...
 
void setBasicSettings ()
 This method sets all basic configuration with the values stored in the property tree. More...
 
void getBasicSettings ()
 This method returns the basic configuration of the motor. More...
 
void stop ()
 This method stops the motor with a deceleration. More...
 
void abort ()
 Abort the moving of the motor immediately without deceleration. More...
 
void moveToPositiveLimit ()
 The motor moves to the positive software limit switch. More...
 
void moveToLimit (const int &_limit)
 move the motor to the positive limit switches (_limits[i]>0) or negative (_limits[i]<0) limit switches. More...
 
virtual void moveAbsolute (const int &_position)
 The motor move to the absolute position. More...
 
virtual void moveRelative (const int &_position)
 The motor moves to the relative position. More...
 
void moveToNegativeLimit ()
 The motor moves to the negative software limit switch. More...
 
virtual void moveToHome ()
 The motor is looking for the reference positions and reset the step counter to zero. More...
 
void setExternalProfileBufferSize (const unsigned int _bufferSize, bool _extended=true)
 This method set the external buffer size. More...
 
virtual bool isMoving ()
 Checks if the motors is in motion. More...
 
bool isAtHome ()
 This method indicate whether the motor is at the home position. More...
 
bool isMotionComplete ()
 Checks if the motor has finished the motion. More...
 
void setMotionComplete (bool _complete)
 Set the MOTOR_COMPLETE flag. More...
 
int isAtLimit ()
 Checks if the motors is in limit. More...
 
virtual double getMEncPosition ()
 Returns the current position of the motor. More...
 
double getAEncPosition ()
 Returns the current position of the motor. More...
 
double getIEncPosition ()
 Returns the current positions of the motor. More...
 
double getVelocity ()
 Returns the current velocity of the motor. More...
 
void waitForEvent (Nice::Time _time, Basda::DeviceAsync &_async)
 This method wait till an event was received. More...
 
Nice::I64 getReferenceTime ()
 This method synchronize the MoCon time with the PC time. More...
 
Nice::I64 getCurrentTime ()
 This method returns the current MoCon time. More...
 
void setExternalProfileData (const unsigned int _index, const unsigned int _timeBase, const int _velocity, const int _position, const int _acceleration=0, const int _jerk=0)
 This method set the external profile data. More...
 
void setExternalProfileStart (const ValueStartMode::Constant _startMode, const Nice::Date _startTime=Nice::Date::microSeconds(-1))
 This method starts the external profile from the beginning or from the last position. More...
 
void setExternalProfileStop ()
 This method starts the external profile at a defined time. More...
 
int getExternalProfileInfo ()
 This method returns the actual index of the external profile. More...
 
Nice::Time initExternalProfile (int _frequency, unsigned int _maxSamplesPerSegment, unsigned int _minSamplesPerSegment, unsigned int _faultTolerance)
 
void clearExternalProfileBuffer ()
 This method freed the allocated memory of the external profile. More...
 
void calculateTransition (const Nice::Date &_date, const Nice::NPoint &_positionSequence)
 This method calculates the transition from one trajectory to another if a trajectory already exist. More...
 
void calculateTransition (const Nice::Date &_date, const Nice::NPoint &_positionSequence, const Nice::Time &_transitionLength)
 
unsigned int fitTrajectory ()
 This method convert the given trajectory to a motor controller profile. More...
 
void validateExternalProfile ()
 
unsigned int bufferExternalProfile ()
 
Nice::Date uploadExternalProfile ()
 This uploads the external profile data. More...
 
bool isExternalProfileDone ()
 
void uploadExternalProfile (const Nice::SeqSeqInt &_segments)
 
void setPosition (const int &_position)
 Change the absolute position of the motor. More...
 
Nice::Time getLinkTimeout ()
 This method return the TCP connection timeout. More...
 
Nice::BitSet getPositionSwitchStatus ()
 
Nice::Completion getProgress ()
 
void setChatType (Nice::ChatLinePtr _chat)
 
void setCollision (bool _collisionNegative, bool _collisionPositive)
 
void setBrokenSwitches (Nice::BitSet _brokenPositionSwitchMask, int _fromPosition, int _toPosition)
 
void setWheelPositionOffset (int _positionOffset)
 
 MoConModuleDummy (std::string _name, const Nice::JointPtr &_config)
 
virtual ~MoConModuleDummy ()
 
void setBasicSettings (const SelectBasicSettings::Constant _selectID, const double _parameter)
 
With this method a value of the basic configuration can be changed. More...
 
void setBasicSettings ()
 This method sets all basic configuration with the values stored in the property tree. More...
 
void getBasicSettings ()
 This method returns the basic configuration of the motor. More...
 
void stop ()
 This method stops the motor with a deceleration. More...
 
void abort ()
 Abort the moving of the motor immediately without deceleration. More...
 
void moveToPositiveLimit ()
 The motor moves to the positive software limit switch. More...
 
void moveToLimit (const int &_limit)
 move the motor to the positive limit switches (_limits[i]>0) or negative (_limits[i]<0) limit switches. More...
 
virtual void moveAbsolute (const int &_position)
 The motor move to the absolute position. More...
 
virtual void moveRelative (const int &_position)
 The motor moves to the relative position. More...
 
void moveToNegativeLimit ()
 The motor moves to the negative software limit switch. More...
 
virtual void moveToHome ()
 The motor is looking for the reference positions and reset the step counter to zero. More...
 
void setExternalProfileBufferSize (const unsigned int _bufferSize, bool _extended=true)
 This method set the external buffer size. More...
 
virtual bool isMoving ()
 Checks if the motors is in motion. More...
 
bool isAtHome ()
 This method indicate whether the motor is at the home position. More...
 
bool isMotionComplete ()
 Checks if the motor has finished the motion. More...
 
void setMotionComplete (bool _complete)
 Set the MOTOR_COMPLETE flag. More...
 
int isAtLimit ()
 Checks if the motors is in limit. More...
 
virtual double getMEncPosition ()
 Returns the current position of the motor. More...
 
double getAEncPosition ()
 Returns the current position of the motor. More...
 
double getIEncPosition ()
 Returns the current positions of the motor. More...
 
double getVelocity ()
 Returns the current velocity of the motor. More...
 
void waitForEvent (Nice::Time _time, Basda::DeviceAsync &_async)
 This method wait till an event was received. More...
 
Nice::I64 getReferenceTime ()
 This method synchronize the MoCon time with the PC time. More...
 
Nice::I64 getCurrentTime ()
 This method returns the current MoCon time. More...
 
void setExternalProfileData (const unsigned int _index, const unsigned int _timeBase, const int _velocity, const int _position, const int _acceleration=0, const int _jerk=0)
 This method set the external profile data. More...
 
void setExternalProfileStart (const ValueStartMode::Constant _startMode, const Nice::Date _startTime=Nice::Date::microSeconds(-1))
 This method starts the external profile from the beginning or from the last position. More...
 
void setExternalProfileStop ()
 This method starts the external profile at a defined time. More...
 
int getExternalProfileInfo ()
 This method returns the actual index of the external profile. More...
 
Nice::Time initExternalProfile (int _frequency, unsigned int _maxSamplesPerSegment, unsigned int _minSamplesPerSegment, unsigned int _faultTolerance)
 
void clearExternalProfileBuffer ()
 This method freed the allocated memory of the external profile. More...
 
void calculateTransition (const Nice::Date &_date, const Nice::NPoint &_positionSequence)
 This method calculates the transition from one trajectory to another if a trajectory already exist. More...
 
void calculateTransition (const Nice::Date &_date, const Nice::NPoint &_positionSequence, const Nice::Time &_transitionLength)
 
unsigned int fitTrajectory ()
 This method convert the given trajectory to a motor controller profile. More...
 
void validateExternalProfile ()
 
unsigned int bufferExternalProfile ()
 
Nice::Date uploadExternalProfile ()
 This uploads the external profile data. More...
 
bool isExternalProfileDone ()
 
void uploadExternalProfile (const Nice::SeqSeqInt &_segments)
 
void setPosition (const int &_position)
 Change the absolute position of the motor. More...
 
Nice::Time getLinkTimeout ()
 This method return the TCP connection timeout. More...
 
Nice::BitSet getPositionSwitchStatus ()
 
Nice::Completion getProgress ()
 
void setChatType (Nice::ChatLinePtr _chat)
 
void setCollision (bool _collisionNegative, bool _collisionPositive)
 
void setBrokenSwitches (Nice::BitSet _brokenPositionSwitchMask, int _fromPosition, int _toPosition)
 
void setWheelPositionOffset (int _positionOffset)
 

Protected Types

enum  CMDS {
  MOVETOHOME, MOVETOHOMESINGLE, MOVETOLIMIT, MOVETOPOSITIVELIMIT,
  MOVETONEGATIVELIMIT, MOVEABSOLUTE, MOVERELATIVE, STARTEXTERNALPROFILE,
  MOVETOHOME, MOVETOHOMESINGLE, MOVETOLIMIT, MOVETOPOSITIVELIMIT,
  MOVETONEGATIVELIMIT, MOVEABSOLUTE, MOVERELATIVE, STARTEXTERNALPROFILE
}
 
enum  CMDS {
  MOVETOHOME, MOVETOHOMESINGLE, MOVETOLIMIT, MOVETOPOSITIVELIMIT,
  MOVETONEGATIVELIMIT, MOVEABSOLUTE, MOVERELATIVE, STARTEXTERNALPROFILE,
  MOVETOHOME, MOVETOHOMESINGLE, MOVETOLIMIT, MOVETOPOSITIVELIMIT,
  MOVETONEGATIVELIMIT, MOVEABSOLUTE, MOVERELATIVE, STARTEXTERNALPROFILE
}
 

Protected Member Functions

template<typename Type >
Type checkAttribute (const std::string &_node, const std::string &_attributeName, const Type &_default)
 
void addInternalProperties ()
 This method add some internal properties like status properties. More...
 
void generateBrokenWheelSwitches ()
 
void travelRangeChanged (const Nice::Point &_p)
 
void startTimer (const Nice::Date _startDate)
 When the Date is not set (Nice::Date()) the the timer starts immediately. More...
 
template<typename Type >
Type checkAttribute (const std::string &_node, const std::string &_attributeName, const Type &_default)
 
void addInternalProperties ()
 This method add some internal properties like status properties. More...
 
void generateBrokenWheelSwitches ()
 
void travelRangeChanged (const Nice::Point &_p)
 
void startTimer (const Nice::Date _startDate)
 When the Date is not set (Nice::Date()) the the timer starts immediately. More...
 

Protected Attributes

std::string m_name
 
int m_cardNo
 
int m_moduleNo
 
Nice::JointPtr m_config
 
Nice::Completion m_completion
 
Nice::Timer m_timer
 
Nice::Timer m_countDown
 
Nice::Time m_duration
 
int m_maxVelocity
 
int m_minVelocity
 
int m_limit
 
bool m_collisionPositive
 
bool m_collisionNegative
 
PositionBlock m_commandedPosition
 
PositionBlock m_absEncPosition
 
PositionBlock m_incEncPosition
 
bool m_extendedProfileParamter
 member for to define buffering mode (start from the beginning or from the last position) More...
 
unsigned int m_bufferSize
 the external profile buffer size More...
 
unsigned int m_externalProfileIndexCycle
 the index of the buffer cell to store the next segment More...
 
Nice::I64 m_externalProfileStartCycle
 the cycle when the external profile started More...
 
Nice::I64 m_elapsedCyclesSinceProfileStart
 the difference between the current cycle and the m_externalProfileStartCycle (profile elapsed cycles) More...
 
Nice::I64 m_sumOfSegmentDuration
 sum of the elapsed segment duration (in cycles) since profile start More...
 
unsigned int m_externalProfileInfo
 the current index of the executed external profile segment More...
 
Nice::Time m_timeResolution
 
int m_frequency
 
Basda::MoConModuleProfile m_profile
 member for the extended external profile mode More...
 
Nice::NPoint m_positionSequence
 
Nice::NPoint m_positionSequenceBackup
 
Nice::Date m_startDate
 
Nice::Point m_travelRange
 
Nice::Time m_blockSize
 
Nice::Date m_pcReferenceDate
 
Nice::Date m_currentPcDate
 
Nice::I64 m_currentMoConClocks
 
double m_cycleTime
 
Nice::U16 m_basicResolution
 
Nice::U32 m_basicAcceleration
 
double m_accelerationPerCycle
 The basic acceleration is set during the external profile initialization, to keep the acceleration constant over the whole trajectory. More...
 
std::vector< Basda::MoConModuleProfile::Segmentm_externalProfileBuffer
 
unsigned int m_externalProfileBufferSize
 
Nice::Monitor m_monitor
 
Nice::ChatLinePtr m_chat
 
Nice::SeqSeqInt m_segments
 
unsigned int m_microsteps
 
Nice::U32 m_depth
 
Nice::SeqBitSet m_positionSwitches
 
Nice::SeqBitSet m_brokenPositionSwitchMask
 
int m_positionOffset
 
int m_correctedPositionDeviation
 
Nice::DateDummyPtr m_niceDateDummy
 

Member Enumeration Documentation

◆ CMDS [1/2]

Enumerator
MOVETOHOME 
MOVETOHOMESINGLE 
MOVETOLIMIT 
MOVETOPOSITIVELIMIT 
MOVETONEGATIVELIMIT 
MOVEABSOLUTE 
MOVERELATIVE 
STARTEXTERNALPROFILE 
MOVETOHOME 
MOVETOHOMESINGLE 
MOVETOLIMIT 
MOVETOPOSITIVELIMIT 
MOVETONEGATIVELIMIT 
MOVEABSOLUTE 
MOVERELATIVE 
STARTEXTERNALPROFILE 

◆ CMDS [2/2]

Enumerator
MOVETOHOME 
MOVETOHOMESINGLE 
MOVETOLIMIT 
MOVETOPOSITIVELIMIT 
MOVETONEGATIVELIMIT 
MOVEABSOLUTE 
MOVERELATIVE 
STARTEXTERNALPROFILE 
MOVETOHOME 
MOVETOHOMESINGLE 
MOVETOLIMIT 
MOVETOPOSITIVELIMIT 
MOVETONEGATIVELIMIT 
MOVEABSOLUTE 
MOVERELATIVE 
STARTEXTERNALPROFILE 

Constructor & Destructor Documentation

◆ MoConModuleDummy() [1/2]

Basda::MoConModuleDummy::MoConModuleDummy ( std::string  _name,
const Nice::JointPtr _config 
)

◆ ~MoConModuleDummy() [1/2]

Basda::MoConModuleDummy::~MoConModuleDummy ( )
virtual

◆ MoConModuleDummy() [2/2]

Basda::MoConModuleDummy::MoConModuleDummy ( std::string  _name,
const Nice::JointPtr _config 
)

◆ ~MoConModuleDummy() [2/2]

virtual Basda::MoConModuleDummy::~MoConModuleDummy ( )
virtual

Member Function Documentation

◆ abort() [1/2]

void Basda::MoConModuleDummy::abort ( void  )

Abort the moving of the motor immediately without deceleration.

◆ abort() [2/2]

void Basda::MoConModuleDummy::abort ( )

Abort the moving of the motor immediately without deceleration.

◆ addInternalProperties() [1/2]

void Basda::MoConModuleDummy::addInternalProperties ( )
protected

This method add some internal properties like status properties.

◆ addInternalProperties() [2/2]

void Basda::MoConModuleDummy::addInternalProperties ( )
protected

This method add some internal properties like status properties.

◆ bufferExternalProfile() [1/2]

unsigned int Basda::MoConModuleDummy::bufferExternalProfile ( )

◆ bufferExternalProfile() [2/2]

unsigned int Basda::MoConModuleDummy::bufferExternalProfile ( )

◆ calculateTransition() [1/4]

void Basda::MoConModuleDummy::calculateTransition ( const Nice::Date _date,
const Nice::NPoint _positionSequence 
)

This method calculates the transition from one trajectory to another if a trajectory already exist.

Parameters
_date- the external profile start date
_positionSequence- supporting points of the spline in steps
_transitionLength- the time how long the transition should take

◆ calculateTransition() [2/4]

void Basda::MoConModuleDummy::calculateTransition ( const Nice::Date _date,
const Nice::NPoint _positionSequence 
)

This method calculates the transition from one trajectory to another if a trajectory already exist.

Parameters
_date- the external profile start date
_positionSequence- supporting points of the spline in steps
_transitionLength- the time how long the transition should take

◆ calculateTransition() [3/4]

void Basda::MoConModuleDummy::calculateTransition ( const Nice::Date _date,
const Nice::NPoint _positionSequence,
const Nice::Time _transitionLength 
)

◆ calculateTransition() [4/4]

void Basda::MoConModuleDummy::calculateTransition ( const Nice::Date _date,
const Nice::NPoint _positionSequence,
const Nice::Time _transitionLength 
)

◆ checkAttribute() [1/2]

template<typename Type >
Type Basda::MoConModuleDummy::checkAttribute ( const std::string &  _node,
const std::string &  _attributeName,
const Type _default 
)
protected

◆ checkAttribute() [2/2]

template<typename Type >
Type Basda::MoConModuleDummy::checkAttribute ( const std::string &  _node,
const std::string &  _attributeName,
const Type _default 
)
protected

◆ clearExternalProfileBuffer() [1/2]

void Basda::MoConModuleDummy::clearExternalProfileBuffer ( )

This method freed the allocated memory of the external profile.

◆ clearExternalProfileBuffer() [2/2]

void Basda::MoConModuleDummy::clearExternalProfileBuffer ( )

This method freed the allocated memory of the external profile.

◆ fitTrajectory() [1/2]

unsigned int Basda::MoConModuleDummy::fitTrajectory ( )

This method convert the given trajectory to a motor controller profile.

The external profile can be setup with a spline which has some supporting points (in PC time and steps). This spline will be converted to motor controller time and microsteps steps.

Returns
the number of generated segments

The final external profile coordinates will be calculated as followed:

$ point.xp = (double) lrint(i * m_timeResolution.toMicroSecondsDouble() / m_cycleTime) $

$ point.yp = _positionSequence.at(i) * m_microsteps; $

where i is the index of the position sequence the other variables are self-explained, i hope :)

◆ fitTrajectory() [2/2]

unsigned int Basda::MoConModuleDummy::fitTrajectory ( )

This method convert the given trajectory to a motor controller profile.

The external profile can be setup with a spline which has some supporting points (in PC time and steps). This spline will be converted to motor controller time and microsteps steps.

Returns
the number of generated segments

The final external profile coordinates will be calculated as followed:

$ point.xp = (double) lrint(i * m_timeResolution.toMicroSecondsDouble() / m_cycleTime) $

$ point.yp = _positionSequence.at(i) * m_microsteps; $

where i is the index of the position sequence the other variables are self-explained, i hope :)

◆ generateBrokenWheelSwitches() [1/2]

void Basda::MoConModuleDummy::generateBrokenWheelSwitches ( )
protected

◆ generateBrokenWheelSwitches() [2/2]

void Basda::MoConModuleDummy::generateBrokenWheelSwitches ( )
protected

◆ getAEncPosition() [1/2]

double Basda::MoConModuleDummy::getAEncPosition ( )

Returns the current position of the motor.

The current position of the motor will be stored in the property

  • VAR.POSITION.ABSOLUTE_ENCODER

◆ getAEncPosition() [2/2]

double Basda::MoConModuleDummy::getAEncPosition ( )

Returns the current position of the motor.

The current position of the motor will be stored in the property

  • VAR.POSITION.ABSOLUTE_ENCODER

◆ getBasicSettings() [1/2]

void Basda::MoConModuleDummy::getBasicSettings ( )

This method returns the basic configuration of the motor.

The basic settings will be stored in the properties:

  • CFG.DATASHEET.BASIC.PROFILE
  • CFG.DATASHEET.BASIC.RESOLUTION
  • CFG.DATASHEET.BASIC.VELOCITY.STRAIGHT
  • CFG.DATASHEET.BASIC.VELOCITY.START
  • CFG.DATASHEET.BASIC.VELOCITY.ACCELERATION
  • CFG.DATASHEET.BASIC.VELOCITY.DECELERATION
  • CFG.DATASHEET.BASIC.JERK
Exceptions
Basda::MoCon::MotorNotInitializedException

◆ getBasicSettings() [2/2]

void Basda::MoConModuleDummy::getBasicSettings ( )

This method returns the basic configuration of the motor.

The basic settings will be stored in the properties:

  • CFG.DATASHEET.BASIC.PROFILE
  • CFG.DATASHEET.BASIC.RESOLUTION
  • CFG.DATASHEET.BASIC.VELOCITY.STRAIGHT
  • CFG.DATASHEET.BASIC.VELOCITY.START
  • CFG.DATASHEET.BASIC.VELOCITY.ACCELERATION
  • CFG.DATASHEET.BASIC.VELOCITY.DECELERATION
  • CFG.DATASHEET.BASIC.JERK
Exceptions
Basda::MoCon::MotorNotInitializedException

◆ getCurrentTime() [1/2]

Nice::I64 Basda::MoConModuleDummy::getCurrentTime ( )

This method returns the current MoCon time.

See also
getReferenceTime()
Basda::MoConModule::getCurrentTime()

◆ getCurrentTime() [2/2]

Nice::I64 Basda::MoConModuleDummy::getCurrentTime ( )

This method returns the current MoCon time.

See also
getReferenceTime()
Basda::MoConModule::getCurrentTime()

◆ getExternalProfileInfo() [1/2]

int Basda::MoConModuleDummy::getExternalProfileInfo ( )

This method returns the actual index of the external profile.

◆ getExternalProfileInfo() [2/2]

int Basda::MoConModuleDummy::getExternalProfileInfo ( )

This method returns the actual index of the external profile.

◆ getIEncPosition() [1/2]

double Basda::MoConModuleDummy::getIEncPosition ( )

Returns the current positions of the motor.

The current position of the motor will be stored in the property

  • VAR.POSITION.INCREMENTAL_ENCODER

◆ getIEncPosition() [2/2]

double Basda::MoConModuleDummy::getIEncPosition ( )

Returns the current positions of the motor.

The current position of the motor will be stored in the property

  • VAR.POSITION.INCREMENTAL_ENCODER

◆ getLinkTimeout() [1/2]

Nice::Time Basda::MoConModuleDummy::getLinkTimeout ( )

This method return the TCP connection timeout.

Returns
the TCP connection timeout

◆ getLinkTimeout() [2/2]

Nice::Time Basda::MoConModuleDummy::getLinkTimeout ( )

This method return the TCP connection timeout.

Returns
the TCP connection timeout

◆ getMEncPosition() [1/2]

virtual double Basda::MoConModuleDummy::getMEncPosition ( )
virtual

Returns the current position of the motor.

The current position of the motor will be stored in the property

Have to be virtual because it is overloaded in the ModuleDummyMock of the wheel dummy test

  • VAR.POSITION

◆ getMEncPosition() [2/2]

double Basda::MoConModuleDummy::getMEncPosition ( )
virtual

Returns the current position of the motor.

The current position of the motor will be stored in the property

Have to be virtual because it is overloaded in the ModuleDummyMock of the wheel dummy test

  • VAR.POSITION

◆ getPositionSwitchStatus() [1/2]

Nice::BitSet Basda::MoConModuleDummy::getPositionSwitchStatus ( )

◆ getPositionSwitchStatus() [2/2]

Nice::BitSet Basda::MoConModuleDummy::getPositionSwitchStatus ( )

◆ getProgress() [1/2]

Nice::Completion Basda::MoConModuleDummy::getProgress ( )

◆ getProgress() [2/2]

Nice::Completion Basda::MoConModuleDummy::getProgress ( )

◆ getReferenceTime() [1/2]

Nice::I64 Basda::MoConModuleDummy::getReferenceTime ( )

This method synchronize the MoCon time with the PC time.

See also
getCurrentTime()
Basda::MoConModule::synchronizeTime()

◆ getReferenceTime() [2/2]

Nice::I64 Basda::MoConModuleDummy::getReferenceTime ( )

This method synchronize the MoCon time with the PC time.

See also
getCurrentTime()
Basda::MoConModule::synchronizeTime()

◆ getVelocity() [1/2]

double Basda::MoConModuleDummy::getVelocity ( )

Returns the current velocity of the motor.

The current velocity of the motor will be stored in the property

  • VAR.VELOCITY

◆ getVelocity() [2/2]

double Basda::MoConModuleDummy::getVelocity ( )

Returns the current velocity of the motor.

The current velocity of the motor will be stored in the property

  • VAR.VELOCITY

◆ initExternalProfile() [1/2]

Nice::Time Basda::MoConModuleDummy::initExternalProfile ( int  _frequency,
unsigned int  _maxSamplesPerSegment,
unsigned int  _minSamplesPerSegment,
unsigned int  _faultTolerance 
)

◆ initExternalProfile() [2/2]

Nice::Time Basda::MoConModuleDummy::initExternalProfile ( int  _frequency,
unsigned int  _maxSamplesPerSegment,
unsigned int  _minSamplesPerSegment,
unsigned int  _faultTolerance 
)

◆ isAtHome() [1/2]

bool Basda::MoConModuleDummy::isAtHome ( )

This method indicate whether the motor is at the home position.

◆ isAtHome() [2/2]

bool Basda::MoConModuleDummy::isAtHome ( )

This method indicate whether the motor is at the home position.

◆ isAtLimit() [1/2]

int Basda::MoConModuleDummy::isAtLimit ( )

Checks if the motors is in limit.

  • VAR.LIMIT
Returns
-1 negative limit; 0 no limit; 1 positive limit

◆ isAtLimit() [2/2]

int Basda::MoConModuleDummy::isAtLimit ( )

Checks if the motors is in limit.

  • VAR.LIMIT
Returns
-1 negative limit; 0 no limit; 1 positive limit

◆ isExternalProfileDone() [1/2]

bool Basda::MoConModuleDummy::isExternalProfileDone ( )

◆ isExternalProfileDone() [2/2]

bool Basda::MoConModuleDummy::isExternalProfileDone ( )

◆ isMotionComplete() [1/2]

bool Basda::MoConModuleDummy::isMotionComplete ( )

Checks if the motor has finished the motion.

The following property will indicate the motion completeness

  • VAR.MOTION_COMPLETE
Todo:
this method doesn't update this property active. It just readout its property. An active readout of the motion complete event should be implemented.

◆ isMotionComplete() [2/2]

bool Basda::MoConModuleDummy::isMotionComplete ( )

Checks if the motor has finished the motion.

The following property will indicate the motion completeness

  • VAR.MOTION_COMPLETE
Todo:
this method doesn't update this property active. It just readout its property. An active readout of the motion complete event should be implemented.

◆ isMoving() [1/2]

virtual bool Basda::MoConModuleDummy::isMoving ( )
virtual

Checks if the motors is in motion.

  • VAR.MOVING

Have to be virtual because it is overloaded in the ModuleDummyMock of the wheel dummy test

Returns
true if the motor is in motion

◆ isMoving() [2/2]

bool Basda::MoConModuleDummy::isMoving ( )
virtual

Checks if the motors is in motion.

  • VAR.MOVING

Have to be virtual because it is overloaded in the ModuleDummyMock of the wheel dummy test

Returns
true if the motor is in motion

◆ moveAbsolute() [1/2]

void Basda::MoConModuleDummy::moveAbsolute ( const int &  _position)
virtual

The motor move to the absolute position.

Have to be virtual because it is overloaded in the ModuleDummyMock of the wheel dummy test

Parameters
_positionis the target position

◆ moveAbsolute() [2/2]

virtual void Basda::MoConModuleDummy::moveAbsolute ( const int &  _position)
virtual

The motor move to the absolute position.

Have to be virtual because it is overloaded in the ModuleDummyMock of the wheel dummy test

Parameters
_positionis the target position

◆ moveRelative() [1/2]

void Basda::MoConModuleDummy::moveRelative ( const int &  _position)
virtual

The motor moves to the relative position.

Have to be virtual because it is overloaded in the ModuleDummyMock of the wheel dummy test

Parameters
_positionis the target positions

◆ moveRelative() [2/2]

virtual void Basda::MoConModuleDummy::moveRelative ( const int &  _position)
virtual

The motor moves to the relative position.

Have to be virtual because it is overloaded in the ModuleDummyMock of the wheel dummy test

Parameters
_positionis the target positions

◆ moveToHome() [1/2]

void Basda::MoConModuleDummy::moveToHome ( )
virtual

The motor is looking for the reference positions and reset the step counter to zero.

Have to be virtual because it is overloaded in the ModuleDummyMock of the wheel dummy test

◆ moveToHome() [2/2]

virtual void Basda::MoConModuleDummy::moveToHome ( )
virtual

The motor is looking for the reference positions and reset the step counter to zero.

Have to be virtual because it is overloaded in the ModuleDummyMock of the wheel dummy test

◆ moveToLimit() [1/2]

void Basda::MoConModuleDummy::moveToLimit ( const int &  _limit)

move the motor to the positive limit switches (_limits[i]>0) or negative (_limits[i]<0) limit switches.

Parameters
_limita vector that contains to which limit the motors have to move (_limits[i]>0 - to positive limit) (_limits[i]<0 - to negative limit) whereas the order of the points is corresponding to the order of the motor names in the property tree (alphabetical).

◆ moveToLimit() [2/2]

void Basda::MoConModuleDummy::moveToLimit ( const int &  _limit)

move the motor to the positive limit switches (_limits[i]>0) or negative (_limits[i]<0) limit switches.

Parameters
_limita vector that contains to which limit the motors have to move (_limits[i]>0 - to positive limit) (_limits[i]<0 - to negative limit) whereas the order of the points is corresponding to the order of the motor names in the property tree (alphabetical).

◆ moveToNegativeLimit() [1/2]

void Basda::MoConModuleDummy::moveToNegativeLimit ( )

The motor moves to the negative software limit switch.

Parameters
_travelRangeCheckis true if the travel range might be checked before the movement. In that case the motor will move maximal to the software limit. If false the motor will move relative INT_MAX steps
Returns
the minimal absolute position within the travel range (return value is required to calculate the completion value)

◆ moveToNegativeLimit() [2/2]

void Basda::MoConModuleDummy::moveToNegativeLimit ( )

The motor moves to the negative software limit switch.

Parameters
_travelRangeCheckis true if the travel range might be checked before the movement. In that case the motor will move maximal to the software limit. If false the motor will move relative INT_MAX steps
Returns
the minimal absolute position within the travel range (return value is required to calculate the completion value)

◆ moveToPositiveLimit() [1/2]

void Basda::MoConModuleDummy::moveToPositiveLimit ( )

The motor moves to the positive software limit switch.

Parameters
_travelRangeCheckis true if the travel range might be checked before the movement. In that case the motor will move maximal to the software limit. If false the motor will move relative INT_MAX steps
Returns
the maximal absolute position within the travel range (return value is required to calculate the completion value)

◆ moveToPositiveLimit() [2/2]

void Basda::MoConModuleDummy::moveToPositiveLimit ( )

The motor moves to the positive software limit switch.

Parameters
_travelRangeCheckis true if the travel range might be checked before the movement. In that case the motor will move maximal to the software limit. If false the motor will move relative INT_MAX steps
Returns
the maximal absolute position within the travel range (return value is required to calculate the completion value)

◆ setBasicSettings() [1/4]

void Basda::MoConModuleDummy::setBasicSettings ( const SelectBasicSettings::Constant  _selectID,
const double  _parameter 
)


With this method a value of the basic configuration can be changed.

The basic setting consist of

SelectID Parameter
Profile 0=trapeze, 2=s-curve
Steps/Counts per revolution 1..8192
Velocity 0.0115..81916250.0 (unit: revolution per minute)
Start velocity 0.0115..81916250.0 (unit: revolution per minute)
Acceleration 1717..2147483647 (unit: revolution per minute^2)
Deceleration 1717..2147483647 (unit: revolution per minute^2)
Jerk 3930..2147483647 (unit: revolution per minute^3)
Parameters
_selectIDis the ID to define the type of the _parameter
_parameterthe configuration value
Exceptions
Basda::MoCon::CmdForStepperException
Basda::MoCon::RevolutionNotDefinedException
Basda::MoCon::MotorInMotionException
See also
MPIA/MoCon/CommandIDs.h - SelectBasicSettings

◆ setBasicSettings() [2/4]

void Basda::MoConModuleDummy::setBasicSettings ( const SelectBasicSettings::Constant  _selectID,
const double  _parameter 
)


With this method a value of the basic configuration can be changed.

The basic setting consist of

SelectID Parameter
Profile 0=trapeze, 2=s-curve
Steps/Counts per revolution 1..8192
Velocity 0.0115..81916250.0 (unit: revolution per minute)
Start velocity 0.0115..81916250.0 (unit: revolution per minute)
Acceleration 1717..2147483647 (unit: revolution per minute^2)
Deceleration 1717..2147483647 (unit: revolution per minute^2)
Jerk 3930..2147483647 (unit: revolution per minute^3)
Parameters
_selectIDis the ID to define the type of the _parameter
_parameterthe configuration value
Exceptions
Basda::MoCon::CmdForStepperException
Basda::MoCon::RevolutionNotDefinedException
Basda::MoCon::MotorInMotionException
See also
MPIA/MoCon/CommandIDs.h - SelectBasicSettings

◆ setBasicSettings() [3/4]

void Basda::MoConModuleDummy::setBasicSettings ( )

This method sets all basic configuration with the values stored in the property tree.

The basic configuration values are stored in the sub tree CFG.DATASHEET.BASIC of the motor and can be configured via the configuration files.

◆ setBasicSettings() [4/4]

void Basda::MoConModuleDummy::setBasicSettings ( )

This method sets all basic configuration with the values stored in the property tree.

The basic configuration values are stored in the sub tree CFG.DATASHEET.BASIC of the motor and can be configured via the configuration files.

◆ setBrokenSwitches() [1/2]

void Basda::MoConModuleDummy::setBrokenSwitches ( Nice::BitSet  _brokenPositionSwitchMask,
int  _fromPosition,
int  _toPosition 
)

◆ setBrokenSwitches() [2/2]

void Basda::MoConModuleDummy::setBrokenSwitches ( Nice::BitSet  _brokenPositionSwitchMask,
int  _fromPosition,
int  _toPosition 
)

◆ setChatType() [1/2]

void Basda::MoConModuleDummy::setChatType ( Nice::ChatLinePtr  _chat)
inline

◆ setChatType() [2/2]

void Basda::MoConModuleDummy::setChatType ( Nice::ChatLinePtr  _chat)
inline

◆ setCollision() [1/2]

void Basda::MoConModuleDummy::setCollision ( bool  _collisionNegative,
bool  _collisionPositive 
)

◆ setCollision() [2/2]

void Basda::MoConModuleDummy::setCollision ( bool  _collisionNegative,
bool  _collisionPositive 
)

◆ setExternalProfileBufferSize() [1/2]

void Basda::MoConModuleDummy::setExternalProfileBufferSize ( const unsigned int  _bufferSize,
bool  _extended = true 
)

This method set the external buffer size.

Parameters
_bufferSizethe buffer size 1..4294967295
_extendedenables the extended mode that allows to program the external profile with < index >, < time >, < velocity >, < position >, < acceleration >, < jerk >, otherwise the external profile needs only the parameter < index >, < time >, < velocity >, < position > (disable = 0, enable = 1)
See also
::Basda::MoConModuleEvent::parseTraceData

◆ setExternalProfileBufferSize() [2/2]

void Basda::MoConModuleDummy::setExternalProfileBufferSize ( const unsigned int  _bufferSize,
bool  _extended = true 
)

This method set the external buffer size.

Parameters
_bufferSizethe buffer size 1..4294967295
_extendedenables the extended mode that allows to program the external profile with < index >, < time >, < velocity >, < position >, < acceleration >, < jerk >, otherwise the external profile needs only the parameter < index >, < time >, < velocity >, < position > (disable = 0, enable = 1)
See also
::Basda::MoConModuleEvent::parseTraceData

◆ setExternalProfileData() [1/2]

void Basda::MoConModuleDummy::setExternalProfileData ( const unsigned int  _index,
const unsigned int  _timeBase,
const int  _velocity,
const int  _position,
const int  _acceleration = 0,
const int  _jerk = 0 
)

This method set the external profile data.

Parameters
_indexthe data value index 0..4294967295
_timeBase0..4294967295
_velocity-2147483647..2147483647
_position-2147483647..2147483647
_accelerationoptional, has to be defined if the extended mode is enabled
_jerkoptional, has to be defined if the extended mode is enabled
See also
::Basda::MoConModuleEvent::parseTraceData

◆ setExternalProfileData() [2/2]

void Basda::MoConModuleDummy::setExternalProfileData ( const unsigned int  _index,
const unsigned int  _timeBase,
const int  _velocity,
const int  _position,
const int  _acceleration = 0,
const int  _jerk = 0 
)

This method set the external profile data.

Parameters
_indexthe data value index 0..4294967295
_timeBase0..4294967295
_velocity-2147483647..2147483647
_position-2147483647..2147483647
_accelerationoptional, has to be defined if the extended mode is enabled
_jerkoptional, has to be defined if the extended mode is enabled
See also
::Basda::MoConModuleEvent::parseTraceData

◆ setExternalProfileStart() [1/2]

void Basda::MoConModuleDummy::setExternalProfileStart ( const ValueStartMode::Constant  _startMode,
const Nice::Date  _startTime = Nice::Date::microSeconds(-1) 
)

This method starts the external profile from the beginning or from the last position.

Parameters
_startMode- define whether the profile should start from the beginning or from the current position
_starTime- the start time in cycle clocks (-1 is chosen to start the profile immediately; start time 0 (zero means to start at cycle zero))
See also
MPIA/MoCon/CommandIDs.h - ValueStartMode

◆ setExternalProfileStart() [2/2]

void Basda::MoConModuleDummy::setExternalProfileStart ( const ValueStartMode::Constant  _startMode,
const Nice::Date  _startTime = Nice::Date::microSeconds(-1) 
)

This method starts the external profile from the beginning or from the last position.

Parameters
_startMode- define whether the profile should start from the beginning or from the current position
_starTime- the start time in cycle clocks (-1 is chosen to start the profile immediately; start time 0 (zero means to start at cycle zero))
See also
MPIA/MoCon/CommandIDs.h - ValueStartMode

◆ setExternalProfileStop() [1/2]

void Basda::MoConModuleDummy::setExternalProfileStop ( )

This method starts the external profile at a defined time.

Parameters
_startTime- the start time in cycle
_startMode- define whether the profile should start from the beginning or from the current position
See also
MPIA/MoCon/CommandIDs.h - ValueStartMode This method stops the external profile.

◆ setExternalProfileStop() [2/2]

void Basda::MoConModuleDummy::setExternalProfileStop ( )

This method starts the external profile at a defined time.

Parameters
_startTime- the start time in cycle
_startMode- define whether the profile should start from the beginning or from the current position
See also
MPIA/MoCon/CommandIDs.h - ValueStartMode This method stops the external profile.

◆ setMotionComplete() [1/2]

void Basda::MoConModuleDummy::setMotionComplete ( bool  _complete)

Set the MOTOR_COMPLETE flag.

The following property is used

  • VAR.MOTION_COMPLETE

◆ setMotionComplete() [2/2]

void Basda::MoConModuleDummy::setMotionComplete ( bool  _complete)

Set the MOTOR_COMPLETE flag.

The following property is used

  • VAR.MOTION_COMPLETE

◆ setPosition() [1/2]

void Basda::MoConModuleDummy::setPosition ( const int &  _position)

Change the absolute position of the motor.

The motor will not move, but the current absolute position will be set to the given position value. The new position value can only be inside the travel range.

Parameters
_positionthe new absolute position of the motor

◆ setPosition() [2/2]

void Basda::MoConModuleDummy::setPosition ( const int &  _position)

Change the absolute position of the motor.

The motor will not move, but the current absolute position will be set to the given position value. The new position value can only be inside the travel range.

Parameters
_positionthe new absolute position of the motor

◆ setWheelPositionOffset() [1/2]

void Basda::MoConModuleDummy::setWheelPositionOffset ( int  _positionOffset)

◆ setWheelPositionOffset() [2/2]

void Basda::MoConModuleDummy::setWheelPositionOffset ( int  _positionOffset)

◆ startTimer() [1/2]

void Basda::MoConModuleDummy::startTimer ( const Nice::Date  _startDate)
protected

When the Date is not set (Nice::Date()) the the timer starts immediately.

◆ startTimer() [2/2]

void Basda::MoConModuleDummy::startTimer ( const Nice::Date  _startDate)
protected

When the Date is not set (Nice::Date()) the the timer starts immediately.

◆ stop() [1/2]

void Basda::MoConModuleDummy::stop ( )

This method stops the motor with a deceleration.

◆ stop() [2/2]

void Basda::MoConModuleDummy::stop ( )

This method stops the motor with a deceleration.

◆ travelRangeChanged() [1/2]

void Basda::MoConModuleDummy::travelRangeChanged ( const Nice::Point _p)
protected

◆ travelRangeChanged() [2/2]

void Basda::MoConModuleDummy::travelRangeChanged ( const Nice::Point _p)
protected

◆ uploadExternalProfile() [1/4]

Nice::Date Basda::MoConModuleDummy::uploadExternalProfile ( )

This uploads the external profile data.

◆ uploadExternalProfile() [2/4]

Nice::Date Basda::MoConModuleDummy::uploadExternalProfile ( )

This uploads the external profile data.

◆ uploadExternalProfile() [3/4]

void Basda::MoConModuleDummy::uploadExternalProfile ( const Nice::SeqSeqInt _segments)

◆ uploadExternalProfile() [4/4]

void Basda::MoConModuleDummy::uploadExternalProfile ( const Nice::SeqSeqInt _segments)

◆ validateExternalProfile() [1/2]

void Basda::MoConModuleDummy::validateExternalProfile ( )

◆ validateExternalProfile() [2/2]

void Basda::MoConModuleDummy::validateExternalProfile ( )

◆ waitForEvent() [1/2]

void Basda::MoConModuleDummy::waitForEvent ( Nice::Time  _time,
Basda::DeviceAsync _async 
)

This method wait till an event was received.

Parameters
_timethe time how long the method should wait for an incoming event

◆ waitForEvent() [2/2]

void Basda::MoConModuleDummy::waitForEvent ( Nice::Time  _time,
Basda::DeviceAsync _async 
)

This method wait till an event was received.

Parameters
_timethe time how long the method should wait for an incoming event

Member Data Documentation

◆ m_absEncPosition

PositionBlock Basda::MoConModuleDummy::m_absEncPosition
protected

◆ m_accelerationPerCycle

double Basda::MoConModuleDummy::m_accelerationPerCycle
protected

The basic acceleration is set during the external profile initialization, to keep the acceleration constant over the whole trajectory.

◆ m_basicAcceleration

Nice::U32 Basda::MoConModuleDummy::m_basicAcceleration
protected

◆ m_basicResolution

Nice::U16 Basda::MoConModuleDummy::m_basicResolution
protected

◆ m_blockSize

Nice::Time Basda::MoConModuleDummy::m_blockSize
protected

◆ m_brokenPositionSwitchMask

Nice::SeqBitSet Basda::MoConModuleDummy::m_brokenPositionSwitchMask
protected

◆ m_bufferSize

unsigned int Basda::MoConModuleDummy::m_bufferSize
protected

the external profile buffer size

◆ m_cardNo

int Basda::MoConModuleDummy::m_cardNo
protected

◆ m_chat

Nice::ChatLinePtr Basda::MoConModuleDummy::m_chat
protected

◆ m_collisionNegative

bool Basda::MoConModuleDummy::m_collisionNegative
protected

◆ m_collisionPositive

bool Basda::MoConModuleDummy::m_collisionPositive
protected

◆ m_commandedPosition

PositionBlock Basda::MoConModuleDummy::m_commandedPosition
protected

◆ m_completion

Nice::Completion Basda::MoConModuleDummy::m_completion
protected

◆ m_config

Nice::JointPtr Basda::MoConModuleDummy::m_config
protected

◆ m_correctedPositionDeviation

int Basda::MoConModuleDummy::m_correctedPositionDeviation
protected

◆ m_countDown

Nice::Timer Basda::MoConModuleDummy::m_countDown
protected

◆ m_currentMoConClocks

Nice::I64 Basda::MoConModuleDummy::m_currentMoConClocks
protected

◆ m_currentPcDate

Nice::Date Basda::MoConModuleDummy::m_currentPcDate
protected

◆ m_cycleTime

double Basda::MoConModuleDummy::m_cycleTime
protected

◆ m_depth

Nice::U32 Basda::MoConModuleDummy::m_depth
protected

◆ m_duration

Nice::Time Basda::MoConModuleDummy::m_duration
protected

◆ m_elapsedCyclesSinceProfileStart

Nice::I64 Basda::MoConModuleDummy::m_elapsedCyclesSinceProfileStart
protected

the difference between the current cycle and the m_externalProfileStartCycle (profile elapsed cycles)

◆ m_extendedProfileParamter

bool Basda::MoConModuleDummy::m_extendedProfileParamter
protected

member for to define buffering mode (start from the beginning or from the last position)

◆ m_externalProfileBuffer

std::vector< Basda::MoConModuleProfile::Segment > Basda::MoConModuleDummy::m_externalProfileBuffer
protected

◆ m_externalProfileBufferSize

unsigned int Basda::MoConModuleDummy::m_externalProfileBufferSize
protected

◆ m_externalProfileIndexCycle

unsigned int Basda::MoConModuleDummy::m_externalProfileIndexCycle
protected

the index of the buffer cell to store the next segment

◆ m_externalProfileInfo

unsigned int Basda::MoConModuleDummy::m_externalProfileInfo
protected

the current index of the executed external profile segment

◆ m_externalProfileStartCycle

Nice::I64 Basda::MoConModuleDummy::m_externalProfileStartCycle
protected

the cycle when the external profile started

◆ m_frequency

int Basda::MoConModuleDummy::m_frequency
protected

◆ m_incEncPosition

PositionBlock Basda::MoConModuleDummy::m_incEncPosition
protected

◆ m_limit

int Basda::MoConModuleDummy::m_limit
protected

◆ m_maxVelocity

int Basda::MoConModuleDummy::m_maxVelocity
protected

◆ m_microsteps

unsigned int Basda::MoConModuleDummy::m_microsteps
protected

◆ m_minVelocity

int Basda::MoConModuleDummy::m_minVelocity
protected

◆ m_moduleNo

int Basda::MoConModuleDummy::m_moduleNo
protected

◆ m_monitor

Nice::Monitor Basda::MoConModuleDummy::m_monitor
protected

◆ m_name

std::string Basda::MoConModuleDummy::m_name
protected

◆ m_niceDateDummy

Nice::DateDummyPtr Basda::MoConModuleDummy::m_niceDateDummy
protected

◆ m_pcReferenceDate

Nice::Date Basda::MoConModuleDummy::m_pcReferenceDate
protected

◆ m_positionOffset

int Basda::MoConModuleDummy::m_positionOffset
protected

◆ m_positionSequence

Nice::NPoint Basda::MoConModuleDummy::m_positionSequence
protected

◆ m_positionSequenceBackup

Nice::NPoint Basda::MoConModuleDummy::m_positionSequenceBackup
protected

◆ m_positionSwitches

Nice::SeqBitSet Basda::MoConModuleDummy::m_positionSwitches
protected

◆ m_profile

Basda::MoConModuleProfile Basda::MoConModuleDummy::m_profile
protected

member for the extended external profile mode

◆ m_segments

Nice::SeqSeqInt Basda::MoConModuleDummy::m_segments
protected

◆ m_startDate

Nice::Date Basda::MoConModuleDummy::m_startDate
protected

◆ m_sumOfSegmentDuration

Nice::I64 Basda::MoConModuleDummy::m_sumOfSegmentDuration
protected

sum of the elapsed segment duration (in cycles) since profile start

Since the MoCon internal buffer is a ring buffer, the first segment can be overwritten and the total number of elapsed cycles can be calculated any more. This member keeps the sum of the duration since the profile start till now.

◆ m_timer

Nice::Timer Basda::MoConModuleDummy::m_timer
protected

◆ m_timeResolution

Nice::Time Basda::MoConModuleDummy::m_timeResolution
protected

◆ m_travelRange

Nice::Point Basda::MoConModuleDummy::m_travelRange
protected

The documentation for this class was generated from the following files: