moteus 0.3.84__py3-none-any.whl → 0.3.85__py3-none-any.whl

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.
moteus/moteus_tool.py CHANGED
@@ -1428,8 +1428,6 @@ class Stream:
1428
1428
  async def calibrate_encoder_mapping_absolute(
1429
1429
  self, encoder_cal_voltage, encoder_cal_current, current_noise,
1430
1430
  unwrapped_position_scale):
1431
- await self.ensure_valid_theta(encoder_cal_voltage)
1432
-
1433
1431
  current_quality_factor = encoder_cal_current / current_noise
1434
1432
  use_current_for_quality = (
1435
1433
  current_quality_factor > CURRENT_QUALITY_MIN or
@@ -1437,23 +1435,30 @@ class Stream:
1437
1435
  use_current_for_firmware_version = self.firmware.version >= 0x010a
1438
1436
 
1439
1437
  use_current_calibration = (
1440
- use_current_for_quality and use_current_for_firmware_version)
1438
+ not self.args.cal_never_encoder_current_mode and (
1439
+ use_current_for_quality and use_current_for_firmware_version))
1441
1440
 
1442
1441
  if use_current_for_firmware_version and not use_current_for_quality:
1443
1442
  print(f"Using voltage mode calibration, current quality factor {current_quality_factor:.1f} < {CURRENT_QUALITY_MIN:.1f}")
1444
1443
 
1445
-
1446
1444
  old_motor_poles = None
1447
1445
 
1448
1446
  if use_current_calibration:
1449
1447
  old_motor_poles = await self.read_config_int("motor.poles")
1450
1448
  await self.command("conf set motor.poles 2")
1449
+
1450
+ # We have to check for a valid there here, because setting
1451
+ # the motor pole count will invalidate it.
1452
+ await self.ensure_valid_theta(encoder_cal_voltage)
1453
+
1451
1454
  await self.command(f"d pos nan 0 nan c{encoder_cal_current} b1")
1452
1455
  await asyncio.sleep(3.0)
1453
1456
 
1454
1457
  await self.write_message(
1455
1458
  (f"d cali i{encoder_cal_current} s{self.args.cal_ll_encoder_speed * unwrapped_position_scale}"))
1456
1459
  else:
1460
+ await self.ensure_valid_theta(encoder_cal_voltage)
1461
+
1457
1462
  await self.command(f"d pwm 0 {encoder_cal_voltage}")
1458
1463
  await asyncio.sleep(3.0)
1459
1464
 
@@ -1717,6 +1722,10 @@ class Stream:
1717
1722
  # current on low resistance / low inductance motors.
1718
1723
  break
1719
1724
  await self.command("d stop")
1725
+
1726
+ # Give a little bit of wait in case we had an error that
1727
+ # the above stop should clear.
1728
+ await asyncio.sleep(0.1)
1720
1729
  except moteus.CommandError as e:
1721
1730
  # It is possible this is an old firmware that does not
1722
1731
  # support inductance measurement.
@@ -2338,6 +2347,8 @@ async def async_main():
2338
2347
  help='write raw calibration data')
2339
2348
  parser.add_argument('--cal-force-encoder-current-mode', action='store_true',
2340
2349
  help='always use encoder current mode calibration if supported')
2350
+ parser.add_argument('--cal-never-encoder-current-mode', action='store_true',
2351
+ help='never use current mode calibration')
2341
2352
 
2342
2353
  args = parser.parse_args()
2343
2354
 
moteus/version.py CHANGED
@@ -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.84"
15
+ VERSION="0.3.85"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: moteus
3
- Version: 0.3.84
3
+ Version: 0.3.85
4
4
  Summary: moteus brushless controller library and tools
5
5
  Home-page: https://github.com/mjbots/moteus
6
6
  Author: mjbots Robotic Systems
@@ -6,7 +6,7 @@ moteus/command.py,sha256=UkOsbtkso6Oyex8CfbpAKpBNriik519ymxL86EZGkRs,1169
6
6
  moteus/export.py,sha256=XitBUuf4MDRIneXQSUptizIhZi2BdHyFO2Vo_2d2CFI,1742
7
7
  moteus/fdcanusb.py,sha256=7PrQiCTROY96gdT2zSZYU1bOCriw-I7H6NspaZpiEx4,7431
8
8
  moteus/moteus.py,sha256=vImSRBn6VEmoijD6hvrSRVxuv1_xVaEJU3F_3Wi6GiE,52498
9
- moteus/moteus_tool.py,sha256=ocKUSl7qc_O1DOwoj5UFx1Kaw5HkRPEhU_e-tftfmk4,97236
9
+ moteus/moteus_tool.py,sha256=kIKE7bp9iR6CF16plAymZwYDurA8w4Diw6V1oPln9QQ,97796
10
10
  moteus/multiplex.py,sha256=2tdNX5JSh21TOjN6N9LKribLQtVYyyYbXjzwXB64sfA,12119
11
11
  moteus/posix_aioserial.py,sha256=2oDrw8TBEwuEQjY41g9rHeuFeffcPHqMwNS3nf5NVq8,3137
12
12
  moteus/pythoncan.py,sha256=M5Qba3aCzO_GyXcIsLJxjw3NrPgUk4CUnHOQIhQeIb0,4786
@@ -14,10 +14,10 @@ moteus/reader.py,sha256=9i1-h4aGd4syfqtWJcpg70Bl-bmunkGU4FmXmOLyRt8,12121
14
14
  moteus/regression.py,sha256=M5gjDBYJQ64iBXIrvBhMkD8TYhtlnQ85x8U4py0niGA,1196
15
15
  moteus/router.py,sha256=501W5GZ12rFoc1lmcH3S7IYsoc-Q_-FJ4B3i37RzE3Q,2061
16
16
  moteus/transport.py,sha256=WhkW2G9i25lkOlO55eI5_oXmU0PhDmxTeJ75Sg_7nTI,1021
17
- moteus/version.py,sha256=SIOoh1lHjcFFVldtp79E9rmBXUk63cDry1gjgxqOQ14,627
17
+ moteus/version.py,sha256=zZmPsYWAk-TzbzPFCbJiIizP_0N6OWfve42dp65rxmU,627
18
18
  moteus/win32_aioserial.py,sha256=culdl-vYxBKD5n2s5LkIMGyUaHyCcEc8BL5-DWEaxX8,2025
19
- moteus-0.3.84.dist-info/METADATA,sha256=okhSG2P2nrnQPSoq_F4-4t79_4KVrRCOZat5etq3gAg,3441
20
- moteus-0.3.84.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
21
- moteus-0.3.84.dist-info/entry_points.txt,sha256=accRcwir_K8wCf7i3qHb5R6CPh5SiSgd5a1A92ibb9E,56
22
- moteus-0.3.84.dist-info/top_level.txt,sha256=aZzmI_yecTaDrdSp29pTJuowaSQ9dlIZheQpshGg4YQ,7
23
- moteus-0.3.84.dist-info/RECORD,,
19
+ moteus-0.3.85.dist-info/METADATA,sha256=AVQrOY-x3zjIEDGKb0G4rZxPQj73iIE3nKTpswZmWSY,3441
20
+ moteus-0.3.85.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
21
+ moteus-0.3.85.dist-info/entry_points.txt,sha256=accRcwir_K8wCf7i3qHb5R6CPh5SiSgd5a1A92ibb9E,56
22
+ moteus-0.3.85.dist-info/top_level.txt,sha256=aZzmI_yecTaDrdSp29pTJuowaSQ9dlIZheQpshGg4YQ,7
23
+ moteus-0.3.85.dist-info/RECORD,,