mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-08-18 18:04:12 +08:00
Squashed 'tools/odrive/pyfibre/' changes from f9ebfdd3..b00819a0
b00819a0 add fibre.cpp 09687c5a update libfibre API for better performance 50270add update binaries 9f1fffd0 support registering external discoverers 5783e8e9 support open-ended function calls in libfibre ABI 30498039 move gitattributes for LFS settings f779a895 Merge commit 'ca1f41bc7b3acabfa2924822b87a28726e75c5d5' as 'python' 0c229c4c remove old python folder 99cec00a Merge commit 'e345a021e39fd3d6ea56297e9c6c647e8d144992' as 'cpp' e345a021 Squashed 'cpp/' content from commit d7a5c366 7a40ccf0 remove old cpp folder 920a8fb4 reduce libfibre binary size 646d5ade make odrive.find_any work with no args 53a0f76a add finishing touches to initial libfibre version 11a86c7e Merge pull request #10 from RoCkaZ/master 2e2226f6 Only set new timeout if it is different from the old one dc2bea4a introduce codecs for serializing/deserializing 677f3686 Merge commit '5a7cad54ad0bed99edcdf19704d5116a9993caa6' into sam_fibre_upstreaming 1ada8977 TCP: keep alive fd46431e improve logging b9a249a2 fix timeout error code for macOS d9f0f539 remove install-time PySerial dependency and don't fail if installed as non-root d27ff81b printing format strings a75dce81 fix shell printing 1544230c clean up fiber port 25c2bb34 fix include paths, duplicated function in merge 3661fdaf Merge branch 'devel' into sam_fibre 55d50e97 Merge commit '496a9a945a8d8bbdda556a41f784cb30ebf6eeea' 7d2df781 add timeout to UDP transport 808f3f0c split protocol.hpp into more files a8931e85 Merge remote-tracking branch 'origin/master' e87ae1dd minor bugfixes 56ccd7c4 Merge commit '2e15116dc21a4ff859b906410dec8c797955c0ec' 565cd9d4 Merge commit 'd2ca264d0a3f7eab82498880a8a1929380e0ce75' 0996d4eb replace occurrences of the term protocol with fibre 719359ea add setup.py to publish fibre on PyPI 281af8c9 dont run Fibre tup rules by default Building the Fibre test binaries is distracting when it's just used as a library in another project. Now it is only built if CONFIG_BUILD_FIBRE_TESTS=true 8f08be86 allow setting interactive shell variables, fix some warnings 64999f82 move updated ODrive python protocol library to Fibre bc1a4555 fix function calls with arguments b34163f4 apply ODrive native protocol updates to fibre and switch to fibre 1ad444c1 update fibre readme to better reflect the current status 8f0d2678 compile with -Wall ab8a2f09 use universal references in for encoder and decoder construction 2c8e7b89 Merge branch 'master' into lowlevel 45a3514d Merge pull request #5 from samuelsadok/templated_endpoints 00c4a042 Refactor the way endpoint are defined. 5de6afa3 change CRC8 template types 36d501e7 implement selected encoders b0abce47 fix decoder bugs f6b95c96 Update README.md 4fb1eba0 Add a couple of decoders 2c0a62dd switch to TCP a2fb4a15 Merge commit '2dda07b9e31fe26d60b60e5a4b2495370a63e4fc' 2dda07b9 Squashed 'fibre/' changes from 74293c7..874cb53 e49db3b0 Merge branch 'master' of github.com:samuelsadok/lightd 874cb533 note about coding style 7e76ccf1 Merge pull request #2 from mbiegert/master 9061637b make udp server stack IPv6 aware 38044773 IPv6 in python --not-working cfc87be5 don't use recursion in tcp_transport.py 6d19cc2b target comments by @samuelsadok bee3128e remove tupfile and add TCP to compat list, also mv server to test 52b149ce fix abstract python function StreamSource::get_bytes c17e2d4b add tcp discovery to python client implementation 239d0630 server opens a thread for every incoming client connection 6b7cfa30 create test server on tcp instead of udp 2eddbb9a add tupfile for compiling 4aa16811 Add small test Server 62feaafd create rudimentary tcp implementation db8d11db Squashed 'fibre/' changes from 20bd0f2..74293c7 a88d5661 Merge commit 'db8d11db47aac77859720a794cf3d0c54ed11eaf' 74293c75 Merge branch 'lightd-changes' of github.com:samuelsadok/fibre 9b148486 fix size returned by read_le/write_le<uint8_t> 7b8f30d0 add reference to lightd 839c92a9 fix lights-off timer 06874f4f add systemd files and install script 0ee4b929 add readme 81a30238 minor python util fixes e31270be minor python util fixes 24b7f58d don't fail if python serial-module missing bb5b28b9 don't fail if python serial-module missing dbd1c799 add TOOLCHAIN var to tup 3677d800 add lightctl util 4d476b05 Squashed 'fibre/' changes from 09fbec9..20bd0f2 d206d6b9 Merge commit '4d476b05ef6400192a2edafab6449b25e53921e2' 20bd0f29 simplify addin python module inother projects 0d9b0ddb implement LED control service 163bc8e1 add gitignore 4b4af623 add rpi_ws281x library 69e92d1f Merge commit '5230fb499da4efbf8f5ab586a0398379573b5b37' as 'rpi_ws281x' 5230fb49 Squashed 'rpi_ws281x/' content from commit 3a01777 e99c592e Squashed 'fibre/' content from commit 09fbec9 419759d1 Merge commit 'e99c592e217595deee6765ff0ed7e25ca26f772e' as 'fibre' 4303df51 initial commit 09fbec97 initial commit git-subtree-dir: tools/odrive/pyfibre git-subtree-split: b00819a0098a1caa09077857c9728a11a195e108
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
libfibre*.so filter=lfs diff=lfs merge=lfs -text
|
||||
libfibre*.dll filter=lfs diff=lfs merge=lfs -text
|
||||
libfibre*.dylib filter=lfs diff=lfs merge=lfs -text
|
||||
@@ -0,0 +1,17 @@
|
||||
# PyFibre
|
||||
|
||||
This directory provides Python bindings for [Fibre](https://github.com/samuelsadok/fibre). Its home is located [here](https://github.com/samuelsadok/fibre/tree/master/python). There's also a standalone repository for this directory [here](https://github.com/samuelsadok/pyfibre).
|
||||
|
||||
## Current Status
|
||||
|
||||
Currently only client-side features are implemented, that means you can discover objects but you cannot publish objects.
|
||||
|
||||
## How to use
|
||||
|
||||
```python
|
||||
import fibre
|
||||
|
||||
with fibre.Domain("tcp-client:address=localhost,port=14220") as domain:
|
||||
obj = domain.discover_one()
|
||||
obj.test_function()
|
||||
```
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
|
||||
from .utils import Event, Logger, TimeoutError
|
||||
from .shell import launch_shell
|
||||
from .libfibre import find_all, find_any, ObjectLostError
|
||||
from .libfibre import Domain, ObjectLostError
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
+536
-168
File diff suppressed because it is too large
Load Diff
Executable
BIN
Binary file not shown.
+2
-1
@@ -58,6 +58,7 @@ def get_user_name(interactive_variables, obj):
|
||||
return "anonymous_remote_object_" + str(self._obj_handle)
|
||||
|
||||
def launch_shell(args,
|
||||
object_filter,
|
||||
interactive_variables,
|
||||
print_banner, print_help,
|
||||
logger, app_shutdown_token,
|
||||
@@ -77,7 +78,7 @@ def launch_shell(args,
|
||||
|
||||
# Connect to device
|
||||
logger.debug("Waiting for {}...".format(branding_long))
|
||||
fibre.find_all(args.path, args.serial_number,
|
||||
fibre.start_discovery(args.path, object_filter,
|
||||
lambda dev: did_discover_device(dev, interactive_variables, discovered_devices, branding_short, branding_long, logger, app_shutdown_token),
|
||||
app_shutdown_token,
|
||||
app_shutdown_token,
|
||||
|
||||
@@ -23,12 +23,6 @@ if sys.version_info < (3, 3):
|
||||
else:
|
||||
TimeoutError = TimeoutError
|
||||
|
||||
def get_serial_number_str(device):
|
||||
if hasattr(device, 'serial_number'):
|
||||
return format(device.serial_number, 'x').upper()
|
||||
else:
|
||||
return "[unknown serial number]"
|
||||
|
||||
## Threading utils ##
|
||||
class Event():
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user