64 std::stringstream jointNameStream;
79 throw std::runtime_error(
"Please use YouBotJointParameters");
85 throw std::runtime_error(
"Please use YouBotJointParameters");
165 if (parameter.
value == 0) {
166 throw std::out_of_range(
"A Gear Ratio of zero is not allowed");
180 if (parameter.
value == 0) {
181 throw std::out_of_range(
"Zero Encoder Ticks per Round are not allowed");
192 int calibrationVel = 0;
200 throw std::runtime_error(
"No calibration direction for joint: " + this->
storage.
jointName);
204 calibrationVel *= -1;
264 quantity<angular_acceleration> accValue;
298 if (parameter.
value) {
314 unsigned int retry = 0;
331 throw std::runtime_error(
"Unable to get firmware version for joint: " + this->
storage.
jointName);
335 char versionString[9] = {0};
345 int controllerType = 0;
346 char firmwareVersion[9] = {0};
347 sscanf (versionString,
"%dV%s",&controllerType, firmwareVersion);
348 std::string version(firmwareVersion);
349 size_t founddot = version.find(
".");
350 while(founddot != std::string::npos){
351 version.erase(founddot,1);
352 founddot = version.find(
".");
455 throw std::out_of_range(
"A Gear Ratio of zero is not allowed");
459 throw std::out_of_range(
"Zero Encoder Ticks per Round are not allowed");
517 throw std::out_of_range(
"A Gear Ratio of zero is not allowed");
520 throw std::out_of_range(
"Zero Encoder Ticks per Round are not allowed");
546 throw std::out_of_range(
"A Gear Ratio of 0 is not allowed");
572 throw std::out_of_range(
"A Gear Ratio of 0 is not allowed");
640 data.
current = current / 1000.0 * ampere;
739 throw std::out_of_range(
"A torque constant of 0 is not allowed");
743 this->
setData(currentSetpoint);
759 throw std::out_of_range(
"A Gear Ratio of 0 is not allowed");
778 throw std::out_of_range(
"A Gear Ratio of zero is not allowed");
781 throw std::out_of_range(
"Zero Encoder Ticks per Round are not allowed");
805 throw std::out_of_range(
"A Gear Ratio of 0 is not allowed");
830 data.
current = current / 1000.0 * ampere;
851 throw std::out_of_range(
"A Gear Ratio of 0 is not allowed");
866 if(index == 0 || index > 55){
889 if(index < 17 || index > 55){
929 statusMessages.push_back(this->
storage.
jointName +
" got over temperature");
937 statusMessages.push_back(this->
storage.
jointName +
" got hall sensor problem");
953 statusMessages.push_back(this->
storage.
jointName +
" has velocity mode active");
957 statusMessages.push_back(this->
storage.
jointName +
" has position mode active");
961 statusMessages.push_back(this->
storage.
jointName +
" has torque mode active");
973 statusMessages.push_back(this->
storage.
jointName +
" has position reached");
1216 bool unvalid =
true;
1217 unsigned int retry = 0;
1254 mailboxMsgBuffer = mailboxMsg;
1255 bool unvalid =
true;
1256 unsigned int retry = 0;
EthercatMasterInterface * ethercatMaster
Acceleration parameter for velocity control and position control.
void setParameter(const unsigned int parameter)
the firmware version of the joint
virtual void setMsgBuffer(const YouBotSlaveMsg &msgBuffer, const unsigned int jointNumber)=0
void parseMailboxStatusFlags(const YouBotSlaveMailboxMsg &mailboxMsg)
the resolution of the encoders, it is needed for the calculations of the youBot Driver ...
void setParameter(const quantity< plane_angle > &lowerLimit, const quantity< plane_angle > &upperLimit, const bool activateLimits)
virtual void getConfigurationParameter(JointParameter ¶meter)
the resolution of the encoders, it is needed for the calculations of the youBot Driver ...
bool retrieveValueFromMotorContoller(YouBotSlaveMailboxMsg &message)
quantity< angular_velocity > angularVelocity
void setParameter(const double parameter)
YouBotSlaveMsg messageBuffer
virtual std::string getName() const =0
Sensed encoder ticks of the joint.
void setParameter(const bool parameter)
virtual void setMailboxMsgBuffer(const YouBotSlaveMailboxMsg &msgBuffer, const unsigned int jointNumber)=0
virtual ParameterType getType() const =0
unsigned int mailboxMsgRetries
Set-point velocity of the joint.
The torque set-point of the joint will be set by setting the computed current set-point.
Output part from the EtherCat message of the youBot EtherCat slaves.
virtual void setData(const JointDataSetpoint &data)
joint position limits in encoder ticks
void getUserVariable(const unsigned int index, int &data)
virtual void setConfigurationParameter(const JointParameter ¶meter)
void parseYouBotErrorFlags(const YouBotSlaveMsg &messageBuffer)
mailboxInputBuffer stctInput
This torque of the joint is computed from the actual current.
void storeConfigurationParameterPermanent(const YouBotJointParameter ¶meter)
joint position limits in radian
Sensed velocity of the joint.
mailboxOutputBuffer stctOutput
quantity< plane_angle > angle
unsigned int getJointNumber()
bool inverseMovementDirection
quantity< si::torque > torque
virtual void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg &message, const YouBotJointStorage &storage)=0
quantity< si::current > maxCurrent
unsigned int timeTillNextMailboxUpdate
Sensed rounds per minute (rpm) of the joint.
virtual ParameterType getType() const =0
virtual void getYouBotMailboxMsg(YouBotSlaveMailboxMsg &message, TMCLCommandNumber msgType, const YouBotJointStorage &storage) const =0
Joint parameter exception.
It monitors the joint position and will decelerate and stop the joint if it is close the limits...
the gear ratio which is needed for the calculations in the youBot driver
Sensed electric current of the joint.
void getParameter(double ¶meter) const
encoder ticks setpoint of the joint
YouBotJointStorage storage
EtherCAT mailbox message of the youBot slaves.
abstract youBot joint parameter
void setParameter(const double parameter)
SlaveMessageInput stctInput
std::string jointNumberStr
inverse the joint movement direction
quantity< si::angular_velocity > angularVelocity
#define SLEEP_MILLISEC(millisec)
void setUserVariable(const unsigned int index, const int data)
void getYouBotMailboxMsg(YouBotSlaveMailboxMsg &message, TMCLCommandNumber msgType, const YouBotJointStorage &storage) const
virtual void getMsgBuffer(const unsigned int jointNumber, YouBotSlaveMsg &returnMsg)=0
void setParameter(const int lowerLimit, const int upperLimit, const bool activateLimits)
virtual std::string getName() const =0
unsigned int encoderTicksPerRound
bool setValueToMotorContoller(const YouBotSlaveMailboxMsg &mailboxMsg)
virtual void getYouBotMailboxMsg(YouBotSlaveMailboxMsg &message, TMCLCommandNumber msgType, const YouBotJointStorage &storage) const =0
virtual void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg &message, const YouBotJointStorage &storage)=0
virtual void getStatus(std::vector< std::string > &statusMessages)
Returns the status messages for the motor controller.
quantity< si::torque > torque
abstract data class for commanded joint data
SlaveMessageOutput stctOutput
void restoreConfigurationParameter(YouBotJointParameter ¶meter)
Restores the joint parameter from the EEPROM.
std::string parameterName
virtual void registerJointLimitMonitor(JointLimitMonitor *object, const unsigned int JointNumber)=0
Set-point current of the joint.
quantity< si::current > current
#define USER_VARIABLE_BANK
boost::scoped_ptr< JointLimitMonitor > limitMonitor
CalibrationDirection calibrationDirection
abstract youBot joint parameter which can be read only
virtual void getData(JointData &data)
static EthercatMasterInterface & getInstance(const std::string configFile="youbot-ethercat.cfg", const std::string configFilePath="../config/", const bool ethercatMasterWithThread=true)
void setEncoderToZero()
set the encoder values of the joint to zero. This postion will be the new reference.
virtual bool isEtherCATConnectionEstablished()=0
quantity< si::current > current
abstract data class for joints
EtherCat message of the youBot EtherCat slaves.
EtherCAT Connection Error.
Sensed position / angle of the joint.
quantity< plane_angle > angle
YouBotJoint(const unsigned int jointNo, const std::string &configFilePath="../config/")
Set-point angle / position of the joint.
quantity< si::angular_velocity > angularVelocity
virtual bool getMailboxMsgBuffer(YouBotSlaveMailboxMsg &mailboxMsg, const unsigned int jointNumber)=0
Rounds per minute set-point of the joint.
void getParameter(quantity< angular_acceleration > ¶meter) const
void setParameter(const int controllerType, const std::string firmwareVersion)
Sensed velocity of the joint.