OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): 2022.1.4
**Standard Standalone? yes
What are you trying to achieve?:
The goal of the study is to have participants watch an object move across the screen (it should stop at a specified location). The trial will then end and participants will be asked to mark the location that they think the object stopped. I have an object (it is an image stimulus not a polygon) that moves across the screen. I have a set starting location in pixels. In the image stimulus’ position section I have an equation that pulls different variables (velocity and the starting point in pixels) from an excel sheet to set the x-axis position based on ‘t’ or time (see below).
[((t * Poly_Velocity) + Img_StartPosX), 0]
This equation updates the object’s location every frame.
I also have a code-component in place to stop the image at a specific x-axis location. I have 6 unique stop points (endpoints). In the same code component I had psychopy take the position in pixels of the image when the status of the image is “stopped” and put it into my data file. This allowed me to compare any differences in where the image stopped according to PsychoPy and where I originally told the image to stop. I am trying to be as precise as possible, so ideally there shouldn’t be a difference between the endpoint I set for the image and the x-axis coordinate that PsychoPy gives me in my data. When I look at the data I see that there is somewhere between 0.3 and approximately 2 pixels difference between my set endpoint and where PsychoPy says the image stopped.
In each frame
if Move == "Left" and Endpoint==1: if Picture.pos <= -349: Picture.status = STOPPED elif Move == "Right" and Endpoint==1: if Picture.pos >= 349: Picture.status = STOPPED elif Move == "Left" and Endpoint==2: if Picture.pos <= -351: Picture.status = STOPPED elif Move == "Right" and Endpoint==2: if Picture.pos >= 351: Picture.status = STOPPED elif Move == "Left" and Endpoint==3: if Picture.pos <= -353: Picture.status = STOPPED elif Move == "Right" and Endpoint==3: if Picture.pos >= 353: Picture.status = STOPPED if Picture.status==STOPPED: continueRoutine=False and Picture.pos
The code and everything works correctly (aka the object stops, the trial ends and the data is recorded), I just don’t know if the data is accurate or what the true endpoint of the object is.
Here are my questions:
Is this because the program needs time to stop the object and then record the object’s location? Meaning the object kept moving as the program took time to register the information and then enact my code? Does this mean that the output PsychoPy gives me in my data file is the exact location that the object stopped?
Or did the program stop the object exactly where I set the end point, but because the program needs time to work its magic the location that PsychoPy indicates is based on the slightly delayed command for pulling the endpoint? (also possibly caused by my use of an equation to create the movement) Does this mean that the location that PsychoPy gives me in the data file is incorrect?
Lastly, is there a way to be more precise? For instance is there anything I can do that makes sure that the image truly does stop at the exact pixel value I want it to?
If there are solutions that involve different building or coding methods than what I have used I am open to anything. Thank you!