Skip to content

Commit

Permalink
at least now i get updates on the pid page
Browse files Browse the repository at this point in the history
  • Loading branch information
Iris-TheRainbow committed Jun 20, 2024
1 parent eec8696 commit b9aebf2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions REVHubInterface/REVMotor.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def getMotorTargetVelocity(commObj, destination, motorChannel):


def setMotorTargetPosition(commObj, destination, motorChannel, position, atTargetTolerance):
print("set")
setMotorTargetPositionMsg = REVMsg.SetMotorTargetPosition()
setMotorTargetPositionMsg.payload.motorChannel = motorChannel
setMotorTargetPositionMsg.payload.position = position
Expand Down Expand Up @@ -221,6 +222,7 @@ def resetEncoder(self):
resetMotorEncoder(self.commObj, self.destinationModule, self.channel)

def setPower(self, powerLevel):
print("powerSet")
setMotorConstantPower(self.commObj, self.destinationModule, self.channel, powerLevel)

def getPower(self):
Expand All @@ -239,6 +241,7 @@ def getTargetVelocity(self):
return getMotorTargetVelocity(self.commObj, self.destinationModule, self.channel)

def setTargetPosition(self, position, tolerance):
print("set")
setMotorTargetPosition(self.commObj, self.destinationModule, self.channel, position, tolerance)

def getTargetPosition(self):
Expand Down
2 changes: 2 additions & 0 deletions REVHubInterface/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,8 @@ def updateMotorLabels(self, motorNumber, moduleNumber):
position = self.REVModules[int(moduleNumber)].motors[motorNumber].getPosition()
self.Motor_packs[moduleNumber * 4 + motorNumber].Motor_values.config(
text='Current (mA): %3d\n\nEncoder: %3d' % (current, position))
self.pid_packs[moduleNumber * 4 + motorNumber].pid_values.config(
text='Current (mA): %3d\n\nEncoder: %3d' % (current, position))

def servoSlider(self, pulse, moduleNumber, servoNumber, *args):
if servoNumber % 2 == 0:
Expand Down

0 comments on commit b9aebf2

Please sign in to comment.