Skip to content

ibaiGorordo/readRazerData

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

readRazerData

Program based on the sixense_simple3d code from the Sixense SDK to read the data from the Razer Hydra. The main objective of this program is to act as data logger for the Razer Hydra. Therefore, all the code related to FreeGlut has been removed and the 3d representation of the controllers is not showed. In contrast, all the information is presented in the command line.

In the current version, the Base Number, Controller Id and the 3D positions are printed in the command line. The printed information can be changed by editing the code in the draw_controller_info function. For example, the following code is commented, but by uncommenting it, information about the controller can be showed.

printf("Controller index: %d\nFirmware Version: %u\nHardware Version: %u\nHemi Tracking enabled: %u\n Magnetic frequency: %u\nPacket type: %u\nSequence number: %u\nHand: %u\n\n",
	acd.controllers[cont].controller_index, acd.controllers[cont].firmware_revision, acd.controllers[cont].hardware_revision,
	acd.controllers[cont].hemi_tracking_enabled, acd.controllers[cont].magnetic_frequency,
        acd.controllers[cont].packet_type, acd.controllers[cont].sequence_number, acd.controllers[cont].which_hand)

Sampling rate

The sampling rate can be edited by changing the value of the SAMPLING_PERIOD constant. The current value is set to 4, whcih means that the program reads the data from both controllers every 4ms.

Timestamp

The original sixense_simple3d program is not suitable for data logging because the Sampling Rate is variable and there is no information in the log file about the Timestamp for each sample. For this reason, in this program the ellapsed time from the start of the program is stored for each sample. Furthermore, the value of the incremental that goes from 0-255 is stored to check how many frames have been missed or if the same frame has been already stored.

Stop program

Whenever the q key is pressed, the logging is stopped and the the program stops running.

Repository folders

The repository contains 6 folders:

  • bin: Contains the .dll files from the Sixense SDK.
  • Compiled Versions: Contains the compiled files of the program, both for the 32 and 64 bit.
  • include: Contains the the header files from the Sixense SDK.
  • lib: Contains the .lib files from the Sixense SDK.
  • Output Data: The logfile is stored in this folder.
  • src: Contains the source files with the Visual Studio solution.

Output data logfile

The logfile containing the extracted data is stored in the Output Data folder. The data in the logfile is comma-separated and it consits of 16 columns:

  • Seconds: Elapsed seconds since the program started.
  • Millis: Milliseconds part of the ellapsed time.
  • Contr: Controller ID (0: Left controller, 1: Right Controller).
  • Frame: Incremental value from 0 to 255. Important to check how many frames have been missed or if the same has been read previously.
  • posX, posY, posZ: 3D position in mm.
  • rot11, rot12, rot13, rot21, rot22, rot23, rot31, rot32, rot33: Rotation matrix.

Possible errors

  • When compiling the solution file, the compiled files will be stored in a folder under the Compiled Versions folder. Next, the necessary .dll files (msvcp100.dll, msvcr100.dll,sixense_utils_x64.dll, sixense_x64.dll) need to be to copied to the folder containing the .exe file. The repository already contains compiled folders for the 32 and 64 bit platforms, therefore, there is no need to copy the .dll files for thos plaforms.
  • When compiling in DEBUG mode some errors will appear because some .dll files are missing. Change to RELEASE mode to get rid of the errors.
  • It takes some time (around 5 to 10 seconds) until the data from the Razer Hydra is presented. If the controllers are not placed in the base station, the program will ask the user to point the controllers to the base station and pull the trigger for the Hemisphere correction.

About

Program based on the sixense_simple3d code from the Sixense SDK to read the data from the Razer Hydra.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published