Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…n counter manipulations
  • Loading branch information...
commit 9486489a9f3fc81229c204d00fc5cb7d63f62f08 1 parent 4761810
@bmcdorman bmcdorman authored
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));
}
Please sign in to comment.
Something went wrong with that request. Please try again.