I have been thinking a bit about moving while shooting and trying to get it functioning on our robot. I just had some questions.
Current Algorithm
The method we have had experience with most is predicting forwards in time based on the time taken to shoot the note and the pose in the future based on that time. The algorithm in pseudocode is basically:
running_pose = get current pose
repeat 5 times {
current_robot_distance = get distance to speaker from running_pose
future_time = get the time it takes to shoot a note current_robot_distance
next_robot_pose = future_time * (get current velocity) + (get current pose)
running_pose = next_robot_pose
}
spinup and aim as if you were at running_pose
I am pretty sure that this algorithm should work, as it basically converges to a pose at a time in the future where shooting from that far in the future should take that same amount of time.
Does this algorithm make sense?
Delay Issue
An issue we have had is that even if this algorithm were to work, our robot is pretty heavy and also pretty underpowered acceleration wise (for some reason we’re running L4s on a max weight robot), and so without some sort of feedforward, PID constantly lags behind in terms of our robot rotation. Does anyone have a theoretical way of providing some feedforward to our robot so it doesn’t drag as far behind rotation wise?