-
Notifications
You must be signed in to change notification settings - Fork 1
Jk collision detection - improving poseEstimation #285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| double x = MathUtil.applyDeadband(vertVal, 0.05) * Constants.MAX_VELOCITY / 10; | ||
| currentVelValue = accelerometer.getVelocityValue(); | ||
| predictedVelValue = Math.sqrt(Math.pow(y, 2) + Math.pow(x, 2)); | ||
| if (Math.abs(currentVelValue - predictedVelValue) > Constants.COLLISION_VALUE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This current math just checks the magnitude of the velocities; it would be interesting if we could instead use vectors, and after subtracting the two vectors, we could do the vector.norm method to find the magnitude of the vector and then see if that's greater than the collision value squared. Now that I am also obsessed with optimization, this can be improved even further if we change the constant to constants. Collision_Value_squared and do Vector.dot(Vector), which is more efficient as the square root is computationally expensive. Alternatively, we can also do the two velocity vectors (gyro and odometry) and also dot them together, which will scale with both of their magnitudes and the angle between them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this apply deadband and have Max_Velocity as its third parameter instead? Also, why are we multiplying by Max_velocity /10? (This one i dont really know.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also branch needs to be tested.
|
sadly we found out that the accelerometer did not give us accurate data. We are looking into using a different IMU but for now we will just have to manage without this PR. |
Do you mean the NavX2? I heard the pigeon 2 might be better. |
Are accelerometers more accurate at getting accurate acceleration? Maybe we can use this instead of velocity as an alternative measurement. |
No description provided.