Git Product home page Git Product logo

arena-py's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arena-py's Issues

Do not publish when nothing is being changed/updated

Say we have this series of calls (in a loop, or something):

scene.update_object(box, click_listener=True)
scene.update_object(box, click_listener=True)
scene.update_object(box, click_listener=True)
scene.update_object(box, click_listener=True)
scene.update_object(box, click_listener=True)
etc...

Only the first call should actually do the publishing (make a network call), the rest should not do anything. The library should recognize that the click-listener of the box is already true and not do anything when updating.

Text control in python.

Get access to 3D text parameters in python. Would like to be able to change parameters like alignment etc

Tried data='{"text":{ "wrapCount":100, "value":"Definitely not working..." } } ' but the text gets replaced with [Object object] and the wrapCount parameter stays at default 40.

Tic-tac-guac animation & physics not working

The animations of blocks falling/being launched and the avocado's animation do not work in guac.py, while the arm-demo's animation works. Changing the physics attribute to dynamic_body (exchangeable as indicated by the documentation) also doesn't work. After a win/stalemate, the boxes will hold their positions and freeze for 5 seconds after being reset into their default state instead of rendering the physics.

[arb] Allow object placement by hit-testing

Not sure what this would take in ARENA-core yet, but ideally this is how initial objects and models could be placed. Load an object in ARB clipboard and let it land on surfaces util the user is happy and clicks to place it.

Color translation crash

