Skip to content
Browse files

Fixed move to position commands when used in conjunction with positio…

…n counter manipulations
  • Loading branch information...
1 parent 4761810 commit 9486489a9f3fc81229c204d00fc5cb7d63f62f08 @bmcdorman bmcdorman committed Feb 16, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/motors_p.cpp
View
2 src/motors_p.cpp
@@ -160,8 +160,8 @@ int Private::Motor::pidVelocity(port_t port) const
void Private::Motor::setPidGoalPos(port_t port, int pos)
{
Private::Kovan *kovan = Private::Kovan::instance();
- pos -= m_cleared[port];
port = fixPort(port);
+ pos += m_cleared[port];
kovan->enqueueCommand(createWriteCommand(goalPosLowRegisters[port], pos & 0x0000FFFF));
kovan->enqueueCommand(createWriteCommand(goalPosHighRegisters[port], (pos & 0xFFFF0000) >> 16));
}

0 comments on commit 9486489

Please sign in to comment.
Something went wrong with that request. Please try again.