birarda / moveframework

Automatically exported from code.google.com/p/moveframework
2 stars 0 forks source link

Lag with getting data from the PS Eye Camera #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Adding mathematical operations to the code.
2. Adding too many condition statements.

What is the expected output? What do you see instead?
I expect to see the data.position.x, data.position.y and data.position.z change 
with each iteration of the moveUpdated function in the MoveObserver. Instead, I 
get the same value multiple times if I add too much data management, despite me 
waving the move controllers around in front of the Camera.

What version of the product are you using? On what operating system?
The most recent versions available from this project page on Windows 7 OS.

Please provide any additional information below.
This is in response to the following things I mistakenly posted on the requests 
page:

ME -
I am currently using two PS moves and your framework in order to control the 
cursor on the computer screen. However, there is a lot of lag caused by the 
framework not getting an updated move position from the camera. Is there a flag 
in the framework that tracks whether or not the PlayStation? eye has sent new 
data to the program? Would it be possible to get access to something like that?

DARRESS -
Because the framework uses the observer pattern, the update function will be 
called as soon as new data available. There is no need of flags, or so. If the 
camera and sensor fusion threads have the highest priority, so if your PC is 
fast enough, it should not have any lag. Or you did not use the observer 
pattern, but ask for data in a custom loop. If this is the case, it is no 
wonder it is laggy, just use the observer pattern. (Subscribe the move and 
implement the observer interface.)

I will respond here C:
It is not a PC lag issue, I have checked the system usage and the computer is 
not struggling to run this program. The problem is that the program does not 
give me new and relevant data. I have attached two files that show this 
happening. In the first file, I am simply writing the change in 
"move.position.x" to the txt file (multiplied by some constant). In the second 
file, I am doing the same thing but I have added a few lines of data management 
(specifically taking the euclidean distance that the controllers have moved). 
As you can see, the program is almost never registering a change in position.

All of this has been programmed in the MoveObserver. The tests were run with me 
waving the controllers in front of the PlayStation Eye camera.

Thank you for your help!

Original issue reported on code.google.com by alidamve...@gmail.com on 16 Jul 2012 at 4:22

Attachments:

GoogleCodeExporter commented 9 years ago
Could you please provide code, that I can reproduce your issue?

Original comment by darress on 16 Jul 2012 at 6:06

GoogleCodeExporter commented 9 years ago
Attached the .cpp file I use, altered from the example.cpp you include in the 
download. As I put in the comments, you can un-comment the if/else statement in 
moveUpdated in order to see the program working with reduced lag. The program 
is designed for hemiparetic stroke therapy, so the controller that moves the 
least amount will control the cursor (so that the participant will have to use 
their "bad" arm).

Original comment by alidamve...@gmail.com on 16 Jul 2012 at 6:18

Attachments:

GoogleCodeExporter commented 9 years ago
Okey, I found the cause of this phenomenon. The orientation and the position 
update rate is not the same, and it can vary depending on the use of your 
computer resources. Because the orientation rate is faster, and it's data more 
important, the framework updates the observers if there is new orientation 
data. This way, you get all data, but the the position update may wait some ms 
for the orientation update.

Original comment by darress on 25 Jul 2012 at 2:34

GoogleCodeExporter commented 9 years ago
It's not a deffect, it's how the framework supposed to work.

Original comment by darress on 25 Jul 2012 at 2:35

GoogleCodeExporter commented 9 years ago
Thank you for your help. I'm still a bit confused as to why the lag appears so 
quickly when I add code. It is not clear to me why adding a few conditional 
statements and some data processing makes it update so much less often.

I will try commenting out where the framework updates the orientation, angular 
velocity and angular acceleration, because I am only using the 3D position 
tracking through the PS Eye. I will let you know if this reduces the lag.

Original comment by alidamve...@gmail.com on 25 Jul 2012 at 7:36

GoogleCodeExporter commented 9 years ago
The project is no longer maintained.

Original comment by darress on 3 Aug 2012 at 2:05