Closed sbrodeur closed 8 years ago
From: https://github.com/praneshkmr/node-lsm303/tree/master/lib
temp : (((buffer[0] << 8) | buffer[1]) >> 4)/8 + 18
Not sure why they add 18 there.
From: https://forum.pololu.com/t/understanding-the-lsm303-library-code/4709
byte tl = compass.readReg(LSM303::TEMP_OUT_L);
byte th = compass.readReg(LSM303::TEMP_OUT_H);
int temperature_raw = (int16_t)(th << 8 | tl);
float temperature = (float)temperature_raw / 8;
See commit 5dbd259 for a fix. This will need to be tested on the robot.
We may also use the temperature signal from the BMP180 sensors connected on the same I2C bus. See here to compile the kernel driver module: https://github.com/bsapundzhiev/bmp085
We would also have easily access to the barometer, which we could publish in a sensor_msgs/FluidPressure topic.
See commit 82ae0c1013cf0bd1e29f5fcb17c7944110dbfba4 for the corrections. The temperature was given in 12-bit , right-justified, 2s complement, and was calibrated to 25C.
Above procedure for BMP180 returns reasonable values, it could be pretty easy to add pressure and new temperature sensor. This new one would replace the old one that was more an internal temp probe for accelerometer and compass correction.
In commit b6c5b2c6f407a291d974cb74248c7650de594f22 added barometer node. It publishes atmo pressure and temperature. Temperature values seems much more reliable than the LM303 ones.
To have better temperature accuracy (and maybe pressure too), we only need to clear out the chip by removing the electrical tape that protects the PCB.
The temperature read from the IMU seems too high to be accurate:
We should check the current implementation using the LM303 sensor: https://github.com/sbrodeur/ros-icreate-bbb/blob/master/src/imu/src/LMS303.cpp#L120
From the dataset: