Giter Club home page Giter Club logo

Comments (5)

tobidelbruck avatar tobidelbruck commented on August 22, 2024

I see line 628 of https://github.com/uzh-rpg/rpg_dvs_ros/blob/master/davis_ros_driver/src/driver.cpp should convert from caer g units to m/s^2 unit. (I don't know what the switch is there for, since caer should deliver the IMU data in same form for each type of DAVIS).


                       if (davis_info_.chipID == DAVIS_CHIP_DAVIS346B)
                        {
                            // convert from g's to m/s^2 and align axes with camera frame
                            msg.linear_acceleration.x = -caerIMU6EventGetAccelY(event) * STANDARD_GRAVITY;
                            msg.linear_acceleration.y = -caerIMU6EventGetAccelX(event) * STANDARD_GRAVITY;
                            msg.linear_acceleration.z = -caerIMU6EventGetAccelZ(event) * STANDARD_GRAVITY;
                            // convert from deg/s to rad/s and align axes with camera frame
                            msg.angular_velocity.x = -caerIMU6EventGetGyroY(event) / 180.0 * M_PI;
                            msg.angular_velocity.y = -caerIMU6EventGetGyroX(event) / 180.0 * M_PI;
                            msg.angular_velocity.z = -caerIMU6EventGetGyroZ(event) / 180.0 * M_PI;
                        }
                        else
                        {
                            // convert from g's to m/s^2 and align axes with camera frame
                            msg.linear_acceleration.x = -caerIMU6EventGetAccelX(event) * STANDARD_GRAVITY;
                            msg.linear_acceleration.y = caerIMU6EventGetAccelY(event) * STANDARD_GRAVITY;
                            msg.linear_acceleration.z = -caerIMU6EventGetAccelZ(event) * STANDARD_GRAVITY;
                            // convert from deg/s to rad/s and align axes with camera frame
                            msg.angular_velocity.x = -caerIMU6EventGetGyroX(event) / 180.0 * M_PI;
                            msg.angular_velocity.y = caerIMU6EventGetGyroY(event) / 180.0 * M_PI;
                            msg.angular_velocity.z = -caerIMU6EventGetGyroZ(event) / 180.0 * M_PI;
                        }

Line 112 of https://github.com/uzh-rpg/rpg_dvs_ros/blob/master/davis_ros_driver/include/davis_ros_driver/driver.h defines
`
static constexpr double STANDARD_GRAVITY = 9.81;

`

https://github.com/inilabs/libcaer/blob/master/include/events/imu6.h defines cAER units for acceleration as g's. Therefore I think that the g units of cAER are being multiplied by another factor of g in this code, rather than being divided by it. I must be missing something.

from rpg_dvs_ros.

guillermogb avatar guillermogb commented on August 22, 2024

Thanks for pointing this out. I think the switch is now obsolete. This code was there to fix an earlier version of libcaer regarding the DAVIS346B.
7e741c2

It seems that libcaer has been fixed in the time since that commit, making sure that the IMU for the DAVIS346B has the same notation as the one for the DAVIS240C, and we did not notice. We did not fix it since we always compute the camera-to-IMU transformation (rotation and translation) using Kalibr.
We will remove this now obsolete switch. @eliasm @supitalp just be aware.

from rpg_dvs_ros.

guillermogb avatar guillermogb commented on August 22, 2024

Fixed in PR #59

from rpg_dvs_ros.

tobidelbruck avatar tobidelbruck commented on August 22, 2024

Thanks Guillermo, and reading the code I now I see I was mistaken. A 1g acceleration from cAER is correctly multiplied by 9.8m/s^2 to result in a final 9.8m/s^2 ROS value.
It still doesn't explain why I'm getting wrong values in my jAER rosbag acceleration, but it is probably something in that RosBagFileInputStream class, not here.

Have you validating physical correctness of the acceleration values by application using rpg-dvs code?

from rpg_dvs_ros.

guillermogb avatar guillermogb commented on August 22, 2024

Hi Tobi. We have validated the physical correctness of the acceleration values for the DAVIS240C sensors. In case of the mini DAVIS346B, we have reported to iniLabs that the values given by the accelerometer are off by some amount, and so, we have to calibrate the IMU (while at rest) and compensate for this offset whenever we use our visual-inertial odometry algorithms.

from rpg_dvs_ros.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.