WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-31-2007, 07:36 AM
Elittdogg Elittdogg is offline
Member
 
Join Date: Aug 2007
Posts: 77
Another question ("Flagger???")

If I wanted to be able to "flag" (something like an event marker) a point (in time) in the data/output, how would I do that? I currently have no script for this nor do I know where to begin to look in the help menu. Basically, (if you've seen my previous thread) if there are objects on the wall, and I need to be able to determine when I get to each object (in the course of my scanning of the wall) how would I mark that so I could see that in the data?

If that's clear, then ignore what's next, but essentially, if I'm going from point A to point B to point C etc. is there a way to "flag" a point in the data for when I get to point A, B, C, etc. Like if someone were holding a clicker or an event marker.

I hope that's clear. Thank you for the help.
Reply With Quote
  #2  
Old 08-31-2007, 11:31 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Is your data output a text file? If so, you can mark the special event by writing some description to the file when it occurs.
Reply With Quote
  #3  
Old 09-05-2007, 10:13 AM
Elittdogg Elittdogg is offline
Member
 
Join Date: Aug 2007
Posts: 77
I'm not sure if it's a text file. Here's a sample line of what I've got:

head_data = str(Subnum) + '\t' + str(HEADAP) + '\t' +str(HEADLAT) + '\t' +str(HEADVERT) + '\t' +str(HEADYAW) + '\t' +str(HEADPITCH) + '\t' +str(HEADROLL) +'\n'
tracking_data.write(head_data)

I don't know what kind of file that saves into. I think it might be the default file with vizard. But I need somehow to be able to indicate where in the data the user reaches each "landmark."

So again if you were traveling from A to B to C to D. I'd need to mark off when they get to B and then C and then D and so on.
Reply With Quote
  #4  
Old 09-05-2007, 01:12 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Vizard does not perform any automatic file saving. You are probably creating a file somewhere in your script and writing data to it. If you want to flag an event then you can do something like this:
Code:
tracking_data.write('*** FLAG: reached A\n')
If you are reading the data into another program you will need to modify the program so it can properly read in the flags.
Reply With Quote
  #5  
Old 09-06-2007, 09:53 AM
Elittdogg Elittdogg is offline
Member
 
Join Date: Aug 2007
Posts: 77
What will this let me do? I don't really follow--how do I flag the data with this? Press a button? Hook an event marker up? Etc?

I think I'm just creating a text file and then writing the data from Vizard to the text file. That being said, will this "flag" work in that?

What I need to be able to do is for someone to be able to press a button, hit a key, or something that will "mark" that exact point in the data. So if I'm collecting data at 30Hz per second and I have "X" pts of data, I want to know how I could "flag/mark/identify" when I reach a certain point in the maze. So if I reach checkpoint 1 after 6 seconds, I want to be able to indicate that on the data in the text file. (But like if I could press a button on an event marker and have that somehow indicate in the data when I press that button on the event marker.)

(In this case, I'd need to hook up the event marker to the computer, get Vizard to recognize it, and then somehow utilize the pressing of the button on the event marker to "flag" a specific data point/point in time).

Sorry for all of the confusion, but I really appreciate the help. I'm very stuck.
Reply With Quote
  #6  
Old 09-06-2007, 10:33 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Based on the code you posted previously, your script will create some text file that contains a bunch of tab delimited numbers. By executing the line of code I mentioned, when the user reaches some point or when you press a button your text file will look something like this:
Code:
1    1.1    6.2    0.8    1.8    7.8    3.4
1    1.1    6.2    0.8    1.8    7.8    3.4
1    1.1    6.2    0.8    1.8    7.8    3.4
1    1.1    6.2    0.8    1.8    7.8    3.4
*** Reached point A
1    1.1    6.2    0.8    1.8    7.8    3.4
1    1.1    6.2    0.8    1.8    7.8    3.4
1    1.1    6.2    0.8    1.8    7.8    3.4
*** Reached point B
1    1.1    6.2    0.8    1.8    7.8    3.4
1    1.1    6.2    0.8    1.8    7.8    3.4
1    1.1    6.2    0.8    1.8    7.8    3.4
.
.
.
This will let you know at which point in the data the event occurred. It is up to you to know when to write this flag to the text file. If you want to add it when a key or button is pressed, then you will need to register an event callback. For example, the following code will write the flag to the file when the space key is pressed:
Code:
def WriteFlag():
	tracking_data.write('*** Reached point A\n')
vizact.onkeydown(' ',WriteFlag)
If you want to add it when the user reaches some location, then you will need to manually detect if the user has reached the checkpoint, then write the flag to the file. Hope this clears it up a little, let me know if you still have questions.
Reply With Quote
  #7  
Old 09-10-2007, 08:12 AM
Elittdogg Elittdogg is offline
Member
 
Join Date: Aug 2007
Posts: 77
Thank you so much. That really helps. Sorry for any confusion.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:12 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC