You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

58 lines
1.4 KiB

#include "SvrData.h"
bool SvrData::instanceFlag = false;
SvrData* SvrData::single = 0;
SvrData::SvrData(void)
{
velocity = 20;
accelaration = 10;
robot.joints = LBR_MNJ;
robot.max.velocity = new float[robot.joints];
robot.max.accelaration = new float[robot.joints];
robot.max.torque = new float[robot.joints];
robot.max.range = new float[robot.joints];
double maxVelJnt[] = {110.0,110.0,128.0,128.0,204.0,184.0,184.0};
double maxAccJnt[] = {1.0,1.0,1.0,1.0,2.0,1.0,1.0};
double maxTrqJnt[] = {176.0,176.0,100.0,100.0,100.0,38.0,38.0};
double maxRangeJnt[] = {170.0,120.0,170.0,120.0,170.0,120.0,170.0};
for (int i = 0; i < robot.joints; ++i)
{
robot.max.velocity[i] = maxVelJnt[i];
robot.max.accelaration[i] = maxAccJnt[i];
robot.max.torque[i] = maxTrqJnt[i];
robot.max.range[i] = maxRangeJnt[i];
}
}
SvrData::~SvrData()
{
if (robot.max.velocity != 0)
delete[] robot.max.velocity;
if (robot.max.accelaration != 0)
delete[] robot.max.accelaration;
if (robot.max.torque != 0)
delete[] robot.max.torque;
if (robot.max.velocity != 0)
delete[] robot.max.range;
robot.max.velocity = 0;
robot.max.accelaration = 0;
robot.max.torque = 0;
robot.max.range = 0;
}
SvrData* SvrData::getInstance ()
{
if (instanceFlag)
return single;
single = new SvrData();
instanceFlag = true;
return single;
}