Skip to content

Commit

Permalink
Update PidServer.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
madhephaestus authored Sep 25, 2018
1 parent 9947a1e commit 46b0f5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/coms/PidServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void PidServer::event(float * packet){
// The if statement below always returns false and therefore we never
// enter the clause. Is this code needed? If not, let's get rid of it.
float timeOfMotion = 0;
if(velocityTarget>0)
if(std::abs(velocityTarget)>0)
timeOfMotion=(std::abs(setpoint-position)/velocityTarget)*1000;// convert from Tics per second to miliseconds
// When polling for the current positon, we are passing down setpoints over and over. If the setpoint is already set we want to skip
// Bound function is checking the incoming value agains the previouslt set value
Expand Down

0 comments on commit 46b0f5c

Please sign in to comment.