« AAGRIP » : différence entre les versions

De Neurethic
Aller à la navigation Aller à la recherche
Florentin (discussion | contributions)
Correct gallicisms
 
(16 versions intermédiaires par 4 utilisateurs non affichées)
Ligne 1 : Ligne 1 :
== AAGRIP ==
== AAGRIP ==
[[File:Yoda Grip Force.png|thumb|May the gripforce be with you]]
[[File:Yoda Grip Force.png|thumb|May the gripforce be with you]]
=== The project ===
on décrit le projet ici ?


grandes questions :
'''Evaluate Attributed Agency through GRIP Force.'''
* comment on assure synchro entre image et son d'une vidéo ?
 
* qu'est ce qui affecte le signal de nos capteurs de force dans notre setup ? Comment on le corrige au mieux ?
Sense of Agency is the sense of control of our own actions.
* Est ce que les latences observées pour l'affichage des stimuli n'affectent pas nos données ?
 
Attributed Agency is the sense of control of actions performed by another person.
 
Grip Force is the evaluated pressure in Newton applied on a small sensor held in hands.
 
=== Music ===
 
In order to study attributed agency in digital interactions, we use electronic music materials.
Electronic music gives us the possibility to easily modify the relationship between the action and its consequences.
 
=== Robot ===
 
We also study attributed agency in digital interactions with robots.
For that, we use some videos of a robot speaking.
 
[[Baseline]]


== Materials or Hardware ==
== Materials or Hardware ==
Ligne 15 : Ligne 28 :


=== Screen ===
=== Screen ===
Check the refresh rate of the screen used. The refresh rate may be less than advertised if you don't use a display port cable.
Check the refresh rate of the screen used. The refresh rate may be less than advertised if a display port cable is not used.


Operating systems usually have a software permanently running to handle the display of the screen. This software can disturb experiment framework to ensure the vertical synchronisation of the screen. On Windows, this software, the Desktop Windows Manager (DWM), prevent the Psychtoolbox to guarantee the constant vertical frame rate of the screen.
Operating systems usually have a software permanently running to handle the display of the screen. This software can disturb experiment framework to ensure the vertical synchronization of the screen. On Windows, this software, the Desktop Windows Manager (DWM), prevents the Psychtoolbox to guarantee the constant vertical frame rate of the screen.


=== F/T Sensors ===
=== F/T Sensors ===


Power supply of the computer affects the quality of the signal collected with f/t sensors
Power supply of the computer affects the quality of the signal collected with f/t sensors.


=== Arduino ===
=== Arduino ===


=== Troubleshootings ===
=== Troubleshooting ===


== Software ==
== Software ==


=== Experiment frameworks ===
=== Experiment frameworks ===
Framework available to build experiment : Psychopy, Psychtoolbox, OpenSesame
Framework available to build experiment : [[PsychoPy]], Psychtoolbox, OpenSesame


Psychopy and OpenSesame rely on Python unlike Psychtoolbox which relies on Matlab.
[[PsychoPy]] and OpenSesame rely on Python, unlike Psychtoolbox which relies on Matlab.


We chose Psychopy for our project because the package already offers some interesting functionalities such as stimuli pre-loading, interval between frames recording, time blocked until the screen is fully displayed, ... Besides, as it relies on Python, it's easier to custom our script to add hardware and/or LSL trigger.
We chose [[PsychoPy]] for our project because the package already offers some interesting functionalities such as stimuli pre-loading, interval between frames recording, time blocked until the screen is fully displayed... Besides, as it relies on Python, it's easier to custom our script to add hardware and/or [[Lab Streaming Layer|LSL]] trigger.


Stimuli pre-loading is handled with the static component in the builder interface of psychopy and it allows us to avoid the delay between the start of the trial and the launch of the stimulus which will depends on the kind and the size of the stimuls.
Stimuli pre-loading is handled with the static component in the builder interface of [[PsychoPy]] and it allows us to avoid the delay between the start of the trial and the launch of the stimulus which will depend on the kind and the size of the stimulus.


Psychopy experiment can be launched by command line if you execute the python file in the psychopy installation folder. Create a python virtual environment with the psychoy package doesn't seems to work to launch experiment in it.
[[PsychoPy]] experiment can be launched by command line if you execute the python file in the [[PsychoPy]] installation folder. Create a python virtual environment with the [[PsychoPy]] package doesn't seems to work to launch experiment in it.


Psychopy have 4 different back-ends to handle video files : ffpyplayer, moviepy, opencv, vlc
[[PsychoPy]] has 4 different back-ends to handle video files : ffpyplayer, moviepy, opencv, vlc


*ffpyplayer : bug if there is no sound file or if it's corrupted
*ffpyplayer : bug if there is no sound file or if it's corrupted


*moviepy : lot of errors
*moviepy : a lot of errors


*opencv : works even without audio file but if we use the static component to preload the video, the audio part launchs briefly at the preload time.
*opencv : works even without audio file but if we use the static component to preload the video, the audio part launches briefly at the preload time.


*vlc : error during the initialisation, it may need additionnal package
*vlc : error during the initialization, it may need additional packages


(Psychopy seems to keep a lot of things in RAM when you run an experiment multiple times so it may be better to restart it regularly)
([[PsychoPy]] seems to keep a lot of things in RAM when you run an experiment multiple times so it may be better to restart it regularly)


You can create your experiment from the builder and generate the python file associated after this. If you want to edit this file to add code not supported by the builder, keep in mind that every time you refresh the python file from the builder, it will erase the modifications made in the file.
You can create your experiment from the builder and generate the [[Python]] file associated after this. If you want to edit this file to add code not supported by the builder, keep in mind that every time you refresh the python file from the builder, it will erase the modifications made in the file.


