moteus 0.3.67__tar.gz → 0.3.68__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.
- {moteus-0.3.67 → moteus-0.3.68}/PKG-INFO +1 -1
- {moteus-0.3.67 → moteus-0.3.68}/moteus/moteus.py +22 -14
- {moteus-0.3.67 → moteus-0.3.68}/moteus/moteus_tool.py +1 -5
- {moteus-0.3.67 → moteus-0.3.68}/moteus/version.py +1 -1
- {moteus-0.3.67 → moteus-0.3.68}/moteus.egg-info/PKG-INFO +1 -1
- {moteus-0.3.67 → moteus-0.3.68}/setup.py +1 -3
- {moteus-0.3.67 → moteus-0.3.68}/README.md +0 -0
- {moteus-0.3.67 → moteus-0.3.68}/moteus/__init__.py +0 -0
- {moteus-0.3.67 → moteus-0.3.68}/moteus/aioserial.py +0 -0
- {moteus-0.3.67 → moteus-0.3.68}/moteus/aiostream.py +0 -0
- {moteus-0.3.67 → moteus-0.3.68}/moteus/calibrate_encoder.py +0 -0
- {moteus-0.3.67 → moteus-0.3.68}/moteus/command.py +0 -0
- {moteus-0.3.67 → moteus-0.3.68}/moteus/export.py +0 -0
- {moteus-0.3.67 → moteus-0.3.68}/moteus/fdcanusb.py +0 -0
- {moteus-0.3.67 → moteus-0.3.68}/moteus/multiplex.py +0 -0
- {moteus-0.3.67 → moteus-0.3.68}/moteus/posix_aioserial.py +0 -0
- {moteus-0.3.67 → moteus-0.3.68}/moteus/pythoncan.py +0 -0
- {moteus-0.3.67 → moteus-0.3.68}/moteus/reader.py +0 -0
- {moteus-0.3.67 → moteus-0.3.68}/moteus/regression.py +0 -0
- {moteus-0.3.67 → moteus-0.3.68}/moteus/router.py +0 -0
- {moteus-0.3.67 → moteus-0.3.68}/moteus/transport.py +0 -0
- {moteus-0.3.67 → moteus-0.3.68}/moteus/win32_aioserial.py +0 -0
- {moteus-0.3.67 → moteus-0.3.68}/moteus.egg-info/SOURCES.txt +0 -0
- {moteus-0.3.67 → moteus-0.3.68}/moteus.egg-info/dependency_links.txt +0 -0
- {moteus-0.3.67 → moteus-0.3.68}/moteus.egg-info/entry_points.txt +0 -0
- {moteus-0.3.67 → moteus-0.3.68}/moteus.egg-info/requires.txt +0 -0
- {moteus-0.3.67 → moteus-0.3.68}/moteus.egg-info/top_level.txt +0 -0
- {moteus-0.3.67 → moteus-0.3.68}/setup.cfg +0 -0
@@ -619,6 +619,12 @@ class Controller:
|
|
619
619
|
self.transport = get_singleton_transport()
|
620
620
|
return self.transport
|
621
621
|
|
622
|
+
async def flush_transport(self):
|
623
|
+
try:
|
624
|
+
await asyncio.wait_for(self.transport.read(), 0.02)
|
625
|
+
except asyncio.TimeoutError:
|
626
|
+
pass
|
627
|
+
|
622
628
|
def _make_query_data(self, query_resolution=None):
|
623
629
|
if query_resolution is None:
|
624
630
|
query_resolution = self.query_resolution
|
@@ -761,7 +767,7 @@ class Controller:
|
|
761
767
|
async def set_stop(self, *args, **kwargs):
|
762
768
|
return await self.execute(self.make_stop(**kwargs))
|
763
769
|
|
764
|
-
def make_set_output(self,
|
770
|
+
def make_set_output(self, *args,
|
765
771
|
position=0.0,
|
766
772
|
query=False,
|
767
773
|
query_override=None,
|
@@ -770,6 +776,9 @@ class Controller:
|
|
770
776
|
"""Return a moteus.Command structure with data necessary to send a
|
771
777
|
set output nearest command."""
|
772
778
|
|
779
|
+
if len(args):
|
780
|
+
raise ValueError(f'unexpected positional arguments: {args}')
|
781
|
+
|
773
782
|
result = self._make_command(
|
774
783
|
query=query, query_override=query_override)
|
775
784
|
|
@@ -784,39 +793,42 @@ class Controller:
|
|
784
793
|
result.data = data_buf.getvalue()
|
785
794
|
return result
|
786
795
|
|
787
|
-
def make_set_output_nearest(self,
|
796
|
+
def make_set_output_nearest(self, *args,
|
788
797
|
position=0.0,
|
789
798
|
query=False,
|
790
799
|
query_override=None):
|
791
800
|
return self.make_set_output(
|
801
|
+
*args,
|
792
802
|
position=position, query=query, query_override=query_override,
|
793
803
|
cmd=Register.SET_OUTPUT_NEAREST)
|
794
804
|
|
795
|
-
def make_set_output_exact(self,
|
805
|
+
def make_set_output_exact(self, *args,
|
796
806
|
position=0.0,
|
797
807
|
query=False,
|
798
808
|
query_override=None):
|
799
809
|
return self.make_set_output(
|
810
|
+
*args,
|
800
811
|
position=position, query=query, query_override=query_override,
|
801
812
|
cmd=Register.SET_OUTPUT_EXACT)
|
802
813
|
|
803
814
|
async def set_output(self, *args, cmd=None, **kwargs):
|
804
|
-
return await self.execute(self.make_set_output(**kwargs, cmd=cmd))
|
815
|
+
return await self.execute(self.make_set_output(*args, **kwargs, cmd=cmd))
|
805
816
|
|
806
817
|
async def set_output_nearest(self, *args, **kwargs):
|
807
|
-
return await self.set_output(cmd=Register.SET_OUTPUT_NEAREST, **kwargs)
|
818
|
+
return await self.set_output(*args, cmd=Register.SET_OUTPUT_NEAREST, **kwargs)
|
808
819
|
|
809
820
|
async def set_output_exact(self, *args, **kwargs):
|
810
|
-
return await self.set_output(cmd=Register.SET_OUTPUT_EXACT, **kwargs)
|
821
|
+
return await self.set_output(*args, cmd=Register.SET_OUTPUT_EXACT, **kwargs)
|
811
822
|
|
812
823
|
|
813
824
|
# For backwards compatibility, "*_output_nearest" used to be named
|
814
825
|
# "make/set_rezero".
|
815
|
-
def make_rezero(self,
|
826
|
+
def make_rezero(self, *args,
|
816
827
|
rezero=0.0,
|
817
828
|
query=False,
|
818
829
|
query_override=None):
|
819
830
|
return self.make_set_output(
|
831
|
+
*args,
|
820
832
|
position=rezero, query=query, query_override=query_override,
|
821
833
|
cmd=Register.SET_OUTPUT_NEAREST)
|
822
834
|
|
@@ -1176,8 +1188,8 @@ class Controller:
|
|
1176
1188
|
|
1177
1189
|
combiner = mp.WriteCombiner(
|
1178
1190
|
writer, 0x00, int(Register.AUX1_GPIO_COMMAND), [
|
1179
|
-
mp.INT8 if aux1 else mp.IGNORE,
|
1180
|
-
mp.INT8 if aux2 else mp.IGNORE,
|
1191
|
+
mp.INT8 if aux1 is not None else mp.IGNORE,
|
1192
|
+
mp.INT8 if aux2 is not None else mp.IGNORE,
|
1181
1193
|
])
|
1182
1194
|
|
1183
1195
|
if combiner.maybe_write():
|
@@ -1355,11 +1367,7 @@ class Stream:
|
|
1355
1367
|
self._read_data = b''
|
1356
1368
|
|
1357
1369
|
# Now flush anything from the underlying transport if applicable.
|
1358
|
-
|
1359
|
-
await asyncio.wait_for(self.controller._get_transport().read(), 0.02)
|
1360
|
-
except asyncio.TimeoutError:
|
1361
|
-
# This is the expected path.
|
1362
|
-
pass
|
1370
|
+
await self.controller.flush_transport()
|
1363
1371
|
|
1364
1372
|
async def _read_maybe_empty_line(self):
|
1365
1373
|
while b'\n' not in self._read_data and b'\r' not in self._read_data:
|
@@ -951,16 +951,12 @@ class Stream:
|
|
951
951
|
if encoder_type == 4: # hall
|
952
952
|
hall_configured = True
|
953
953
|
|
954
|
-
if self.args.cal_hall:
|
954
|
+
if self.args.cal_hall or hall_configured:
|
955
955
|
if not hall_configured:
|
956
956
|
raise RuntimeError("--cal-hall specified, but hall sensors " +
|
957
957
|
"not configured on device")
|
958
958
|
return await self.calibrate_encoder_mapping_hall(encoder_cal_voltage)
|
959
959
|
else:
|
960
|
-
if hall_configured:
|
961
|
-
raise RuntimeError(
|
962
|
-
"Cannot perform encoder mapping with hall sensors, " +
|
963
|
-
"use --cal-hall")
|
964
960
|
try:
|
965
961
|
return await self.calibrate_encoder_mapping_absolute(encoder_cal_voltage)
|
966
962
|
except:
|
@@ -17,8 +17,6 @@
|
|
17
17
|
import setuptools
|
18
18
|
import pathlib
|
19
19
|
|
20
|
-
import moteus
|
21
|
-
|
22
20
|
here = pathlib.Path(__file__).parent.resolve()
|
23
21
|
|
24
22
|
# Get the long description from the README file
|
@@ -27,7 +25,7 @@ long_description = (here / 'README.md').read_text(encoding='utf-8')
|
|
27
25
|
|
28
26
|
setuptools.setup(
|
29
27
|
name = 'moteus',
|
30
|
-
version = "0.3.
|
28
|
+
version = "0.3.68",
|
31
29
|
description = 'moteus brushless controller library and tools',
|
32
30
|
long_description = long_description,
|
33
31
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|