Skip to content

Commit

Permalink
Limit calib v2
Browse files Browse the repository at this point in the history
  • Loading branch information
AyushKulk committed Oct 24, 2023
1 parent c732053 commit 19b8e8f
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions src/LimitCalib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,9 @@ int main() {
navtypes::Vectord<2> targetPosVec;
std::array<robot::types::motorid_t, 2> motorNames;

int i = 0;
for (const auto& runningMotor : encMotors) {
motorNames[i] = runningMotor.first;
targetPosVec[i] = runningMotor.second.stdPos;
i++;
for (int i = 0; i < encMotors.size(); i++) {
motorNames[i] = encMotors.at(i)->first;
targetPosVec[i] = encMotors.at(i)->second.stdPos;
}

// mess with putting the std Pos's in a vector to begin with
Expand All @@ -86,18 +84,12 @@ int main() {

JacobianVelController<2,2> controller([](Eigen::VectorXd x) { return x; }, {});

bool done = false;
while(!done) {
navtypes::Vectord<2> targetVel = profile.getCommand(currTime);
double d;
navtypes::Vectord<2> targetPos = controller.getCommand(currTime, targetVel, d);
i = 0;
for (const auto& element : sortedKeys) {
robot::setMotorPos(element, targetPos[i]);
i++;
}
if (i == sortedKeys.size()) {
done = true;
}
navtypes::Vectord<2> targetVel = profile.getCommand(currTime);
double d;
navtypes::Vectord<2> targetPos = controller.getCommand(currTime, targetVel, d);
int i = 0;
for (const auto& element : sortedKeys) {
robot::setMotorPos(element, targetPos[i]);
i++;
}
}

0 comments on commit 19b8e8f

Please sign in to comment.