You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/docs/software/advanced-controls/fire-control/dynamic-shooting.rst
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,9 @@ The "inverted NASA logo" shape of the convergence envelope generally follows the
48
48
49
49
Convergence is worst in a direct sprint towards or away from the target - in these cases, shot solution is maximally-sensitive to errors in the robot velocity estimate. Direct lateral motion is also not great. Along the "maximum stability" geodesic, there are two "wings" of stable convergence; we can see that it is optimal (in terms of motion-compensation stability) to approach a target diagonally, rather than head-on.
50
50
51
-
Whether the "constant horizontal shot velocity" assumption is valid depends on the implicit shooting strategy of your look-up table; to achieve a look-up table whose convergence envelope looks *exactly* like the plot above, you would need to choose shots such that the horizontal component of the projectile velocity is constant. This may not be possible - or optimal - for your particular shooting mechanism; but the general shape of the convergence envelope for a modified shooting strategy will still "rhyme" with the simulation above.
51
+
The Effect of Firing Strategy
52
+
-----------------------------
53
+
54
+
Whether the "constant horizontal shot velocity" assumption is valid depends on the implicit firing strategy of your look-up table; to achieve a look-up table whose convergence envelope looks *exactly* like the plot above, you would need to choose shots such that the horizontal component of the projectile velocity is constant. This may not be possible - or optimal - for your particular shooting mechanism; but the general shape of the convergence envelope for a modified shooting strategy will still "rhyme" with the simulation above, unless you adopt a firing strategy that fundamentally changes the problem's ballistic geometry.
52
55
53
56
It is fairly easy to generate a convergence plot using your actual look-up table, if you wish to know the exact shape of the convergence envelope for your particular shooting strategy - simply run the recursion along a series of rays in velocity space, and plot the maximum velocity that converges within the given number of iterations for each ray (convergence is typically defined as the time-of-flight changing by less than a certain tolerance, though you can also just check that the final landing position is within a certain tolerance of the target).
This section describes how to design, populate, and use a look-up table (a "firing table") to aim at a stationary target from a stationary robot.
4
+
.. note:: A look-up table containing firing solutions is generally called a "firing table" in the professional literature; there is a *huge* amount of literature (much of it from the early 20th century) and a fascinating history around the computation of such tables. As we are not guiding artillery fire, we will use the more general term "look-up table" throughout this documentation.
5
+
6
+
This section describes how to design, populate, and use a look-up table to aim at a stationary target from a stationary robot.
5
7
6
8
The Problem
7
9
-----------
@@ -11,27 +13,36 @@ We ultimately want to launch the game piece on a trajectory that will end up in
11
13
1. Robots have a wide variety of shooting mechanisms, each with a specific relationship between their control variables (e.g. flywheel speed, hood angle, catapult release angle, etc.) and the trajectory of the game piece. In general, these relationships are nonlinear and complex.
12
14
2. Calculating an exact trajectory for the gamepiece is in general *also* nonlinear and complex, due to factors such as air resistance, spin effects, and other gamepiece-specific properties.
13
15
14
-
Any method that attempts to "directly solve" the problem by calculating an exact trajectory, and then working backwards from that to find the correct control variables, must solve both of the above problems.
15
-
16
-
But, there is a simpler way: we can just experimentally determine the control variables that we *observe* to result in scoring the game piece, from a variety of different starting positions. Then, to make a given shot, we can simply plug the starting position into the look-up table and use the corresponding control variables to reproduce the shot.
16
+
We could build mathematical models of both the shooting mechanism and the gamepiece's trajectory, and then solve the problem directly. But, it is much simpler to just use a static record of empirical solutions to this problem, as experimentally determined by a human operator - a **look-up table**. This collapses the complexity of both models into the behavior of the values in the table, effectively pre-computing the relevant physics of the problem in a way that removes the need for any further physical modeling in the runtime robot code.
17
17
18
18
Building the Look-Up Table
19
19
--------------------------
20
20
21
21
To build the look-up table, we need to:
22
22
23
-
1. Pick a set of positions that we will experimentally shoot from. This is setting the resolution of your table; in reality, your robot will never be exactly at a position that you recorded in the table, and you will have to interpolate between the recorded positions. The higher the resolution of the table, the more accurate your shooting will be, but the more data you will need to collect and the more time it will take to build the table. Generally, it is a good idea to start with a low resolution and increase it only if you observe that it is not sufficiently accurate.
24
-
2. "Dial in" the control variables that successfully score the game piece from each of the starting positions. Note that if your shooter is not consistent at this stage, then there is nothing the software can do to compensate for it; the mechanical quality of your shooter is always more important than the subtlety of the control software.
25
-
3. (Optional) Measure the time-of-flight of the gamepiece to the goal from each of the starting positions, and record it in the table along with the control variables. This is needed later, when we discuss shooting at moving targets or from a moving robot; recording this ahead-of-time reduces the amount of computation required at runtime, and improves the accuracy of the shoot-on-the-move algorithm.
23
+
1. Pick a set of distances to the target that we will experimentally shoot from. This is setting the resolution of your table; in reality, your robot will never be exactly at a distance that you recorded in the table, and you will have to interpolate between the recorded distances. The higher the resolution of the table, the more accurate your shooting will be, but the more data you will need to collect and the more time it will take to build the table. Generally, it is a good idea to start with a low resolution and increase it only if you observe that it is not sufficiently accurate.
24
+
2. "Dial in" the control variables that successfully score the game piece from each of the starting distances. Note that if your shooter is not consistent at this stage, then there is nothing the software can do to compensate for it; the mechanical quality of your shooter is always more important than the subtlety of the control software.
25
+
3. (Optional) Measure the time-of-flight of the gamepiece to the goal from each of the starting distances, and record it in the table along with the control variables. This is needed later, when we discuss shooting at moving targets or from a moving robot; recording this ahead-of-time reduces the amount of computation required at runtime, and improves the accuracy of the shoot-on-the-move algorithm.
26
26
27
27
Using the Look-Up Table
28
28
-----------------------
29
29
30
30
To use the look-up table, we:
31
31
32
-
1. Determine the relative position of the target from the robot. This tells us where on the look-up table to find the corresponding control variables for the shot. This will likely require some amount of vision processing or other sensor input.
33
-
2. Interpolate between the nearest recorded positions in the look-up table to find the corresponding control variables for the shot.
32
+
1. Determine the distance to the target from the robot. This tells us where on the look-up table to find the corresponding control variables for the shot. This will likely require some amount of vision processing or other sensor input.
33
+
2. Interpolate between the nearest recorded distances in the look-up table to find the corresponding control variables for the shot.
34
34
3. Set the control variables to the values found in the look-up table.
35
35
4. Shoot the game piece.
36
36
37
37
That's it. This might seem like a crude approach, but for most problems it works very well. Most shooting mechanisms have governing equations that, while complex, are still well-behaved enough (i.e., not chaotic, slowly-changing, etc.) that interpolating the look-up table is in fact a very good approximation of the exact solution.
38
+
39
+
Choosing a Firing Strategy
40
+
--------------------------
41
+
42
+
When we populate our look-up table, we are implicitly fixing a "firing strategy" for the robot. This is the set of control variables that we will use to shoot the game piece, for a given position, into the target. In general, there are *multiple* valid firing strategies for a given position, each with a different time-of-flight. We need to choose a firing strategy that is appropriate for the robot and the target.
43
+
44
+
For the stationary shot problem, the firing strategy determines how long the projectile will take to reach the target, and the amount of energy it will arrive with. Both of these may matter for the success of the shot, and so this should be chosen intentionally rather than haphazardly. Try multiple different firing strategies from each distance, and see which one works best for your robot and target.
45
+
46
+
The firing strategy may be different at different distances; there is no hard rule that says we must follow any particular pattern. However, if the firing strategy varies wildly with distance, it may be difficult to interpolate the look-up table accurately, and the resulting shooting accuracy will be poor. Therefore, you should be careful to choose firing strategies at each distance such that the shooter parameters are "nearby" those of neighboring points in the look-up table - essentially, the shooter parameters should be continuous and smooth as a function of distance.
47
+
48
+
As we will see in the next section, the firing strategy also has a profound effect on the behavior of motion compensation, since the amount of required motion compensation in the aiming of the shot varies with the amount of time the shot takes to reach the target (the longer the shot takes, the further offset the aim must be to compensate for motion).
0 commit comments