Skip to content

Commit

Permalink
attempt to commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Iris-TheRainbow committed Jun 20, 2024
1 parent b9aebf2 commit 4a3c914
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions REVHubInterface/REVMotor.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def resetMotorEncoder(commObj, destination, motorChannel):


def setMotorConstantPower(commObj, destination, motorChannel, powerLevel):
raise Exception("tried to set power")
setMotorConstantPowerMsg = REVMsg.SetMotorConstantPower()
setMotorConstantPowerMsg.payload.motorChannel = motorChannel
setMotorConstantPowerMsg.payload.powerLevel = powerLevel
Expand Down Expand Up @@ -222,7 +223,7 @@ def resetEncoder(self):
resetMotorEncoder(self.commObj, self.destinationModule, self.channel)

def setPower(self, powerLevel):
print("powerSet")
raise Exception("Attempted to set Power")
setMotorConstantPower(self.commObj, self.destinationModule, self.channel, powerLevel)

def getPower(self):
Expand All @@ -241,7 +242,6 @@ 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 Expand Up @@ -290,6 +290,7 @@ def getBulkPIDData(self):
return getBulkPIDData(self.commObj, self.destinationModule, self.channel)

def init(self):
print("setPower")
self.setMode(0, 1)
self.setPower(0)
self.enable()
2 changes: 1 addition & 1 deletion REVHubInterface/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ def javaTargetEntry(self, motorNumber, moduleNumber, *args):
target = int(self.pid_packs[moduleNumber * 4 + motorNumber].Java_entry.get())
self.REVModules[moduleNumber].motors[motorNumber].setTargetPosition(target, 20)
self.REVModules[moduleNumber].motors[motorNumber].setMode(2, 1)
self.REVModules[moduleNumber].motors[motorNumber].setPower(1)
self.REVModules[moduleNumber].motors[motorNumber].setPower(float(32000))
self.repetitiveFunctions = [(lambda: self.send_all_KA())]
self.repetitiveFunctions.append((lambda: self.updateMotorLabels(motorNumber, moduleNumber)))
return True
Expand Down

0 comments on commit 4a3c914

Please sign in to comment.