Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow a change of the ROI by network #1576

Merged
merged 2 commits into from Aug 9, 2019
Merged

Allow a change of the ROI by network #1576

merged 2 commits into from Aug 9, 2019

Conversation

Christopher22
Copy link
Contributor

@Christopher22 Christopher22 commented Aug 9, 2019

This pull request extends the modification of pupil detector properties by network. After the change, it is possible to modify the position and size of the ROI, too.

A minimum working example for testing may look like this:

import zmq
import msgpack as serializer

ctx = zmq.Context()

requester = ctx.socket(zmq.REQ)
ip = "localhost"
port = 50020

requester.connect("tcp://%s:%s" % (ip, port))
requester.send_string("SUB_PORT")
sub_port = requester.recv_string()

notification = {
    "subject": "pupil_detector.set_property",
    "target": "eye0",
    "name": "roi",
    "value": [0, 100, 0, 200],
}

topic = "notify." + notification["subject"]
payload = serializer.dumps(notification)
requester.send_string(topic, flags=zmq.SNDMORE)
requester.send(payload)

print(requester.recv_string())

Copy link
Contributor

@papr papr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your first contribution! I made small adjustments based on Python's "Easier to ask for forgiveness than permission." dogma.

@papr papr merged commit f701820 into pupil-labs:master Aug 9, 2019
@papr
Copy link
Contributor

papr commented Aug 9, 2019

@Christopher22 I updated your description since the example was not consistent with the implementation.

@papr
Copy link
Contributor

papr commented Aug 9, 2019

@Christopher22 Actually, your example was correct, and I misinterpreted the implementation. Apologies for that. I am reverting your description to the original.

@papr papr added this to the v1.15 milestone Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants