diff --git a/lwrserv/SvrData.cpp b/lwrserv/SvrData.cpp index 5a7e522..dc4e10b 100644 --- a/lwrserv/SvrData.cpp +++ b/lwrserv/SvrData.cpp @@ -257,6 +257,8 @@ VecJoint SvrData::getRobotVelocity() pthread_mutex_lock(&dataLock); percent = robot.currentVelocityPercentage / 100.0f; + std::cout << "percent " << percent << " velo " << retval; + std::cout << robot.max.velocity << "max velo \n"; retval = robot.max.velocity * percent; pthread_mutex_unlock(&dataLock); return retval; diff --git a/lwrserv/SvrHandling.cpp b/lwrserv/SvrHandling.cpp index 2ce5368..028a5df 100755 --- a/lwrserv/SvrHandling.cpp +++ b/lwrserv/SvrHandling.cpp @@ -709,8 +709,8 @@ void moveHomRowWiseStatus(SocketObject& client, string& arg) // calculate trajectory VecJoint prevJointPos = SvrData::getInstance()->getCommandedJointPos(); float sampleTimeMs = SvrData::getInstance()->getSampleTimeMs(); - VecJoint maxJointVelocity = SvrData::getInstance()->getMaxVelocity(); - VecJoint maxJointAcceleration = SvrData::getInstance()->getMaxAcceleration(); + VecJoint maxJointVelocity = SvrData::getInstance()->getRobotVelocity(); + VecJoint maxJointAcceleration = SvrData::getInstance()->getRobotAcceleration(); class Trajectory* newTrajectory = new LinearJointTrajectory(sampleTimeMs, maxJointVelocity, maxJointAcceleration, prevJointPos, newJointPos); diff --git a/lwrserv/include/LinearTrajectory.h b/lwrserv/include/LinearTrajectory.h index 8acba6c..0e0aa66 100644 --- a/lwrserv/include/LinearTrajectory.h +++ b/lwrserv/include/LinearTrajectory.h @@ -22,6 +22,7 @@ class LinearJointTrajectory : public Trajectory // calculate maximum velocity and acceleration Vec maxJointLocalVelocity = maxJointVelocity * (sampleTimeMs / MStoSec); Vec maxJointLocalAcceleration = maxJointAcceleration * (sampleTimeMs / MStoSec); + std::cout << "max : " << maxJointLocalVelocity << "\n"; // calculate delta movement Vec jointMovement = jointEnd - jointStart; @@ -31,7 +32,10 @@ class LinearJointTrajectory : public Trajectory // calculate number of movement steps Vec minStepsPerJoint = jointMovementAbs.celldivide(maxJointLocalVelocity); + std::cout << "minsteps : " << minStepsPerJoint << "\n"; + std::cout << "steps : " << minStepsPerJoint.max() << "\n"; this->steps = ceil(minStepsPerJoint.max()); + std::cout << "steps : " << this->steps << "\n"; if (this->steps == 0) this->steps +=1; diff --git a/lwrserv/include/vec.h b/lwrserv/include/vec.h index 0cf5917..b078269 100644 --- a/lwrserv/include/vec.h +++ b/lwrserv/include/vec.h @@ -165,10 +165,10 @@ public: Vec operator * (T tScale) { - T atBuffer[SIZE]; + Vec vec; for (unsigned int i=0; i (atBuffer); + vec(i) = m_atData[i]*tScale; + return vec; } Vec operator * (const Mat &mat) diff --git a/lwrserv/program.cpp b/lwrserv/program.cpp index abc7387..6261746 100644 --- a/lwrserv/program.cpp +++ b/lwrserv/program.cpp @@ -215,7 +215,6 @@ void *threadRobotMovement(void *arg) { // mark that we reached the end of the trajectory // stay on current position - cout << "end of trajectorys \n"; goto end; } else