Skip to content
This repository was archived by the owner on Dec 1, 2020. It is now read-only.

Commit 892ea97

Browse files
committed
added read after the initiation.
1 parent 89f60e4 commit 892ea97

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

march_hardware/src/odrive/odrive_motor.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ void OdriveMotor::prepareActuation()
4949
ROS_FATAL("Setting closed loop control was not finished successfully");
5050
return;
5151
}
52+
this->readValues();
5253
}
5354

5455
bool OdriveMotor::waitForIdleState(float timeout)
@@ -227,13 +228,14 @@ int OdriveMotor::getAngleCountsIncremental()
227228

228229
double OdriveMotor::getAngleRadIncremental()
229230
{
230-
double angle_rad = this->getAngleCountsIncremental() * PI_2 / (std::pow(2, 12) * 101);
231+
double angle_rad = this->getAngleCountsIncremental() * PI_2 / (std::pow(2, 12) * 101 * -1);
231232
return angle_rad;
232233
}
233234

234235
double OdriveMotor::getVelocityRadIncremental()
235236
{
236-
return this->velocity_rad_incremental;
237+
double velocity_rad_incremental_double = this->velocity_rad_incremental * -1;
238+
return velocity_rad_incremental_double;
237239
}
238240

239241
int OdriveMotor::setState(uint8_t state)

0 commit comments

Comments
 (0)