Exception thrown in process_message()! Terminating process_message...
Traceback (most recent call last):
  File "/Users/mwfarb/.pyenv/versions/3.9.0/lib/python3.9/site-packages/webcolors.py", line 392, in name_to_rgb
    return hex_to_rgb(name_to_hex(name, spec=spec))
  File "/Users/mwfarb/.pyenv/versions/3.9.0/lib/python3.9/site-packages/webcolors.py", line 378, in name_to_hex
    raise ValueError(
ValueError: '8a1c' is not defined as a named color in css3

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/mwfarb/git/arena-py/arena/event_loop/async_worker.py", line 10, in run
    await self.func(*self.args, **self.kwargs)
  File "/Users/mwfarb/git/arena-py/arena/scene.py", line 290, in process_message
    obj = ObjClass(**payload)
  File "/Users/mwfarb/git/arena-py/arena/objects/camera.py", line 23, in __init__
    super().__init__(object_type=Camera.object_type, object_id=object_id, position=Position(**position), rotation=Rotation(**rotation), **kwargs)
  File "/Users/mwfarb/git/arena-py/arena/objects/arena_object.py", line 54, in __init__
    data = Data(**data)
  File "/Users/mwfarb/git/arena-py/arena/attributes/data.py", line 17, in __init__
    data = Data.update_data(data, kwargs)
  File "/Users/mwfarb/git/arena-py/arena/attributes/data.py", line 90, in update_data
    color = Color(v)
  File "/Users/mwfarb/git/arena-py/arena/attributes/color.py", line 19, in __init__
    wcrgb = webcolors.hex_to_rgb("#0"+color)
  File "/Users/mwfarb/.pyenv/versions/3.9.0/lib/python3.9/site-packages/webcolors.py", line 441, in hex_to_rgb
    int_value = int(normalize_hex(hex_value)[1:], 16)
  File "/Users/mwfarb/.pyenv/versions/3.9.0/lib/python3.9/site-packages/webcolors.py", line 304, in normalize_hex
    raise ValueError(
ValueError: '#08a1c' is not a valid hexadecimal color value.

Unauthorized Error when rotating screenshare object in scene "meeting" coming from arb.py

Unauthorized Error when rotating screenshare object in scene "meeting" coming from arb.py

Full Traceback:

Traceback (most recent call last):
File "arb.py", line 997, in
arena.handle_events()
File "/Users/agr/Documents/Projects/ARENA/ARENA-py/tools/arb/arena.py", line 196, in handle_events
process_message(messages.pop(0))
File "/Users/agr/Documents/Projects/ARENA/ARENA-py/tools/arb/arena.py", line 115, in process_message
arena_callback(payload)
File "arb.py", line 969, in scene_callback
do_rotate_select(camname, objid)
File "arb.py", line 481, in do_rotate_select
pobjs = arblib.get_network_persisted_obj(objid, BROKER, SCENE)
File "/Users/agr/Documents/Projects/ARENA/ARENA-py/tools/arb/arblib.py", line 561, in get_network_persisted_obj
'https://' + broker + '/persist/' + scene + '/' + object_id).read()
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 531, in open
response = meth(req, response)
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 641, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 401: Unauthorized

Prototype user name/icons app

Goals:

  • Central user manifest should have account name, display name, role/position, arbitrary badge names.
  • It should allow overwriting of display name from central manifest to "add" role/position.
  • It should allow adding arbitrary badges floating above user head.

Support:

  • May require flag on account scene permissions to allow overwriting of display name.

Write headless multiple provider auth manager

  • Currently we use the google auth lib's console auth for managing a localhost server to serve as a callback for it's web auth.
  • We would like to enable other auth providers or a simple ARENA account in the future through Python.
  • To do this, we need to replicate the JWT exchange mechanism Google uses for any auth provider ARENA could provide.

Topic Structure Refactor

  1. New scene subtopics that users subscribe/publish to:
   <realm>/s/<namespace>/<scenename>/u/
   <realm>/s/<namespace>/<scenename>/g/
   <realm>/s/<namespace>/<scenename>/p/
  1. Shorter proc: <realm>/proc -> <realm>/p
  2. Marker detections go to: <realm>/d/public/m (replace <realm>/g/a)
  3. Add userid to network latency topic
  4. Event and camera messages refactor
  5. Change ‘apriltag’ detection message type to ‘marker’
  6. New ‘device_data’ type for device data
  7. Change chat topics o=pub; p=priv

Details:
https://docs.google.com/presentation/d/1MRfo1IiIOiseMZ9BSAp-ksWmTouq9SW8RDAf8GKfnag/edit?usp=sharing

clickable=False might be broken

To Nuno's suspicion, I see that object.update( clickable=False ) after clickable is true for an object doesn't seem to work in arena.py

Fails to connect when port 8883 is closed

  • We could try and catch this error, probe the port to provide a better error message.
  • Using eduroam VPN on campus is enough to replicate and attempt to connect to a scene. It filters all ports but 80, 443.
  • This is not useful:
Traceback (most recent call last):
  File "/Users/mwfarb/git/arena-py/tools/arb/arb.py", line 1394, in <module>
    scene = Scene(
  File "/Users/mwfarb/git/arena-py/arena/scene.py", line 179, in __init__
    self.mqttc.connect(self.host, port=8883)
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 937, in connect
    return self.reconnect()
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1071, in reconnect
    sock = self._create_socket_connection()
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3522, in _create_socket_connection
    return socket.create_connection(addr, source_address=source, timeout=self._keepalive)
  File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socket.py", line 843, in create_connection
    raise err
  File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socket.py", line 831, in create_connection
    sock.connect(sa)
socket.timeout: timed out
sys:1: RuntimeWarning: coroutine 'PersistentWorker.run' was never awaited
sys:1: RuntimeWarning: coroutine 'AsyncWorker.run' was never awaited

Scene init error handling

We need to ad some better error messages when the user sets realm=None or host=None. ATM we are accepting them, using them in topics and urls, and it throws misleading network errors when attempting to connect.

"Connection Time Out" Error Handling

If I leave high-traffic (i.e. head motion test) programs running for a long time, I tend to see this failure state like below. I haven't looked more deeply, but maybe we can add a reconnect retry? I wonder if this is related to the ARTS issue?

`Exception thrown in update()! Terminating update...
Traceback (most recent call last):
File "headbanger.py", line 40, in update
scene.update_object( head, rotation=(0, i, 0),)
File "/home/agr/.local/lib/python3.6/site-packages/arena/scene.py", line 446, in update_object
res = self._publish(obj, "update")
File "/home/agr/.local/lib/python3.6/site-packages/arena/scene.py", line 504, in _publish
self.mqttc.publish(topic, payload, qos=0)
File "/home/agr/.local/lib/python3.6/site-packages/paho/mqtt/client.py", line 1274, in publish
local_mid, topic, local_payload, qos, retain, False, info, properties)
File "/home/agr/.local/lib/python3.6/site-packages/paho/mqtt/client.py", line 2563, in _send_publish
return self._packet_queue(PUBLISH, packet, mid, qos, info)
File "/home/agr/.local/lib/python3.6/site-packages/paho/mqtt/client.py", line 2911, in _packet_queue
self._sockpairW.send(sockpair_data)
TimeoutError: [Errno 110] Connection timed out

Exception thrown in network_latency_update()! Terminating network_latency_update...
Traceback (most recent call last):
File "/home/agr/.local/lib/python3.6/site-packages/arena/scene.py", line 161, in network_latency_update
self.mqttc.publish(self.latency_topic, "", qos=2)
File "/home/agr/.local/lib/python3.6/site-packages/paho/mqtt/client.py", line 1304, in publish
message.dup, message.info, message.properties)
File "/home/agr/.local/lib/python3.6/site-packages/paho/mqtt/client.py", line 2563, in _send_publish
return self._packet_queue(PUBLISH, packet, mid, qos, info)
File "/home/agr/.local/lib/python3.6/site-packages/paho/mqtt/client.py", line 2911, in _packet_queue
self._sockpairW.send(sockpair_data)
BrokenPipeError: [Errno 32] Broken pipe

Exception thrown in misc_loop()! Terminating misc_loop...
Traceback (most recent call last):
File "/home/agr/.local/lib/python3.6/site-packages/arena/event_loop/asyncio_mqtt.py", line 44, in misc_loop
while self.client.loop_misc() == mqtt.MQTT_ERR_SUCCESS:
File "/home/agr/.local/lib/python3.6/site-packages/paho/mqtt/client.py", line 1631, in loop_misc
self._message_retry_check()
File "/home/agr/.local/lib/python3.6/site-packages/paho/mqtt/client.py", line 2832, in _message_retry_check
self._out_messages, self._out_message_mutex)
File "/home/agr/.local/lib/python3.6/site-packages/paho/mqtt/client.py", line 2821, in _message_retry_check_actual
properties=m.properties,
File "/home/agr/.local/lib/python3.6/site-packages/paho/mqtt/client.py", line 2563, in _send_publish
return self._packet_queue(PUBLISH, packet, mid, qos, info)
File "/home/agr/.local/lib/python3.6/site-packages/paho/mqtt/client.py", line 2911, in _packet_queue
self._sockpairW.send(sockpair_data)
BrokenPipeError: [Errno 32] Broken pipe

Disconnect error! Result code: 1`

Remove self-signed cert mode

debug=True should not remove verification to allow testing against self-signed certs, it is a confusing error and puts the connection in a less than ideal condition for the user.

Add remove attribute support

Persist process and web client now support setting an object's attribute to null in the MQTT message payload. The python lib should be updated to reflect this feature.

Provide manual headless auth

When you ssh to a Raspbian terminal, auth does not assume headless mode and uses a local host callback instead of the headless one.

Always show account selection

For google auth url address, use prompt=select_account to always show a list of accounts, even if only one is available, like arena-account.

Auth variable for all auth methods

Currently I am using scene.remote_auth_token['token'] to retrieve the token to pass to Jitsi. Now that I am moving to arts-runtime-native, which uses a local .arena_mqtt_auth token file, this does not work. We should maybe have something like a scene.auth_token variable that works no matter the auth method.

[init3d] 2nd draft feature list

This is a short list of features to work for the next iteration of init3d:

  • add 'found' apps in scene to program controls
  • prevent init3d from being 'found'
  • react to real-time creates and add to controls
  • react to create confirm messages, to wait to enable stop buttons
  • ...

Cannot run examples with cli_args=True

Examples such as arm-demo.py throw error scene argument (scene) is unspecified or None, aborting..., and the parameter cli_args for creating a Scene object is not present in the Scene documents. According to the code in arena-mqtt.py the scene argument can be provided with -s or --scene, but providing it (for example, python arm-demo.py -s playground, using python instead of python3 since it's windows environment) still shows the same error. The argparse library is used to parse commandline arguments, but running python arm-demo.py -h shows the same error instead of showing an options list.

Also, is the discussions panel open for this repository? I feel this kind of questions is better asked in discussion instead of raising an issue. Thanks.

Line object color warnings

  • Attempt to create a green line.
  • This creates a white line:
scene.add_object(Line(
    start=Position(1, 1, 1),
    end=Position(2, 2, 2),
    material=Material(color=Color(0, 255, 0))))
  • This creates a green line with a deprecated warning:
scene.add_object(Line(
    start=Position(2, 2, 2),
    end=Position(3, 3, 3),
    color=Color(0, 255, 0)))

Default color

I think for object primitives we should set the default color to (128,128,128) if not specified. Helps avoid confusion when people are look at the scene with the random initial colors now.

Automate python env cert chain check

Some Apple python env have not certs, and users see the urllib error:
err=URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)')), type(err)=<class 'urllib.error.URLError'>
which is pretty confusing for many.

Instead, we can automate the cert check and use first part of this gist: https://gist.github.com/mwfarb/c45958c321f021b3b472248c1e4cfc5d

If it fails instead of this error we can direct users to: https://arena.conix.io/content/troubleshooting.html#python-unable-to-get-local-issuer-certificate

Remove realm="realm" from examples/codebase

It's happened a few times now that users have set the realm option to something other than realm="realm" and that has caused confusion and authentication errors. Until we actually have another realm setup, we should remove it from our examples and document that it is a reserved parameter.

Office Hour Queue App

We should totally make an office hour queue app that displays a board in the ARENA where TAs can manage office hour queues.

A few key features:

  • Force users to write a twitter sized question
  • Allow TAs to click on users in their own room to teleport them in
  • TAs should be able to click on multiple users to cover conceptual group questions
  • Screenshare with laser pointer support

Stretch goals:

  • Students should be able to ask to be included if they have the same question (even if it isn't what they posted). Maybe a "same question" checkbox for other student's questions
  • VS Code Google Doc like session

Since text entry isn't really a thing in the ARENA, maybe the queue is hosted as a web app somewhere that just has a physical object for seeing status and teleporting people within the ARENA?

Sneaky way to update an object property without setting defaults (clickable for laser pointer)

It would be nice (certainly not a priority) if there was a way to create an object in arena-py that didn't actually set any parameters on initialization. One use-case would be setting a clickable callback on an object without having to get/maintain its state from the persistence DB. Right now, if you address an object by name it looks like the create function publishes default values in terms of type and location. This would move an existing object and/or change its type.

Write mosquitto_pub/sub wrapper tools

ATM mosquitto_pub and mosquitto_sub CLI require a full JWT to be passed on the command line which is too cumbersome to resolve for new users.

  • We should write the equivalent programs in Python that use the authentication system and the user's JWT issued based on their ACL.
  • It should probably accept the same standard arguments, accept for the username/password arguments.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.