Skip to content

Commit

Permalink
Merge pull request #97 from auscompgeek/fix-get-output
Browse files Browse the repository at this point in the history
MotController: Fix getMotorOutputPercent return type
  • Loading branch information
virtuald committed Jan 28, 2019
2 parents 667952a + 1b0e51a commit 19524b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gen/MotController_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ c_MotController_SetDemand:
elif mode in calc_modes:
self._target = demand0
else:
self.hal_data['value'] = demand0
self.hal_data['value'] = float(demand0)
for follower_id in self.hal_data['followers']:
hal_data['CAN'][follower_id]['value'] = self.hal_data['value']
Expand Down
2 changes: 2 additions & 0 deletions tests/test_talonsrx.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,8 @@ def test_basemotorcontroller_getMotionProfileTopLevelBufferCount(talon):


def test_basemotorcontroller_getMotorOutputPercent(talon, cdata):
talon.neutralOutput()
assert talon.getMotorOutputPercent() == 0.0
cdata["value"] = 2.2
assert talon.getMotorOutputPercent() == 2.2

Expand Down

0 comments on commit 19524b5

Please sign in to comment.