anki / vector-python-sdk Goto Github PK
View Code? Open in Web Editor NEWAnki Vector Python SDK
License: Other
Anki Vector Python SDK
License: Other
This SDK should have an authentication option for auth'ing through Escape Pod, for those users who are pointing to Escape Pod and want their connections to run directly through the Pi.
The freeplay mode in the remote control app attempts to use what I think is an old API for requesting and releasing control of Vector. Because that API is no longer supported, an error is printed whenever the freeplay mode is toggled.
TypeError: request_control() got an unexpected keyword argument 'enable'
Hi, I am learning gRPC and I find vector-python-sdk a great example using gRPC.
grpcio/aiogrpc supports cancellation for sync/async client, https://github.com/grpc/grpc/tree/master/examples/python/cancellation , Is there any consideration preferring CancelActionByIdTagRequest over the grpcio's builtin cancellation function?
I get this error when my scripts ends. I thought it was my own bad code at first (naturally) but I've just tested it on the beginners scripts 01_hello_world.py and I am getting the same error. Is there something I am doing wrong? I have gotten away with having to learn all about asyncio up until this point, was I supposed to use it all along? I've reinstalled the SDK twice i am unsure what else to do.
Here is what my console is regurgitating:
future: <Future finished exception=<_MultiThreadedRendezvous of RPC that terminated with:
status = StatusCode.CANCELLED
details = "Channel closed!"
debug_error_string = "{"created":"@1580249711.758000000","description":"Error received from peer ipv4:<robot's I.P.>","file":"src/core/lib/surface/call.cc","file_line":1056,"grpc_message":"Channel closed!","grpc_status":1}"
More insight:
I'm using VSCode...
Tested with IDLE there is no error whatsoever!?
Maybe its a VSCode issue somehow?
I'd appreciate any advice on this. I am very new to python development so if its something simple I apologise I've tried to look it up with not very helpful results.
I test the following script on Ubuntu18.04 with Python version 3.6.8.
from the ios app I can see the Vector's firmware version is 1.3.0.2510
from pip3 freeze I can see the sdk version is uptodate "anki-vector==0.6.0"
import anki_vector
def main():
args = anki_vector.util.parse_command_args()
with anki_vector.Robot() as robot:
robot.say_text("Hello")
if __name__ == "__main__":
main()
error:
11:07:01.558 robot.Robot WARNING No serial number or name provided. Automatically selecting 0090416a
11:07:01.560 connection.Connection INFO Connecting to 192.168.0.100:443 for Vector-P4E1 using /home/hyan/.anki_vector/Vector-P4E1-0090416a.cert
11:07:02.058 connection.Connection INFO BehaviorControl control_granted_response { }
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/anki_vector/connection.py", line 749, in log_handler
result = await func(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/anki_vector/animation.py", line 191, in load_animation_trigger_list
return await self._load_animation_trigger_list()
File "/usr/local/lib/python3.6/dist-packages/anki_vector/animation.py", line 141, in _load_animation_trigger_list
result = await self.grpc_interface.ListAnimationTriggers(req)
File "/usr/local/lib/python3.6/dist-packages/aiogrpc/channel.py", line 40, in __call__
return await fut
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
status = StatusCode.UNIMPLEMENTED
details = "unknown method ListAnimationTriggers"
debug_error_string = "{"created":"@1566616023.372967889","description":"Error received from peer ipv4:192.168.0.100:443","file":"src/core/lib/surface/call.cc","file_line":1052,"grpc_message":"unknown method ListAnimationTriggers","grpc_status":12}"
>
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "say_text.py", line 8, in <module>
main()
File "say_text.py", line 5, in main
with anki_vector.Robot() as robot:
File "/usr/local/lib/python3.6/dist-packages/anki_vector/robot.py", line 742, in __enter__
self.connect(self.behavior_activation_timeout)
File "/usr/local/lib/python3.6/dist-packages/anki_vector/robot.py", line 666, in connect
anim_trigger_request = self._anim.load_animation_trigger_list()
File "/usr/local/lib/python3.6/dist-packages/anki_vector/connection.py", line 806, in result
return future.result()
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 432, in result
return self.__get_result()
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
File "/usr/local/lib/python3.6/dist-packages/anki_vector/connection.py", line 751, in log_handler
raise connection_error(rpc_error) from rpc_error
anki_vector.exceptions.VectorUnimplementedException: StatusCode.UNIMPLEMENTED: unknown method ListAnimationTriggers
Vector does not handle this message.
Mac OSX Mojave
No install warnings.
running ./3d_viewer.py shows camera viewer and 3d Vector Visualiser windows but Vizualizer is black screen.
Have run
python3 -m pip install --user "anki_vector[3dviewer]"
Andrews-MacBook-Pro-181:3d_viewer ge-hall$ python3 -m pip install --user "anki_vector[3dviewer]"
Requirement already satisfied: anki_vector[3dviewer] in /Users/ge-hall/Library/Python/3.7/lib/python/site-packages (0.5.1)
Requirement already satisfied: numpy>=1.11 in /Users/ge-hall/Library/Python/3.7/lib/python/site-packages (from anki_vector[3dviewer]) (1.15.4)
Requirement already satisfied: Pillow>=3.3 in /Users/ge-hall/Library/Python/3.7/lib/python/site-packages (from anki_vector[3dviewer]) (5.3.0)
Requirement already satisfied: googleapis-common-protos in /Users/ge-hall/Library/Python/3.7/lib/python/site-packages (from anki_vector[3dviewer]) (1.5.5)
Requirement already satisfied: requests in /Users/ge-hall/Library/Python/3.7/lib/python/site-packages (from anki_vector[3dviewer]) (2.21.0)
Requirement already satisfied: cryptography in /Users/ge-hall/Library/Python/3.7/lib/python/site-packages (from anki_vector[3dviewer]) (2.4.2)
Requirement already satisfied: opencv-python>=3.4 in /Users/ge-hall/Library/Python/3.7/lib/python/site-packages (from anki_vector[3dviewer]) (3.4.4.19)
Requirement already satisfied: aiogrpc>=1.4 in /Users/ge-hall/Library/Python/3.7/lib/python/site-packages (from anki_vector[3dviewer]) (1.5)
Requirement already satisfied: flask in /Users/ge-hall/Library/Python/3.7/lib/python/site-packages (from anki_vector[3dviewer]) (1.0.2)
Requirement already satisfied: PyOpenGL>=3.1; extra == "3dviewer" in /Users/ge-hall/Library/Python/3.7/lib/python/site-packages (from anki_vector[3dviewer]) (3.1.0)
Requirement already satisfied: protobuf>=3.0.0 in /Users/ge-hall/Library/Python/3.7/lib/python/site-packages (from googleapis-common-protos->anki_vector[3dviewer]) (3.6.1)
Requirement already satisfied: certifi>=2017.4.17 in /Users/ge-hall/Library/Python/3.7/lib/python/site-packages (from requests->anki_vector[3dviewer]) (2018.11.29)
Requirement already satisfied: idna<2.9,>=2.5 in /Users/ge-hall/Library/Python/3.7/lib/python/site-packages (from requests->anki_vector[3dviewer]) (2.8)
Requirement already satisfied: urllib3<1.25,>=1.21.1 in /Users/ge-hall/Library/Python/3.7/lib/python/site-packages (from requests->anki_vector[3dviewer]) (1.24.1)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Users/ge-hall/Library/Python/3.7/lib/python/site-packages (from requests->anki_vector[3dviewer]) (3.0.4)
Requirement already satisfied: cffi!=1.11.3,>=1.7 in /Users/ge-hall/Library/Python/3.7/lib/python/site-packages (from cryptography->anki_vector[3dviewer]) (1.11.5)
Requirement already satisfied: six>=1.4.1 in /Users/ge-hall/Library/Python/3.7/lib/python/site-packages (from cryptography->anki_vector[3dviewer]) (1.12.0)
Requirement already satisfied: asn1crypto>=0.21.0 in /Users/ge-hall/Library/Python/3.7/lib/python/site-packages (from cryptography->anki_vector[3dviewer]) (0.24.0)
Requirement already satisfied: grpcio>=1.12.0 in /Users/ge-hall/Library/Python/3.7/lib/python/site-packages (from aiogrpc>=1.4->anki_vector[3dviewer]) (1.17.0)
Requirement already satisfied: click>=5.1 in /Users/ge-hall/Library/Python/3.7/lib/python/site-packages (from flask->anki_vector[3dviewer]) (7.0)
Requirement already satisfied: Jinja2>=2.10 in /Users/ge-hall/Library/Python/3.7/lib/python/site-packages (from flask->anki_vector[3dviewer]) (2.10)
Requirement already satisfied: Werkzeug>=0.14 in /Users/ge-hall/Library/Python/3.7/lib/python/site-packages (from flask->anki_vector[3dviewer]) (0.14.1)
Requirement already satisfied: itsdangerous>=0.24 in /Users/ge-hall/Library/Python/3.7/lib/python/site-packages (from flask->anki_vector[3dviewer]) (1.1.0)
Requirement already satisfied: setuptools in /usr/local/lib/python3.7/site-packages (from protobuf>=3.0.0->googleapis-common-protos->anki_vector[3dviewer]) (40.5.0)
Requirement already satisfied: pycparser in /Users/ge-hall/Library/Python/3.7/lib/python/site-packages (from cffi!=1.11.3,>=1.7->cryptography->anki_vector[3dviewer]) (2.19)
Requirement already satisfied: MarkupSafe>=0.23 in /Users/ge-hall/Library/Python/3.7/lib/python/site-packages (from Jinja2>=2.10->flask->anki_vector[3dviewer]) (1.1.0)
I am using the Anki Vector SDK for Python on Python 3.8 64bit Windows, and every time that the context manager exits, regardless of the status of my Vector robot, the SDK raises a CancelledError
from asyncio
.
This happens even when running the examples. I'm wondering if there is a workaround? I am programming synchronously currently.
I run the SDK example 06_face_image and get Error 914 (NO_ENGINE_PROCESS | Vic-engine stopped unexpectedly.) (https://support.digitaldreamlabs.com/article/96-vector-status-codes). Clean fork, examples 1-5 seem to work just fine so far
Output:
PS C:\Users\Robin\Documents\GitHub\vector-python-sdk> & C:/Users/Robin/AppData/Local/Microsoft/WindowsApps/python3.9.exe c:/Users/Robin/Documents/GitHub/vector-python-sdk/examples/tutorials/06_face_image.py
17:22:52.091 connection.Connection INFO BehaviorControl control_granted_response { }
17:22:52.558 events.EventHandler WARNING Unknown Event type
17:22:52.559 events.EventHandler WARNING Unknown Event type
17:22:52.566 events.EventHandler WARNING Unknown Event type
17:22:52.983 events.EventHandler WARNING Unknown Event type
17:22:53.381 events.EventHandler WARNING Unknown Event type
17:22:53.805 events.EventHandler WARNING Unknown Event type
Display image on Vector's face...
17:22:54.166 events.EventHandler WARNING Unknown Event type
anext grpc exception
Traceback (most recent call last):
File "C:\Users\Robin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\aiogrpc\utils.py", line 145, in cb
fut.result()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\concurrent\futures\thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "C:\Users\Robin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\aiogrpc\utils.py", line 131, in _next
return next(self._iterator)
File "C:\Users\Robin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\grpc_channel.py", line 475, in next
return self._next()
File "C:\Users\Robin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\grpc_channel.py", line 881, in _next
raise self
grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "End of TCP stream"
debug_error_string = "UNKNOWN:Error received from peer ipv4:192.168.0.20:443 {created_time:"2023-04-05T21:22:56.416310418+00:00", grpc_status:14, grpc_message:"End of TCP stream"}"
anext grpc exception
Traceback (most recent call last):
File "C:\Users\Robin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\aiogrpc\utils.py", line 145, in cb
fut.result()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\concurrent\futures\thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "C:\Users\Robin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\aiogrpc\utils.py", line 131, in _next
return next(self._iterator)
File "C:\Users\Robin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\grpc_channel.py", line 475, in next
return self._next()
File "C:\Users\Robin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\grpc_channel.py", line 881, in _next
raise self
grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "End of TCP stream"
debug_error_string = "UNKNOWN:Error received from peer ipv4:192.168.0.20:443 {created_time:"2023-04-05T21:22:56.416748527+00:00", grpc_status:14, grpc_message:"End of TCP stream"}"
Traceback (most recent call last):
File "C:\Users\Robin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\anki_vector\connection.py", line 749, in log_handler
result = await func(*args, **kwargs)
File "C:\Users\Robin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\anki_vector\world.py", line 466, in delete_custom_objects
last_blocking_call = await self.grpc_interface.DeleteCustomObjects(req)
File "C:\Users\Robin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\aiogrpc\channel.py", line 40, in call
return await fut
grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "failed to connect to all addresses; last error: UNAVAILABLE: ipv4:192.168.0.20:443: WSA Error"
debug_error_string = "UNKNOWN:failed to connect to all addresses; last error: UNAVAILABLE: ipv4:192.168.0.20:443: WSA Error {grpc_status:14, created_time:"2023-04-05T21:23:00.718482033+00:00"}"
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "c:\Users\Robin\Documents\GitHub\vector-python-sdk\examples\tutorials\06_face_image.py", line 57, in
main()
File "c:\Users\Robin\Documents\GitHub\vector-python-sdk\examples\tutorials\06_face_image.py", line 53, in main
time.sleep(duration_s)
File "C:\Users\Robin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\anki_vector\robot.py", line 746, in exit
self.disconnect()
File "C:\Users\Robin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\anki_vector\robot.py", line 733, in disconnect
self.world.close()
File "C:\Users\Robin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\anki_vector\world.py", line 285, in close
self.delete_custom_objects()
File "C:\Users\Robin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\anki_vector\connection.py", line 806, in result
return future.result()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\concurrent\futures_base.py", line 446, in result
return self.__get_result()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\concurrent\futures_base.py", line 391, in __get_result
raise self._exception
File "C:\Users\Robin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\anki_vector\connection.py", line 751, in log_handler
raise connection_error(rpc_error) from rpc_error
anki_vector.exceptions.VectorUnavailableException: StatusCode.UNAVAILABLE: failed to connect to all addresses; last error: UNAVAILABLE: ipv4:192.168.0.20:443: WSA Error
Unable to reach Vector.
Even though I purchased a vector over the holidays (amazon), I never got around to making an Anki account with the company. Because of that, I can't seem to authenticate (no username and password - never had one)
There still seems to be a fun of python programming to be had with this little guy...
In line 942 of behavior.py the variable connection.CONTROL_PRIORITY_LEVEL.RESERVE_CONTROL
does not exist. The executable anki_vector.reserve_control
and function anki_vector.behavior.ReserveBehaviorControl()
fail with an exception, but run correctly if connection.ControlPriorityLevel.RESERVE_CONTROL
is substituted.
Hi devs,
First off, super super fantastic sdk thus far. It's the cleanest code I get to work with, and I love how absolutely consistent it is across the board.
Second, I'm working on a side project with the Vector for the next couple of months, and I would love to contribute upstream. It seems like this library is still needing some fleshing out that tends to come from people using it for purposes not originally intended by the authors, so I'd like to be part of the solution.
My first problem I've encountered:
How do I move in reverse? I see a reference to moving in reverse in the behavior.py motion profile map. I also see it in the protobuf defs. However, it doesn't seem actually usable.
Proposal 1:
robot.behavior.drive_straight(
distance=Distance(distance_mm= - 100)
speed=Speed(speed_mmps=70)
)
Proposal 2:
robot.behavior.drive_straight(
distance=Distance(distance_mm=100)
speed=Speed(speed_mmps= - 70)
)
Proposal 3:
robot.behavior.drive_straight(
distance=Distance(distance_mm=100)
speed=Speed(speed_mmps=70),
reverse=True
)
My initial thought is that "Proposal 2" would fit best with the paradigm of 'velocity' having to do with direction, but with that in mind, might be confusing to newcomers, in which case reverse=True would be ideal.
Either way, let me know where I can help contribute to the sdk. Cheers!
As of 3.10, the *loop* parameter was removed from Event() since it is no longer necessary
I get this error in any sdk example only with Python 3.10. The previous versions work.
Is it a mistake on my side or just a missing udpate?
If it is a missing update for the newer Python version, are there any plans of it being fixed in the near future?
I tried running the interactive shell on a headless raspberry pi and there was a traceback because we couldn't start up Tk for some gui element. There's no way this should happen based on the code I was running. We should be able to use the app on a headless display unless we're explicitly requesting some action that requires a visual desktop.
I'm just starting to learn python (3.8.1) and using the Vector SDK.
Every call I make to anki_vector.Robot produces the same error response. For instance running the sample 02_drive_square.py exactly as it is. It works fine - Vector drives in a square. But always the program seems to crash out on the last command:
Traceback ....
robot.behavior.turn_in_place(degrees(90))
....
File "C:\Program Files (x86)\Python\Python38-32\lib\concurrent\futures_base.py", line 437, in result
raise CancelledError()
concurrent.futures._base.CancelledError
I can provide the full code if that would be helpful.
Malcolm
I'm getting a "Value not ready" exception when trying to run any script in the examples. The vector robot is on the same network as my laptop and I can ping it.
The exception is as follows:
/opt/vector-python-sdk/examples/apps/interactive_shell# python3 interactive_shell.py
2018-12-19 08:15:54,179 anki_vector.robot.Robot WARNING No serial number provided. Automatically selecting XXXXXXXX
2018-12-19 08:15:54,183 anki_vector.connection.Connection INFO Connecting to 192.168.43.16:443 for Vector-XXXX using /root/.anki_vector/Vector-XXXX-XXXXXXXX.cert
2018-12-19 08:15:54,713 anki_vector.connection.Connection INFO control_granted_response {
}
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
/opt/vector-python-sdk/examples/apps/interactive_shell/interactive_shell.py in <module>
53 with anki_vector.Robot(args.serial,
54 enable_camera_feed=True,
---> 55 show_viewer=True) as robot:
56 # Invoke the ipython shell while connected to Vector
57 ipyshell(usage)
/usr/local/lib/python3.6/dist-packages/anki_vector/robot.py in __enter__(self)
766
767 def __enter__(self):
--> 768 self.connect(self.behavior_activation_timeout)
769 return self
770
/usr/local/lib/python3.6/dist-packages/anki_vector/robot.py in connect(self, timeout)
727
728 # access the pose to prove it has gotten back from the event stream once.
--> 729 while not self.pose:
730 pass
731
/usr/local/lib/python3.6/dist-packages/anki_vector/util.py in wrapped(*args, **kwargs)
104 iterations += 1
105 if iterations > max_iterations:
--> 106 raise Exception("Value not ready")
107 result = func(*args, **kwargs)
108 return result
Exception: Value not ready
File "/anaconda3/lib/python3.7/wave.py", line 510, in open
return Wave_read(f)
File "/anaconda3/lib/python3.7/wave.py", line 164, in init
self.initfp(f)
File "/anaconda3/lib/python3.7/wave.py", line 144, in initfp
self._read_fmt_chunk(chunk)
File "/anaconda3/lib/python3.7/wave.py", line 269, in _read_fmt_chunk
raise Error('unknown format: %r' % (wFormatTag,))
wave.Error: unknown format: 65534
Does Vector API can add custom functions with voice command. Like I want to add a custom function called "light the cube", then I want to control with the voice "hey vector, light the cube". Any ideas to add the voice command into the SDK? Many thanks.
When I run this function
robot.screen.set_screen_to_color(anki_vector.color.Color(rgb=[255, 0, 255]), duration_sec=10.0)
The screen color doesn't last 10 seconds. The duration changes a little based on the chosen color.
Every tutorial I try running produces the following:
C:\Users\reidsy\Documents\vector-python-sdk-master\vector-python-sdk-master\examples\tutorials>py 01_hello_world.py
21:18:53.926 robot.Robot WARNING No serial number or name provided. Automatically selecting 00803473
21:18:53.942 connection.Connection INFO Connecting to 192.168.1.18:443 for Vector-C7T5 using C:\Users\reidsy.anki_vector\Vector-C7T5-00803473.cert
21:19:00.261 connection.Connection INFO BehaviorControl control_granted_response { }
Traceback (most recent call last):
File "C:\Users\reidsy\AppData\Roaming\Python\Python36\site-packages\anki_vector\connection.py", line 749, in log_handler
result = await func(*args, **kwargs)
File "C:\Users\reidsy\AppData\Roaming\Python\Python36\site-packages\anki_vector\animation.py", line 168, in load_animation_list
return await self._load_animation_list()
File "C:\Users\reidsy\AppData\Roaming\Python\Python36\site-packages\anki_vector\animation.py", line 134, in _load_animation_list
result = await self.grpc_interface.ListAnimations(req)
File "C:\Users\reidsy\AppData\Roaming\Python\Python36\site-packages\aiogrpc\channel.py", line 40, in call
return await fut
grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
status = StatusCode.DEADLINE_EXCEEDED
details = "ListAnimations request timed out"
debug_error_string = "UNKNOWN:Error received from peer ipv4:192.168.1.18:443 {grpc_message:"ListAnimations request timed out", grpc_status:4, created_time:"2023-04-07T01:19:05.664456406+00:00"}"
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "01_hello_world.py", line 33, in
main()
File "01_hello_world.py", line 27, in main
with anki_vector.Robot(args.serial) as robot:
File "C:\Users\reidsy\AppData\Roaming\Python\Python36\site-packages\anki_vector\robot.py", line 742, in enter
self.connect(self.behavior_activation_timeout)
File "C:\Users\reidsy\AppData\Roaming\Python\Python36\site-packages\anki_vector\robot.py", line 663, in connect
anim_request = self._anim.load_animation_list()
File "C:\Users\reidsy\AppData\Roaming\Python\Python36\site-packages\anki_vector\connection.py", line 806, in result
return future.result()
File "C:\Users\reidsy\AppData\Local\Programs\Python\Python36\lib\concurrent\futures_base.py", line 405, in result
return self.__get_result()
File "C:\Users\reidsy\AppData\Local\Programs\Python\Python36\lib\concurrent\futures_base.py", line 357, in __get_result
raise self._exception
File "C:\Users\reidsy\AppData\Roaming\Python\Python36\site-packages\anki_vector\connection.py", line 751, in log_handler
raise connection_error(rpc_error) from rpc_error
anki_vector.exceptions.VectorTimeoutException: StatusCode.DEADLINE_EXCEEDED: ListAnimations request timed out
Message took too long to complete.
Let's say i want to make my vector say "Sorry" every time he's not able to get what i said
So i wrote this code:
def on_wake_word(robot, event_type, event):
if "wake_word_end" in str(event) and event.wake_word_end.intent_json == '':
try:
robot.conn.request_control()
robot.behavior.say_text("Sorry i couldn't help")
finally:
robot.conn.release_control()
if __name__ == "__main__":
with Robot() as vector_robot:
vector_robot.events.subscribe(on_wake_word, Events.wake_word)
while True:
sleep(1)
the function does called twice if i try to trigger vector, the first time vector reacts as he should, and say the text,
the second time though, he gets there and throw an error:
<_MultiThreadedRendezvous of RPC that terminated with:
status = StatusCode.INTERNAL
details = "Failed to say text"
debug_error_string = "{"created":"@1601351205.816768000","description":"Error received from peer ipv4:X.X.X.X:443","file":"src/core/lib/surface/call.cc","file_line":1062,"grpc_message":"Failed to say text","grpc_status":13}"
>
expected:
That vector will work multiple times with the same call,
Thanks ahead, Eden
I'm trying to authenticate Vector with SDK, but when I type my serial number, I keep getting these errors:
socket.gaierror: [Errno 11001] getaddrinfo failed
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x00000226CF8D4F40>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='session-certs.token.global.anki-services.com', port=443): Max retries exceeded with url: /vic/<serialnumber>(Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x00000226CF8D4F40>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='session-certs.token.global.anki-services.com', port=443): Max retries exceeded with url: /vic/<serialnumber> (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x00000226CF8D4F40>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
THERE IS MISSING FILES COMMAND PROMT DETECTED IT >>>
BUILD_EXT FILE ISNT THERE *
THE WHOLE HTML S FOLDER IS MISSING ***
GRPC.PY/GPRC.HTML.ETC IS MISSING *
CAN U GUYS PLEASE RE UPLOAD THE SDK & MAKE IT ALSO COMPATABLE WITH
SDK Vector_Master 0.6.0
PYTHON 3.8.0 ..
MANY THANKS GIVINGS :)))
I am trying to do an initial setup but getting an error in windows when trying to to run the authentication: Error while finding module specification for 'anki_vector.configure' (ModuleNotFoundError: No module named 'anki_vector')
I noticed that when i downloaded the SDK it does not include the setup.py nor the configure.py files.
I downloaded the master file and found the setup.py is there but the configure.py is not which i think is causing the error. I installed Python 3.7. Can I get any assistance with this?
Hey everyone,
Thanks for this SDK. I am wondering if there is a way to access the Vector microphone?
THERE IS MISSING FILES COMMAND PROMT DETECTED IT >>>
CAN U GUYS PLEASE RE UPLOAD THE SDK & MAKE IT ALSO COMPATABLE WITH
PYTHON 3.8.0 ..
MANY THANKS GIVINGS :)))
Hi,
Could you share some information about the future of the Vector hardware and software platform after Anki ceases operations? Will there be a way for new users to authenticate somehow? Can we replace the Anki backend with something we can run ourselves? I'm not even expecting full functionality of voice searches and all that, but at least enough to develop our own applications.
I tried to use the sample code here:
https://developer.anki.com/vector/docs/generated/anki_vector.connection.html#anki_vector.connection.Connection.requires_behavior_control
And it never passes await robot.conn.request_control()
. The event is definitely triggered (if I add a print in the first line of the method, it shows), but it never prints True
, even with a longer time.sleep
.
Do you know what could be the problem?
Whats the rate of vectoer generates the last image ?
With the majority of the examples that I run from this repo, I get the following error:
Exception has occurred: VectorTimeoutException
StatusCode.DEADLINE_EXCEEDED: ListAnimations request timed out
Message took too long to complete.
File "D:\Code\vector-python-sdk\anki_vector\connection.py", line 749, in log_handler
result = await func(*args, **kwargs)
File "D:\Code\vector-python-sdk\anki_vector\animation.py", line 168, in load_animation_list
return await self._load_animation_list()
File "D:\Code\vector-python-sdk\anki_vector\animation.py", line 134, in _load_animation_list
result = await self.grpc_interface.ListAnimations(req)
The above exception was the direct cause of the following exception:
File "D:\Code\vector-python-sdk\anki_vector\connection.py", line 751, in log_handler
raise connection_error(rpc_error) from rpc_error
File "D:\Code\vector-python-sdk\anki_vector\connection.py", line 806, in result
return future.result()
File "D:\Code\vector-python-sdk\anki_vector\robot.py", line 663, in connect
anim_request = self._anim.load_animation_list()
File "D:\Code\vector-python-sdk\anki_vector\robot.py", line 742, in __enter__
self.connect(self.behavior_activation_timeout)
File "D:\Code\vector-python-sdk\examples\tutorials\01_hello_world.py", line 27, in main
with anki_vector.Robot(args.serial) as robot:
File "D:\Code\vector-python-sdk\examples\tutorials\01_hello_world.py", line 33, in <module>
main()
Any idea what is causing this?
We should support python 3.8 or if that proves too difficult we should have a friendly error message instead of a big ugly traceback in the futures code.
$ python3 -m anki_vector.configure
[1] 11186 abort python3 -m anki_vector.configure
Env
macOS 10.15.6
Python 3.7.7
_open_connections(self) on connection.py just returns when a network disconnection occurs and the task ends. Upon reconnection the task is not restarted so robot control requests are never granted.
Wrapping the function with a 'while not self._control_events.is_shutdown:' recovers disconnections for me but I have not followed the different code paths so not sure if that's the correct fix.
I have got the python3 -m anki_robot.configure but this is what comes up. ImportError: cannot import name 'CancelledError' from 'asyncio.futures' (/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/futures.py)
I get the following error and cannot complete the configure part, can you help? Thank you!
Downloading Vector certificate from Anki...Traceback (most recent call last):
File "C:\Users\Burak\AppData\Roaming\Python\Python39\site-packages\urllib3\connection.py", line 203, in _new_conn
sock = connection.create_connection(
File "C:\Users\Burak\AppData\Roaming\Python\Python39\site-packages\urllib3\util\connection.py", line 60, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "C:\Program Files\Python39\lib\socket.py", line 953, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\Burak\AppData\Roaming\Python\Python39\site-packages\urllib3\connectionpool.py", line 790, in urlopen
response = self._make_request(
File "C:\Users\Burak\AppData\Roaming\Python\Python39\site-packages\urllib3\connectionpool.py", line 491, in _make_request
raise new_e
File "C:\Users\Burak\AppData\Roaming\Python\Python39\site-packages\urllib3\connectionpool.py", line 467, in _make_request
self._validate_conn(conn)
File "C:\Users\Burak\AppData\Roaming\Python\Python39\site-packages\urllib3\connectionpool.py", line 1096, in _validate_conn
conn.connect()
File "C:\Users\Burak\AppData\Roaming\Python\Python39\site-packages\urllib3\connection.py", line 611, in connect
self.sock = sock = self._new_conn()
File "C:\Users\Burak\AppData\Roaming\Python\Python39\site-packages\urllib3\connection.py", line 210, in _new_conn
raise NameResolutionError(self.host, self, e) from e
urllib3.exceptions.NameResolutionError: <urllib3.connection.HTTPSConnection object at 0x000001F88C8402E0>: Failed to resolve 'session-certs.token.global.anki-services.com' ([Errno 11001] getaddrinfo failed)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\Burak\AppData\Roaming\Python\Python39\site-packages\requests\adapters.py", line 486, in send
resp = conn.urlopen(
File "C:\Users\Burak\AppData\Roaming\Python\Python39\site-packages\urllib3\connectionpool.py", line 844, in urlopen
retries = retries.increment(
File "C:\Users\Burak\AppData\Roaming\Python\Python39\site-packages\urllib3\util\retry.py", line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='session-certs.token.global.anki-services.com', port=443): Max retries exceeded with url: /vic/00308c45 (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x000001F88C8402E0>: Failed to resolve 'session-certs.token.global.anki-services.com' ([Errno 11001] getaddrinfo failed)"))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Python39\lib\runpy.py", line 197, in run_module_as_main
return run_code(code, main_globals, None,
File "C:\Program Files\Python39\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\Burak\AppData\Roaming\Python\Python39\site-packages\anki_vector\configure_main.py", line 322, in
main(Api())
File "C:\Users\Burak\AppData\Roaming\Python\Python39\site-packages\anki_vector\configure_main.py", line 302, in main
cert, serial = get_cert(args.serial)
File "C:\Users\Burak\AppData\Roaming\Python\Python39\site-packages\anki_vector\configure_main.py", line 101, in get_cert
r = requests.get('[https://session-certs.token.global.anki-services.com/vic/{}'.format(serial)](https://session-certs.token.global.anki-services.com/vic/%7B%7D'.format(serial)))
File "C:\Users\Burak\AppData\Roaming\Python\Python39\site-packages\requests\api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "C:\Users\Burak\AppData\Roaming\Python\Python39\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\Burak\AppData\Roaming\Python\Python39\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\Burak\AppData\Roaming\Python\Python39\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "C:\Users\Burak\AppData\Roaming\Python\Python39\site-packages\requests\adapters.py", line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='session-certs.token.global.anki-services.com', port=443): Max retries exceeded with url: /vic/00308c45 (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x000001F88C8402E0>: Failed to resolve 'session-certs.token.global.anki-services.com' ([Errno 11001] getaddrinfo failed)"))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.