Log in

View Full Version : NXT Compass Invalid Manufacturer Exception


Osprey1
08-02-2011, 19:02
When we plugged in our compass to the I2C port on the digital sidecar, we got an Invalid Manufacturer Exception. We double checked the connection and everything seems right. We then installed a jumper configuration on the sidecar and now everything on the robot stops when the compass object is created. Is anyone else getting this error? Did you fix it?

Robototes2412
10-02-2011, 11:33
What language are you using?

basicxman
10-02-2011, 12:23
Is anyone else getting this error? Did you fix it?

We are, and no we haven't fixed it, it's an issue with the WPI library.

What language are you using?

This happens in C++.

I believe it might be due to the typo found in HiTechnicCompass.cpp. I haven't tried correcting this typo to see if it works without throwing an exception but this is probably the issue.


HiTechnicCompass::HiTechnicCompass(UINT32 slot)
: m_i2c (NULL)
{
DigitalModule *module = DigitalModule::GetInstance(slot);
if (module)
{
m_i2c = module->GetI2C(kAddress);

// Verify Sensor
const UINT8 kExpectedManufacturer[] = "HiTechnc";
const UINT8 kExpectedSensorType[] = "Compass ";
if ( ! m_i2c->VerifySensor(kManufacturerBaseRegister, kManufacturerSize, kExpectedManufacturer) )
{
wpi_fatal(CompassManufacturerError);
return;
}
if ( ! m_i2c->VerifySensor(kSensorTypeBaseRegister, kSensorTypeSize, kExpectedSensorType) )
{
wpi_fatal(CompassTypeError);
}
}
}



It shouldn't affect compass operations though.

jhersh
11-02-2011, 01:58
So at least for the HiTechnic compass that I have, that's exactly what the sensor outputs. If yours reports something different, please let me know so I can update the libraries.

For a quick test, just use I2C directly to query those 2 registers just like the library does and then print it out and post it here.

Thanks,
-Joe