Skip to content
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

Feat/shooting while moving #91

Draft
wants to merge 15 commits into
base: dev
Choose a base branch
from
Draft

Conversation

Inspirol
Copy link
Contributor

its here...

@mbardoe
Copy link
Contributor

mbardoe commented Mar 17, 2024

I am worried about trying to do this... I think that right way to do is to implement a Kalman Filter to guess what our speed is going to be in the near future, rather than using our current speed. In the past this was a big issue with trying to do shooting while moving. We were using the speed that was in the past, but the speed we use to calculate the aim is generally too laggy to be accurate.

Copy link
Contributor

@mbardoe mbardoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we are quite there yet. Even without the Kalman filter, you will need fix the way the current speeds are integrated into the flywheel. We need to consider vy.

@@ -90,7 +90,7 @@ class Scoring:

speaker_z = speaker_z_top #(speaker_z_top + speaker_z_bottom) / 2

speaker_x = speaker_depth / 2.5
speaker_x = speaker_depth / 1.5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this all about? What is speaker_depth?

rvx = self.get_drivetrain_speeds_field_origin().vx

rvs = rvx * np.cos(self.get_rotation_to_speaker().radians())

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am sure that vy is relevant here.

robot_pose_2d = self.odometry.getPose()
robot_pose_2d_w_speeds = robot_pose_2d + Transform2d(rvels.vx * t_total, rvels.vy * t_total, 0)
robot_to_speaker = speaker_translation - robot_pose_2d_w_speeds.translation()
return robot_to_speaker.angle()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this is all about. Can you explain it to me? Again. I think that we need to be thinking about where we WILL need to be aiming, rather than should be aiming right now. So we may need to be thinking ahead with Kalman filter thing.

@Inspirol
Copy link
Contributor Author

Yeah I figured as much. I forgot the vy, that's an easy change. This is definitely not something to complete before WNE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants