RawInput and calibration
Moderator: Moderators
RawInput and calibration
I am using WM_INPUT / RawInput to get information from
3Dx SpaceNavigator in Win32 application (Delphi).
Using this method bypasses the 3DxWare driver. I need to calibrate the SpaceNavigator bypassing the 3DxWare driver. Who can help ?
3Dx SpaceNavigator in Win32 application (Delphi).
Using this method bypasses the 3DxWare driver. I need to calibrate the SpaceNavigator bypassing the 3DxWare driver. Who can help ?
Hello GO,
There isn't any RawInput support for the special USB packets required to "calibrate" the device. I think you can run the 3DxWare driver at the same time. You can thus use the 3DxWare GUI to "calibrate" the device. Or, you could write a small SDK application that would call SiRezero, or you could write a small HID application to do the same thing.
Why do you find that you have to calibrate it? This is a very rare operation.
Jim
3Dx Software Development
There isn't any RawInput support for the special USB packets required to "calibrate" the device. I think you can run the 3DxWare driver at the same time. You can thus use the 3DxWare GUI to "calibrate" the device. Or, you could write a small SDK application that would call SiRezero, or you could write a small HID application to do the same thing.
Why do you find that you have to calibrate it? This is a very rare operation.
Jim
3Dx Software Development
Hello Jim
SpaceNavigator is used for machine manual control. If the operator may change calibration by 3DxWare he can calibrate device accidentally wrong, it means there was pressure on the sensor while calibration was done, i.e. wrong values are saved as calibration values. In this case machine begins to run fast though sensor is not pressed but only was touched, i.e. operating regime will be destroyed.
I would like to keep device calibration under control to prevent this problem.
Where can I get more information about a "small HID application" to calibrate device ?
Where the calibration data are saved and how can I get it ?
SpaceNavigator is used for machine manual control. If the operator may change calibration by 3DxWare he can calibrate device accidentally wrong, it means there was pressure on the sensor while calibration was done, i.e. wrong values are saved as calibration values. In this case machine begins to run fast though sensor is not pressed but only was touched, i.e. operating regime will be destroyed.
I would like to keep device calibration under control to prevent this problem.
Where can I get more information about a "small HID application" to calibrate device ?
Where the calibration data are saved and how can I get it ?
Hi GO,
The calibration information is kept inside the firmware. It is set when the device powers up and also when it is sent a "rezero" command.
I've put an example of how to use HID to rezero the device on our examples ftp site: ftp:/ *** ***. The username is: *** , password: *** .
I suggest you incorporate that code into your app. You can also run it as a separate executable. If you do the latter, I'd remove all the pretty print statements I put in it.
You can run this while the 3DxWare driver is running. You will rezero the device behind the back of the driver. I don't see a problem with doing that. If you did something that affected the state of the device, that would mess it up.
Jim
3Dx Software Development
Moderator Edit: the sample code is no longer available from the FTP service. Please contact 3Dconnexion API Support if you need further assistance.
The calibration information is kept inside the firmware. It is set when the device powers up and also when it is sent a "rezero" command.
I've put an example of how to use HID to rezero the device on our examples ftp site: ftp:/ *** ***. The username is: *** , password: *** .
I suggest you incorporate that code into your app. You can also run it as a separate executable. If you do the latter, I'd remove all the pretty print statements I put in it.
You can run this while the 3DxWare driver is running. You will rezero the device behind the back of the driver. I don't see a problem with doing that. If you did something that affected the state of the device, that would mess it up.
Jim
3Dx Software Development
Moderator Edit: the sample code is no longer available from the FTP service. Please contact 3Dconnexion API Support if you need further assistance.
If it is just a matter of finding the right build settings, I suggest you port the HIDRezero example from our ftp site to C++ Builder. That should make finding the correct settings for your build environment easier.
There's obviously HidD and setupapi calls in there.
Your users can also just use the 3DxWare GUI to issue the Calibrate. It isn't something that should need to be done often.
There's obviously HidD and setupapi calls in there.
Your users can also just use the 3DxWare GUI to issue the Calibrate. It isn't something that should need to be done often.
Thank you,
Yes, I think right now I have a problem with the compiler because adding the headers (hidsdi.h, ...) I get some conflicts.
However, there is one thing I don't understand using rawinput. This is the value of the limit for each direction. It's different depending on the axis but always close to 350.
Could I know these values?
Thanks in advance
matilla
Yes, I think right now I have a problem with the compiler because adding the headers (hidsdi.h, ...) I get some conflicts.
However, there is one thing I don't understand using rawinput. This is the value of the limit for each direction. It's different depending on the axis but always close to 350.
Could I know these values?
Thanks in advance
matilla
What we recommend is that you "scale" the data to [0..1] if input is [0..350]. Your code, after scaling the raw data, should allow for values of higher than 1. This can happen if the user increases the sensitivity of the device (higher "tick" count for same applied force/torque).matilla wrote:However, there is one thing I don't understand using rawinput. This is the value of the limit for each direction. It's different depending on the axis but always close to 350.
Could I know these values?
I'm sorry, I don't understand what you mean.
In the SDK example I can get the rotation angle, there is no problem.
However, in the rawinput example I can get the rotation values but not the angle (at least looking at these bytes):
short* pnData = reinterpret_cast <short> (&event->data.hid.bRawData[1]);
short x = pnData [0];
short y = pnData [1];
short z = pnData [2];
What should I do?
Thanks,
matilla
In the SDK example I can get the rotation angle, there is no problem.
However, in the rawinput example I can get the rotation values but not the angle (at least looking at these bytes):
short* pnData = reinterpret_cast <short> (&event->data.hid.bRawData[1]);
short x = pnData [0];
short y = pnData [1];
short z = pnData [2];
What should I do?
Thanks,
matilla
I thought for certain that we distributed sample code that showed how to use those numbers. Do you recall seeing Vector3D/Matrix3D classes?
Well anyway, the length of that vector is the angle, the direction vector (normal) gives the axis of rotation.
Again the angle is in completely arbitrary units (consistent but arbitrary). You need to scale that angle to achieve a rotation speed appropriate for your task. And don't accumulate the axes, accumulate the current orientation. I'm sure we mention that in the doc.
Well anyway, the length of that vector is the angle, the direction vector (normal) gives the axis of rotation.
Again the angle is in completely arbitrary units (consistent but arbitrary). You need to scale that angle to achieve a rotation speed appropriate for your task. And don't accumulate the axes, accumulate the current orientation. I'm sure we mention that in the doc.