Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   NXT Compass Invalid Manufacturer Exception (http://www.chiefdelphi.com/forums/showthread.php?t=91287)

Osprey1 08-02-2011 19:02

NXT Compass Invalid Manufacturer Exception
 
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

Re: NXT Compass Invalid Manufacturer Exception
 
What language are you using?

basicxman 10-02-2011 12:23

Re: NXT Compass Invalid Manufacturer Exception
 
Quote:

Originally Posted by Osprey1 (Post 1018699)
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.

Quote:

Originally Posted by Robototes2412 (Post 1019939)
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.
Quote:

Originally Posted by WPILibC++Rev2259
Code:

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

Re: NXT Compass Invalid Manufacturer Exception
 
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


All times are GMT -5. The time now is 03:44.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi