moteus 0.3.55__tar.gz → 0.3.56__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. {moteus-0.3.55 → moteus-0.3.56}/PKG-INFO +1 -1
  2. {moteus-0.3.55 → moteus-0.3.56}/moteus/moteus_tool.py +16 -4
  3. {moteus-0.3.55 → moteus-0.3.56}/moteus/version.py +1 -1
  4. {moteus-0.3.55 → moteus-0.3.56}/moteus.egg-info/PKG-INFO +1 -1
  5. {moteus-0.3.55 → moteus-0.3.56}/setup.py +1 -1
  6. {moteus-0.3.55 → moteus-0.3.56}/README.md +0 -0
  7. {moteus-0.3.55 → moteus-0.3.56}/moteus/__init__.py +0 -0
  8. {moteus-0.3.55 → moteus-0.3.56}/moteus/aioserial.py +0 -0
  9. {moteus-0.3.55 → moteus-0.3.56}/moteus/aiostream.py +0 -0
  10. {moteus-0.3.55 → moteus-0.3.56}/moteus/calibrate_encoder.py +0 -0
  11. {moteus-0.3.55 → moteus-0.3.56}/moteus/command.py +0 -0
  12. {moteus-0.3.55 → moteus-0.3.56}/moteus/export.py +0 -0
  13. {moteus-0.3.55 → moteus-0.3.56}/moteus/fdcanusb.py +0 -0
  14. {moteus-0.3.55 → moteus-0.3.56}/moteus/moteus.py +0 -0
  15. {moteus-0.3.55 → moteus-0.3.56}/moteus/multiplex.py +0 -0
  16. {moteus-0.3.55 → moteus-0.3.56}/moteus/posix_aioserial.py +0 -0
  17. {moteus-0.3.55 → moteus-0.3.56}/moteus/pythoncan.py +0 -0
  18. {moteus-0.3.55 → moteus-0.3.56}/moteus/reader.py +0 -0
  19. {moteus-0.3.55 → moteus-0.3.56}/moteus/regression.py +0 -0
  20. {moteus-0.3.55 → moteus-0.3.56}/moteus/router.py +0 -0
  21. {moteus-0.3.55 → moteus-0.3.56}/moteus/transport.py +0 -0
  22. {moteus-0.3.55 → moteus-0.3.56}/moteus/win32_aioserial.py +0 -0
  23. {moteus-0.3.55 → moteus-0.3.56}/moteus.egg-info/SOURCES.txt +0 -0
  24. {moteus-0.3.55 → moteus-0.3.56}/moteus.egg-info/dependency_links.txt +0 -0
  25. {moteus-0.3.55 → moteus-0.3.56}/moteus.egg-info/entry_points.txt +0 -0
  26. {moteus-0.3.55 → moteus-0.3.56}/moteus.egg-info/requires.txt +0 -0
  27. {moteus-0.3.55 → moteus-0.3.56}/moteus.egg-info/top_level.txt +0 -0
  28. {moteus-0.3.55 → moteus-0.3.56}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: moteus
3
- Version: 0.3.55
3
+ Version: 0.3.56
4
4
  Summary: moteus brushless controller library and tools
5
5
  Home-page: https://github.com/mjbots/moteus
6
6
  Author: mjbots Robotic Systems
@@ -754,9 +754,13 @@ class Stream:
754
754
  if await self.is_config_supported("motor.unwrapped_position_scale"):
755
755
  unwrapped_position_scale = \
756
756
  await self.read_config_double("motor.unwrapped_position_scale")
757
+ motor_output_sign = 1.0
757
758
  elif await self.is_config_supported("motor_position.rotor_to_output_ratio"):
758
759
  unwrapped_position_scale = \
759
760
  await self.read_config_double("motor_position.rotor_to_output_ratio")
761
+ motor_output_sign = \
762
+ await self.read_config_double("motor_position.output.sign")
763
+
760
764
 
761
765
  if await self.is_config_supported("servo.pwm_rate_hz"):
762
766
  pwm_rate_hz = await self.read_config_double("servo.pwm_rate_hz")
@@ -820,7 +824,7 @@ class Stream:
820
824
  await self.check_for_fault()
821
825
 
822
826
  v_per_hz = await self.calibrate_kv_rating(
823
- input_V, unwrapped_position_scale)
827
+ input_V, unwrapped_position_scale, motor_output_sign)
824
828
  await self.check_for_fault()
825
829
 
826
830
  # Rezero the servo since we just spun it a lot.
@@ -852,7 +856,8 @@ class Stream:
852
856
  # We measure voltage to the center, not peak-to-peak, thus
853
857
  # the extra 0.5.
854
858
  'kv' : (0.5 * 60.0 / v_per_hz),
855
- 'unwrapped_position_scale' : unwrapped_position_scale
859
+ 'unwrapped_position_scale' : unwrapped_position_scale,
860
+ 'motor_position_output_sign' : motor_output_sign,
856
861
  }
857
862
 
858
863
  log_filename = f"moteus-cal-{device_info['serial_number']}-{now.strftime('%Y%m%dT%H%M%S.%f')}.log"
@@ -1306,7 +1311,8 @@ class Stream:
1306
1311
  print()
1307
1312
  return maybe_result
1308
1313
 
1309
- async def calibrate_kv_rating(self, input_V, unwrapped_position_scale):
1314
+ async def calibrate_kv_rating(self, input_V, unwrapped_position_scale,
1315
+ motor_output_sign):
1310
1316
  if self.args.cal_force_kv is None:
1311
1317
  print("Calculating Kv rating")
1312
1318
 
@@ -1333,11 +1339,17 @@ class Stream:
1333
1339
 
1334
1340
  geared_v_per_hz = 1.0 / _calculate_slope(voltages, speed_hzs)
1335
1341
 
1336
- v_per_hz = geared_v_per_hz * unwrapped_position_scale
1342
+ v_per_hz = (geared_v_per_hz *
1343
+ unwrapped_position_scale *
1344
+ motor_output_sign)
1337
1345
  print(f"v_per_hz (pre-gearbox)={v_per_hz}")
1338
1346
 
1339
1347
  await self.command(f"conf set servopos.position_min {original_position_min}")
1340
1348
  await self.command(f"conf set servopos.position_max {original_position_max}")
1349
+
1350
+ if v_per_hz < 0.0:
1351
+ raise RuntimeError(
1352
+ f"v_per_hz measured as negative ({v_per_hz}), something wrong")
1341
1353
  else:
1342
1354
  v_per_hz = (0.5 * 60 / self.args.cal_force_kv)
1343
1355
  print(f"Using forced Kv: {self.args.cal_force_kv} v_per_hz={v_per_hz}")
@@ -12,4 +12,4 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- VERSION="0.3.55"
15
+ VERSION="0.3.56"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: moteus
3
- Version: 0.3.55
3
+ Version: 0.3.56
4
4
  Summary: moteus brushless controller library and tools
5
5
  Home-page: https://github.com/mjbots/moteus
6
6
  Author: mjbots Robotic Systems
@@ -27,7 +27,7 @@ long_description = (here / 'README.md').read_text(encoding='utf-8')
27
27
 
28
28
  setuptools.setup(
29
29
  name = 'moteus',
30
- version = "0.3.55",
30
+ version = "0.3.56",
31
31
  description = 'moteus brushless controller library and tools',
32
32
  long_description = long_description,
33
33
  long_description_content_type = 'text/markdown',
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes