Skip to content

Commit

Permalink
fakeMotionControl and tests fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Randazzo authored and randaz81 committed Nov 22, 2023
1 parent 1ba2181 commit fa1ba18
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/devices/fakeMotionControl/fakeMotionControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3165,7 +3165,8 @@ bool FakeMotionControl::getNumberOfMotorsRaw(int* num)

bool FakeMotionControl::getTemperatureRaw(int m, double* val)
{
return NOT_YET_IMPLEMENTED("getTemperatureRaw");
*val = 37.5+double(m);
return true;
}

bool FakeMotionControl::getTemperaturesRaw(double *vals)
Expand Down
6 changes: 3 additions & 3 deletions src/libYARP_dev/src/yarp/dev/tests/IMotorTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ namespace yarp::dev::tests
int axis=0;
bool b = false;
double val=0;
double res=0;
double vals[2] = {0,0};

b = imot->getNumberOfMotors(&axis);
CHECK(b);
REQUIRE(axis > 0);
auto vals = std::vector<double>(axis);

b = imot->getGearboxRatio(0, &val);
CHECK(b);
Expand All @@ -48,7 +48,7 @@ namespace yarp::dev::tests
b = imot->getTemperatureLimit(0, &val);
CHECK(b);

b = imot->getTemperatures(vals);
b = imot->getTemperatures(vals.data());
CHECK(b);
}
}
Expand Down

0 comments on commit fa1ba18

Please sign in to comment.