Loop element in the builder is transcribed in TrialHandler object in code (you won't find any doc on loop element but you can seek for TrialHandler to know more about options and properties).
Loop element in the builder is transcribed in TrialHandler object in code (you won't find any doc on loop element but you can seek for TrialHandler to know more about options and properties).
It's possible to retrieve the frame index of a playing movie component. It may not be useful to detect frame drop because it will always give an answer so it may be a parallel process which looks at the frame index at a specific interval.


=== LSL ===
=== LSL ===


-> à intégrer à l'expérience
[[Lab Streaming Layer|The lab streaming layer (LSL)]] is a system for the unified collection of measurement time series in research experiments that handles both the networking, time-synchronization, (near-) real-time access as well as optionally the centralized collection, viewing and disk recording of the data.
 
The core library liblsl is supported on many languages : C, C++, [[Python]], Matlab, C#, Java. We used [[Python]] interface with [https://github.com/chkothe/pylsl/tree/master pylsl] library.
 
You can find explanations and examples on their Github for this library.
 
==== Discoveries ====
If you use the resolve_stream() function to find your stream, the script will wait until it finds a stream corresponding to your research. It's better to use resolve_byprop() which gives us more flexibility and we can specify the amount of time the script should wait until finding a stream or the number of streams we are looking for. You also have the possibility to fetch all the streams available in an array with resolve_stream'''s'''()
 
Documentation recommends to seek streams by type but you can also look by name or source_id which can be more useful when you are working with multiple streams.


=== Troubleshootings ===
You can do multiple streams in the same script from a single computer but you can't stream and retrieve data in the same script, you will get an error of multi-casting.


<ref>Une référence [https://fr.wikipedia.org/w/index.php?title=Pierre-Eudoxe_Dubalen&veaction=edit] </ref>
By default, when you create the object to retrieve data from a stream (StreamInlet), this is made with some interesting arguments. One of these is ''recover'' which is True by default and this means it will try to reconnect to the stream when connection broke off. This is useful to prevent lost data with connection problems but the script will freeze until it reconnects to the stream. If you cut intentionally a stream of data while a script was still listening, the listener will freeze. You can prevent this by putting False to the recover parameter at the creation of the StreamInlet or by using the close_stream() function on the listener before the connection to the stream broke off (''documentation says that this function will drop the data in transmission or in the buffer'').
<references />

Dernière version du 23 mars 2026 à 13:55

AAGRIP

Erreur lors de la création de la vignette : Fichier manquant
May the gripforce be with you

Evaluate Attributed Agency through GRIP Force.

Sense of Agency is the sense of control of our own actions.

Attributed Agency is the sense of control of actions performed by another person.

Grip Force is the evaluated pressure in Newton applied on a small sensor held in hands.

Music

In order to study attributed agency in digital interactions, we use electronic music materials. Electronic music gives us the possibility to easily modify the relationship between the action and its consequences.

Robot

We also study attributed agency in digital interactions with robots. For that, we use some videos of a robot speaking.

Baseline

Materials or Hardware

Acquisition Cards

NI acquisition cards -> drivers only available on Windows and not on Linux

Screen

Check the refresh rate of the screen used. The refresh rate may be less than advertised if a display port cable is not used.

Operating systems usually have a software permanently running to handle the display of the screen. This software can disturb experiment framework to ensure the vertical synchronization of the screen. On Windows, this software, the Desktop Windows Manager (DWM), prevents the Psychtoolbox to guarantee the constant vertical frame rate of the screen.

F/T Sensors

Power supply of the computer affects the quality of the signal collected with f/t sensors.

Arduino

Troubleshooting

Software

Experiment frameworks

Framework available to build experiment : PsychoPy, Psychtoolbox, OpenSesame

PsychoPy and OpenSesame rely on Python, unlike Psychtoolbox which relies on Matlab.

We chose PsychoPy for our project because the package already offers some interesting functionalities such as stimuli pre-loading, interval between frames recording, time blocked until the screen is fully displayed... Besides, as it relies on Python, it's easier to custom our script to add hardware and/or LSL trigger.

Stimuli pre-loading is handled with the static component in the builder interface of PsychoPy and it allows us to avoid the delay between the start of the trial and the launch of the stimulus which will depend on the kind and the size of the stimulus.

PsychoPy experiment can be launched by command line if you execute the python file in the PsychoPy installation folder. Create a python virtual environment with the PsychoPy package doesn't seems to work to launch experiment in it.

PsychoPy has 4 different back-ends to handle video files : ffpyplayer, moviepy, opencv, vlc

  • ffpyplayer : bug if there is no sound file or if it's corrupted
  • moviepy : a lot of errors
  • opencv : works even without audio file but if we use the static component to preload the video, the audio part launches briefly at the preload time.
  • vlc : error during the initialization, it may need additional packages

(PsychoPy seems to keep a lot of things in RAM when you run an experiment multiple times so it may be better to restart it regularly)

You can create your experiment from the builder and generate the Python file associated after this. If you want to edit this file to add code not supported by the builder, keep in mind that every time you refresh the python file from the builder, it will erase the modifications made in the file.

Loop element in the builder is transcribed in TrialHandler object in code (you won't find any doc on loop element but you can seek for TrialHandler to know more about options and properties).

It's possible to retrieve the frame index of a playing movie component. It may not be useful to detect frame drop because it will always give an answer so it may be a parallel process which looks at the frame index at a specific interval.

LSL

The lab streaming layer (LSL) is a system for the unified collection of measurement time series in research experiments that handles both the networking, time-synchronization, (near-) real-time access as well as optionally the centralized collection, viewing and disk recording of the data.

The core library liblsl is supported on many languages : C, C++, Python, Matlab, C#, Java. We used Python interface with pylsl library.

You can find explanations and examples on their Github for this library.

Discoveries

If you use the resolve_stream() function to find your stream, the script will wait until it finds a stream corresponding to your research. It's better to use resolve_byprop() which gives us more flexibility and we can specify the amount of time the script should wait until finding a stream or the number of streams we are looking for. You also have the possibility to fetch all the streams available in an array with resolve_streams()

Documentation recommends to seek streams by type but you can also look by name or source_id which can be more useful when you are working with multiple streams.

You can do multiple streams in the same script from a single computer but you can't stream and retrieve data in the same script, you will get an error of multi-casting.

By default, when you create the object to retrieve data from a stream (StreamInlet), this is made with some interesting arguments. One of these is recover which is True by default and this means it will try to reconnect to the stream when connection broke off. This is useful to prevent lost data with connection problems but the script will freeze until it reconnects to the stream. If you cut intentionally a stream of data while a script was still listening, the listener will freeze. You can prevent this by putting False to the recover parameter at the creation of the StreamInlet or by using the close_stream() function on the listener before the connection to the stream broke off (documentation says that this function will drop the data in transmission or in the buffer).