LORD-MicroStrain / MSCL

MicroStrain Communication Library
https://www.microstrain.com/software/mscl
MIT License
76 stars 57 forks source link

3DMCV7-AR with setSensorToVehicleRotation_matrix issue #378

Closed joncage closed 5 months ago

joncage commented 6 months ago

We're trying to integrate a 3DMCV7-AR sensor into our product but when we try and issue a setSensorToVehicleRotation_matrix command we get a Error_NotSupported exception with the detail: The command (3406) is not supported. response.

If we run your SensorConnect software, we're able to successfully apply the changes and the various outputs change as we'd expect.

We're using mscl_65.0.0_Windows_DotNet\Win32\MSCL_Managed.dll if that makes a difference and attempting to call it as follows:

mscl::Matrix_3x3^ matrix = gcnew mscl::Matrix_3x3(0.0f, 0.0f, 1.0f, -1.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f);
node->setSensorToVehicleRotation_matrix(matrix);

What might we be doing wrong here?

risk08 commented 6 months ago

Turns out we were using the wrong command.

I think there seem in the docs incredibly similar to me, so might be worth adding a note or something?

We should have used:

setSensorToVehicleTransform_matrix()

Sets the sensor to vehicle frame transformation with a row-major direction cosine matrix. The specified matrix must be orthonormal. This matrix defines the transformation from the sensor body from to the fixed vehicle frame. Note: The transformation is stored in the device as a quaternion. When the matrix values are read back from the device, they may not be equivalent in value to the values used to set the transformation, but they are functionally equivalent.

instead of

setSensorToVehicleRotation_matrix()

Sets the sensor to vehicle frame rotation with a row-major direction cosine matrix. The specified matrix must be orthonormal. This matrix defines the rotation from the sensor body from to the fixed vehicle frame. Note: The rotation is stored in the device as a quaternion. When the matrix values are read back from the device, they may not be equivalent in value to the values used to set the rotation, but they are functionally equivalent.