Maxwell Henderson | f582b14 | 2023-03-05 18:33:09 -0800 | [diff] [blame] | 1 | import sys |
| 2 | |
milind-u | 18a901d | 2023-02-17 21:51:55 -0800 | [diff] [blame] | 3 | import numpy as np |
Maxwell Henderson | f5123fe | 2023-02-04 13:44:41 -0800 | [diff] [blame] | 4 | |
milind-u | 18a901d | 2023-02-17 21:51:55 -0800 | [diff] [blame] | 5 | from y2023.control_loops.python.graph_tools import * |
Maxwell Henderson | f5123fe | 2023-02-04 13:44:41 -0800 | [diff] [blame] | 6 | |
Austin Schuh | 99dda68 | 2023-03-11 00:18:37 -0800 | [diff] [blame] | 7 | |
| 8 | def ThetaSegment(name, start, end): |
| 9 | control = np.array([(start[0] + end[0]) / 2.0, (start[1] + end[1]) / 2.0]) |
| 10 | return ThetaSplineSegment( |
| 11 | name=name, |
| 12 | start=start, |
| 13 | control1=control, |
| 14 | control2=control, |
| 15 | end=end, |
| 16 | ) |
| 17 | |
| 18 | |
Austin Schuh | 9a11ebd | 2023-02-26 14:16:31 -0800 | [diff] [blame] | 19 | named_segments = [] |
| 20 | points = {} |
Maxwell Henderson | f5123fe | 2023-02-04 13:44:41 -0800 | [diff] [blame] | 21 | |
Austin Schuh | 9a11ebd | 2023-02-26 14:16:31 -0800 | [diff] [blame] | 22 | points['Neutral'] = np.array((np.pi, 0.0, 0.0)) |
| 23 | |
| 24 | points['GroundPickupBackConeUp'] = to_theta_with_circular_index_and_roll( |
Maxwell Henderson | ce81612 | 2023-03-27 20:12:38 -0700 | [diff] [blame] | 25 | -1.07774334, 0.39, np.pi / 2.0, circular_index=1) |
Maxwell Henderson | 1ac7aac | 2023-02-23 17:35:32 -0800 | [diff] [blame] | 26 | |
Austin Schuh | 9a11ebd | 2023-02-26 14:16:31 -0800 | [diff] [blame] | 27 | named_segments.append( |
| 28 | ThetaSplineSegment( |
| 29 | name="NeutralToGroundPickupBackConeUp", |
| 30 | start=points['Neutral'], |
| 31 | control1=np.array([3.170156, -0.561227]), |
| 32 | control2=np.array([2.972776, -1.026820]), |
| 33 | end=points['GroundPickupBackConeUp'], |
milind-u | d11146f | 2023-03-25 18:36:47 -0700 | [diff] [blame] | 34 | control_alpha_rolls=[(.95, np.pi / 2.0)], |
Austin Schuh | 9a11ebd | 2023-02-26 14:16:31 -0800 | [diff] [blame] | 35 | )) |
| 36 | |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 37 | points['GroundPickupBackConeDownBase'] = to_theta_with_circular_index_and_roll( |
Maxwell Henderson | ce81612 | 2023-03-27 20:12:38 -0700 | [diff] [blame] | 38 | -1.11487594, 0.24, np.pi / 2.0, circular_index=1) |
milind-u | 68842e1 | 2023-02-26 12:45:40 -0800 | [diff] [blame] | 39 | |
Austin Schuh | 9a11ebd | 2023-02-26 14:16:31 -0800 | [diff] [blame] | 40 | named_segments.append( |
| 41 | ThetaSplineSegment( |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 42 | name="NeutralToGroundPickupBackConeDownBase", |
Austin Schuh | 9a11ebd | 2023-02-26 14:16:31 -0800 | [diff] [blame] | 43 | start=points['Neutral'], |
| 44 | control1=np.array([3.170156, -0.561227]), |
| 45 | control2=np.array([2.972776, -1.026820]), |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 46 | end=points['GroundPickupBackConeDownBase'], |
milind-u | d11146f | 2023-03-25 18:36:47 -0700 | [diff] [blame] | 47 | control_alpha_rolls=[(.95, np.pi / 2.0)], |
Austin Schuh | 9a11ebd | 2023-02-26 14:16:31 -0800 | [diff] [blame] | 48 | )) |
| 49 | |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 50 | points[ |
| 51 | 'GroundPickupFrontConeDownBase'] = to_theta_with_circular_index_and_roll( |
Maxwell Henderson | ce81612 | 2023-03-27 20:12:38 -0700 | [diff] [blame] | 52 | 0.30, 0.265, -np.pi / 2.0, circular_index=0) |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 53 | |
| 54 | named_segments.append( |
| 55 | ThetaSplineSegment( |
| 56 | name="NeutralToGroundPickupFrontConeDownBase", |
| 57 | start=points['Neutral'], |
| 58 | control1=np.array([3.495221564200401, 0.4737763579250964]), |
| 59 | control2=np.array([4.110392601248856, 1.0424853539638115]), |
| 60 | end=points['GroundPickupFrontConeDownBase'], |
milind-u | d11146f | 2023-03-25 18:36:47 -0700 | [diff] [blame] | 61 | control_alpha_rolls=[(.95, -np.pi / 2.0)], |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 62 | )) |
| 63 | |
| 64 | points['ScoreFrontLowConeDownBase'] = to_theta_with_circular_index_and_roll( |
| 65 | 0.328533, 0.40, -np.pi / 2.0, circular_index=0) |
| 66 | |
| 67 | named_segments.append( |
| 68 | ThetaSplineSegment( |
| 69 | name="NeutralToScoreFrontLowConeDownBase", |
| 70 | start=points['Neutral'], |
| 71 | control1=np.array([3.153481004695907, 0.4827717171390571]), |
| 72 | control2=np.array([4.107487625131798, 0.9935705415901082]), |
| 73 | end=points['ScoreFrontLowConeDownBase'], |
| 74 | control_alpha_rolls=[(0.30, 0.0), (.95, -np.pi / 2.0)], |
| 75 | )) |
| 76 | |
| 77 | points['ScoreFrontMidConeDownBase'] = to_theta_with_circular_index_and_roll( |
| 78 | 0.697179, 0.88, -np.pi / 2.0, circular_index=0) |
| 79 | |
| 80 | named_segments.append( |
| 81 | ThetaSplineSegment( |
| 82 | name="NeutralToScoreFrontMidConeDownBase", |
| 83 | start=points['Neutral'], |
| 84 | control1=np.array([3.2296966803523395, 0.4274365560093907]), |
| 85 | control2=np.array([3.111677631381042, 0.6783534686461494]), |
| 86 | end=points['ScoreFrontMidConeDownBase'], |
| 87 | control_alpha_rolls=[(0.30, 0.0), (.95, -np.pi / 2.0)], |
| 88 | )) |
| 89 | |
Austin Schuh | 99dda68 | 2023-03-11 00:18:37 -0800 | [diff] [blame] | 90 | points['ScoreBackLowConeDownTip'] = to_theta_with_circular_index_and_roll( |
| 91 | -1.17422, 0.441203, np.pi / 2.0, circular_index=1) |
| 92 | |
| 93 | named_segments.append( |
| 94 | ThetaSplineSegment( |
| 95 | name="NeutralToScoreBackLowConeDownTip", |
| 96 | start=points['Neutral'], |
| 97 | control1=np.array([3.0959727041167358, -0.48933188185224896]), |
| 98 | control2=np.array([3.11854219540683, -1.0398000886366843]), |
| 99 | end=points['ScoreBackLowConeDownTip'], |
| 100 | control_alpha_rolls=[(0.20, 0.0), (.95, np.pi / 2.0)], |
| 101 | )) |
| 102 | |
| 103 | points['ScoreFrontLowConeDownTip'] = to_theta_with_circular_index_and_roll( |
| 104 | 0.327783, 0.430704, np.pi / 2.0, circular_index=0) |
| 105 | |
| 106 | named_segments.append( |
| 107 | ThetaSplineSegment( |
| 108 | name="NeutralToScoreFrontLowConeDownTip", |
| 109 | start=points['Neutral'], |
| 110 | control1=np.array([3.6217558044411176, 0.6335548380532725]), |
| 111 | control2=np.array([4.2557660430407935, 1.0411926555706872]), |
| 112 | end=points['ScoreFrontLowConeDownTip'], |
Maxwell Henderson | 5e7dc57 | 2023-03-23 11:39:59 -0700 | [diff] [blame] | 113 | control_alpha_rolls=[(0.30, 0.0), (.95, np.pi / 2.0)], |
Austin Schuh | 99dda68 | 2023-03-11 00:18:37 -0800 | [diff] [blame] | 114 | )) |
| 115 | |
| 116 | points['ScoreBackMidConeDownTip'] = to_theta_with_circular_index_and_roll( |
| 117 | -1.49, 0.818521, -np.pi / 2.0, circular_index=1) |
| 118 | |
| 119 | named_segments.append( |
| 120 | ThetaSplineSegment( |
| 121 | name="NeutralToScoreBackMidConeDownTip", |
| 122 | start=points['Neutral'], |
| 123 | control1=np.array([3.193704394908777, -0.46076706416611657]), |
| 124 | control2=np.array([3.6421839688861786, -0.8129214904599373]), |
| 125 | end=points['ScoreBackMidConeDownTip'], |
| 126 | control_alpha_rolls=[(0.20, 0.0), (.95, -np.pi / 2.0)], |
| 127 | )) |
| 128 | |
| 129 | points[ |
| 130 | 'ScoreBackMidConeDownTipPlaced'] = to_theta_with_circular_index_and_roll( |
| 131 | -1.43, 0.65, -np.pi / 2.0, circular_index=1) |
| 132 | |
| 133 | named_segments.append( |
| 134 | ThetaSplineSegment( |
| 135 | name="NeutralToScoreBackMidConeDownTipPlaced", |
| 136 | start=points['Neutral'], |
| 137 | control1=np.array([3.193704394908777, -0.46076706416611657]), |
| 138 | control2=np.array([3.6421839688861786, -0.8129214904599373]), |
| 139 | end=points['ScoreBackMidConeDownTipPlaced'], |
| 140 | control_alpha_rolls=[(0.20, 0.0), (.95, -np.pi / 2.0)], |
| 141 | )) |
| 142 | |
| 143 | named_segments.append( |
| 144 | ThetaSegment( |
| 145 | name="ScoreBackMidConeDownTipToScoreBackMidConeDownTipPlaced", |
| 146 | start=points['ScoreBackMidConeDownTip'], |
| 147 | end=points['ScoreBackMidConeDownTipPlaced'], |
| 148 | )) |
| 149 | |
| 150 | points['ScoreFrontMidConeDownTip'] = np.array( |
| 151 | (6.37001629521978, 2.04450540030891, np.pi / 2.0)) |
| 152 | #to_theta_with_circular_index_and_roll( |
| 153 | #0.708449, 0.869738, np.pi / 2.0, circular_index=1) |
| 154 | |
| 155 | named_segments.append( |
| 156 | ThetaSplineSegment( |
| 157 | name="NeutralToScoreFrontMidConeDownTip", |
| 158 | start=points['Neutral'], |
| 159 | control1=np.array([4.579377666056791, 0.3789471836198275]), |
| 160 | control2=np.array([5.140992799899862, 1.5135884307866865]), |
| 161 | end=points['ScoreFrontMidConeDownTip'], |
| 162 | control_alpha_rolls=[(0.50, 0.0), (.95, np.pi / 2.0)], |
| 163 | )) |
| 164 | |
| 165 | points['ScoreFrontMidConeDownTipPlaced'] = np.array( |
| 166 | (6.42001629521978, 2.30450540030891, np.pi / 2.0)) |
| 167 | |
| 168 | named_segments.append( |
| 169 | ThetaSplineSegment( |
| 170 | name="NeutralToScoreFrontMidConeDownTipPlaced", |
| 171 | start=points['Neutral'], |
| 172 | control1=np.array([4.579377666056791, 0.3789471836198275]), |
| 173 | control2=np.array([5.140992799899862, 1.5135884307866865]), |
| 174 | end=points['ScoreFrontMidConeDownTipPlaced'], |
| 175 | control_alpha_rolls=[(0.50, 0.0), (.95, np.pi / 2.0)], |
| 176 | )) |
| 177 | |
| 178 | named_segments.append( |
| 179 | ThetaSegment( |
| 180 | name="ScoreFrontMidConeDownTipToScoreFrontMidConeDownTipPlaced", |
| 181 | start=points['ScoreFrontMidConeDownTip'], |
| 182 | end=points['ScoreFrontMidConeDownTipPlaced'], |
| 183 | )) |
| 184 | |
| 185 | points['ScoreFrontHighConeDownTip'] = np.array( |
| 186 | (7.07190783461154, 1.55094570328448, np.pi / 2.0)) |
| 187 | #to_theta_with_circular_index_and_roll( |
| 188 | #0.708449, 0.869738, np.pi / 2.0, circular_index=1) |
| 189 | |
| 190 | named_segments.append( |
| 191 | ThetaSplineSegment( |
| 192 | name="NeutralToScoreFrontHighConeDownTip", |
| 193 | start=points['Neutral'], |
| 194 | control1=np.array([4.579377666056791, 0.3789471836198275]), |
| 195 | control2=np.array([5.140992799899862, 1.5135884307866865]), |
| 196 | end=points['ScoreFrontHighConeDownTip'], |
| 197 | control_alpha_rolls=[(0.50, 0.0), (.95, np.pi / 2.0)], |
| 198 | )) |
| 199 | |
| 200 | points['ScoreFrontHighConeDownTipPlaced'] = np.array( |
| 201 | (6.93190783461154, 1.80094570328448, np.pi / 2.0)) |
| 202 | |
| 203 | named_segments.append( |
| 204 | ThetaSplineSegment( |
| 205 | name="NeutralToScoreFrontHighConeDownTipPlaced", |
| 206 | start=points['Neutral'], |
| 207 | control1=np.array([5.997741842590495, 1.8354263885166913]), |
| 208 | control2=np.array([6.141018843972322, 1.0777341552037734]), |
| 209 | end=points['ScoreFrontHighConeDownTipPlaced'], |
Maxwell Henderson | 22f9798 | 2023-03-12 19:06:37 -0700 | [diff] [blame] | 210 | control_alpha_rolls=[(0.30, 0.0), (.95, np.pi / 2.0)], |
Austin Schuh | 99dda68 | 2023-03-11 00:18:37 -0800 | [diff] [blame] | 211 | )) |
| 212 | |
| 213 | named_segments.append( |
| 214 | ThetaSegment( |
| 215 | name="ScoreFrontHighConeDownTipToScoreFrontHighConeDownTipPlaced", |
| 216 | start=points['ScoreFrontHighConeDownTip'], |
| 217 | end=points['ScoreFrontHighConeDownTipPlaced'], |
| 218 | )) |
| 219 | |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 220 | points['ScoreFrontHighConeDownBase'] = to_theta_with_circular_index_and_roll( |
| 221 | 1.04686, 1.13243, -np.pi / 2.0, circular_index=0) |
| 222 | |
| 223 | named_segments.append( |
| 224 | ThetaSplineSegment( |
| 225 | name="NeutralToScoreFrontHighConeDownBase", |
| 226 | start=points['Neutral'], |
| 227 | control1=np.array([2.7653359284612185, 0.3091554519868296]), |
| 228 | control2=np.array([2.6035409027556344, 0.5009078441624968]), |
| 229 | end=points['ScoreFrontHighConeDownBase'], |
| 230 | control_alpha_rolls=[(0.30, 0.0), (.95, -np.pi / 2.0)], |
| 231 | )) |
| 232 | |
Austin Schuh | 9a11ebd | 2023-02-26 14:16:31 -0800 | [diff] [blame] | 233 | points['GroundPickupBackCube'] = to_theta_with_circular_index_and_roll( |
Austin Schuh | 99dda68 | 2023-03-11 00:18:37 -0800 | [diff] [blame] | 234 | -1.102, 0.28, -np.pi / 2.0, circular_index=1) |
Maxwell Henderson | 1ac7aac | 2023-02-23 17:35:32 -0800 | [diff] [blame] | 235 | |
Austin Schuh | 9a11ebd | 2023-02-26 14:16:31 -0800 | [diff] [blame] | 236 | named_segments.append( |
| 237 | ThetaSplineSegment( |
| 238 | name="NeutralToGroundPickupBackCube", |
| 239 | start=points['Neutral'], |
| 240 | control1=np.array([3.153228, -0.497009]), |
| 241 | control2=np.array([2.972776, -1.026820]), |
| 242 | end=points['GroundPickupBackCube'], |
milind-u | d11146f | 2023-03-25 18:36:47 -0700 | [diff] [blame] | 243 | control_alpha_rolls=[(.9, -np.pi / 2.0)], |
Austin Schuh | 9a11ebd | 2023-02-26 14:16:31 -0800 | [diff] [blame] | 244 | )) |
| 245 | |
Austin Schuh | 9b3e41c | 2023-02-26 22:29:53 -0800 | [diff] [blame] | 246 | points['GroundPickupFrontCube'] = to_theta_with_circular_index_and_roll( |
| 247 | 0.325603, 0.255189, np.pi / 2.0, circular_index=0) |
| 248 | |
| 249 | named_segments.append( |
| 250 | ThetaSplineSegment( |
| 251 | name="NeutralToGroundPickupFrontCube", |
| 252 | start=points['Neutral'], |
| 253 | control1=np.array([3.338852196583635, 0.34968650009090885]), |
| 254 | control2=np.array([4.28246270189025, 1.492916470137478]), |
| 255 | end=points['GroundPickupFrontCube'], |
milind-u | d11146f | 2023-03-25 18:36:47 -0700 | [diff] [blame] | 256 | control_alpha_rolls=[(.9, np.pi / 2.0)], |
Austin Schuh | 9b3e41c | 2023-02-26 22:29:53 -0800 | [diff] [blame] | 257 | )) |
| 258 | |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 259 | points['ScoreBackMidConeUp'] = to_theta_with_circular_index_and_roll( |
Maxwell Henderson | ce81612 | 2023-03-27 20:12:38 -0700 | [diff] [blame] | 260 | -1.45013, 1.00354, np.pi / 2.0, circular_index=1) |
Maxwell Henderson | 1ac7aac | 2023-02-23 17:35:32 -0800 | [diff] [blame] | 261 | |
Austin Schuh | 9a11ebd | 2023-02-26 14:16:31 -0800 | [diff] [blame] | 262 | named_segments.append( |
| 263 | ThetaSplineSegment( |
| 264 | name="NeutralToBackMidConeUpScore", |
| 265 | start=points['Neutral'], |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 266 | control1=np.array([3.6130298244820453, -0.2781204657180023]), |
| 267 | control2=np.array([3.804763224169111, -0.5179424890517237]), |
| 268 | end=points['ScoreBackMidConeUp'], |
Austin Schuh | f4c3da3 | 2023-03-25 20:04:55 -0700 | [diff] [blame] | 269 | control_alpha_rolls=[(.95, np.pi / 2.0)], |
Austin Schuh | 9a11ebd | 2023-02-26 14:16:31 -0800 | [diff] [blame] | 270 | )) |
| 271 | |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 272 | points['ScoreBackLowConeUp'] = to_theta_with_circular_index_and_roll( |
Maxwell Henderson | 5e7dc57 | 2023-03-23 11:39:59 -0700 | [diff] [blame] | 273 | -1.00472, 0.472615, np.pi / 2.0, circular_index=1) |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 274 | |
| 275 | named_segments.append( |
| 276 | ThetaSplineSegment( |
| 277 | name="NeutralToBackLowConeUpScore", |
| 278 | start=points['Neutral'], |
| 279 | control1=np.array([3.260123029490386, -0.5296803702636037]), |
| 280 | control2=np.array([3.1249665389044283, -0.7810758529482493]), |
| 281 | end=points['ScoreBackLowConeUp'], |
Austin Schuh | f4c3da3 | 2023-03-25 20:04:55 -0700 | [diff] [blame] | 282 | control_alpha_rolls=[(.95, np.pi / 2.0)], |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 283 | )) |
| 284 | |
| 285 | named_segments.append( |
| 286 | ThetaSplineSegment( |
| 287 | name="GroundPickupBackConeUpToBackLowConeUpScore", |
| 288 | start=points['GroundPickupBackConeUp'], |
| 289 | control1=np.array([2.943017165830755, -1.3740647485244808]), |
| 290 | control2=np.array([2.941104610508278, -1.2434759967435083]), |
| 291 | end=points['ScoreBackLowConeUp'], |
| 292 | control_alpha_rolls=[], |
| 293 | )) |
| 294 | |
| 295 | named_segments.append( |
| 296 | ThetaSplineSegment( |
| 297 | name="ScoreBackLowConeUpToScoreBackMidConeUp", |
| 298 | start=points['ScoreBackLowConeUp'], |
| 299 | control1=np.array([3.2930271753937728, -0.9256552441650734]), |
| 300 | control2=np.array([3.6425461598470568, -0.8085366888146934]), |
| 301 | end=points['ScoreBackMidConeUp'], |
| 302 | control_alpha_rolls=[], |
| 303 | )) |
| 304 | |
| 305 | points['ScoreBackMidConeDownBase'] = to_theta_with_circular_index_and_roll( |
Austin Schuh | 99dda68 | 2023-03-11 00:18:37 -0800 | [diff] [blame] | 306 | -1.37792406, 0.87332449, np.pi / 2.0, circular_index=1) |
Maxwell Henderson | 1ac7aac | 2023-02-23 17:35:32 -0800 | [diff] [blame] | 307 | |
Austin Schuh | 9a11ebd | 2023-02-26 14:16:31 -0800 | [diff] [blame] | 308 | named_segments.append( |
| 309 | ThetaSplineSegment( |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 310 | name="NeutralToMidConeDownBaseScore", |
Austin Schuh | 9a11ebd | 2023-02-26 14:16:31 -0800 | [diff] [blame] | 311 | start=points['Neutral'], |
| 312 | control1=np.array([3.394572, -0.239378]), |
| 313 | control2=np.array([3.654854, -0.626835]), |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 314 | end=points['ScoreBackMidConeDownBase'], |
| 315 | control_alpha_rolls=[(0.40, 0.0), (.95, np.pi / 2.0)], |
| 316 | )) |
| 317 | |
| 318 | points['ScoreBackLowConeDownBase'] = to_theta_with_circular_index_and_roll( |
| 319 | -1.06372, 0.442764, np.pi / 2.0, circular_index=1) |
| 320 | |
| 321 | named_segments.append( |
| 322 | ThetaSplineSegment( |
| 323 | name="NeutralToLowConeDownBaseScore", |
| 324 | start=points['Neutral'], |
| 325 | control1=np.array([2.8613439132427896, -0.5868069120126034]), |
| 326 | control2=np.array([2.9041434685529923, -1.240030040719494]), |
| 327 | end=points['ScoreBackLowConeDownBase'], |
Austin Schuh | 9a11ebd | 2023-02-26 14:16:31 -0800 | [diff] [blame] | 328 | control_alpha_rolls=[(0.40, 0.0), (.95, np.pi / 2.0)], |
| 329 | )) |
| 330 | |
| 331 | points['HPPickupBackConeUp'] = to_theta_with_circular_index_and_roll( |
Austin Schuh | aa4ab7e | 2023-04-09 22:19:38 -0700 | [diff] [blame^] | 332 | -1.1200539, 1.325, np.pi / 2.0, circular_index=0) |
Maxwell Henderson | 1ac7aac | 2023-02-23 17:35:32 -0800 | [diff] [blame] | 333 | |
Austin Schuh | 9a11ebd | 2023-02-26 14:16:31 -0800 | [diff] [blame] | 334 | named_segments.append( |
| 335 | ThetaSplineSegment( |
| 336 | name="NeutralToHPPickupBackConeUp", |
| 337 | start=points['Neutral'], |
Austin Schuh | f4c3da3 | 2023-03-25 20:04:55 -0700 | [diff] [blame] | 338 | control1=np.array([2.7014360412658567, -0.32490272351246796]), |
| 339 | control2=np.array([0.8282769211604871, -1.8026615176254461]), |
Austin Schuh | 9a11ebd | 2023-02-26 14:16:31 -0800 | [diff] [blame] | 340 | end=points['HPPickupBackConeUp'], |
milind-u | d11146f | 2023-03-25 18:36:47 -0700 | [diff] [blame] | 341 | control_alpha_rolls=[(.9, np.pi / 2.0)], |
Maxwell Henderson | 5e7dc57 | 2023-03-23 11:39:59 -0700 | [diff] [blame] | 342 | alpha_unitizer=np.matrix( |
milind-u | d11146f | 2023-03-25 18:36:47 -0700 | [diff] [blame] | 343 | f"{1.0 / 15.0} 0 0; 0 {1.0 / 15.0} 0; 0 0 {1.0 / 100.0}"), |
Austin Schuh | 9a11ebd | 2023-02-26 14:16:31 -0800 | [diff] [blame] | 344 | )) |
| 345 | |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 346 | points['HPPickupFrontConeUp'] = np.array( |
Maxwell Henderson | ce81612 | 2023-03-27 20:12:38 -0700 | [diff] [blame] | 347 | (5.16514378449353, 1.25, -np.pi / 2.0)) |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 348 | # to_theta_with_circular_index_and_roll( |
| 349 | # 0.265749, 1.28332, -np.pi / 2.0, circular_index=1) |
| 350 | |
| 351 | named_segments.append( |
| 352 | ThetaSplineSegment( |
| 353 | name="NeutralToHPPickupFrontConeUp", |
| 354 | start=points['Neutral'], |
milind-u | d11146f | 2023-03-25 18:36:47 -0700 | [diff] [blame] | 355 | control1=np.array([3.7428100581067785, 0.3957215032198551]), |
| 356 | control2=np.array([4.349242198354247, 0.8724403878333801]), |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 357 | end=points['HPPickupFrontConeUp'], |
milind-u | d11146f | 2023-03-25 18:36:47 -0700 | [diff] [blame] | 358 | control_alpha_rolls=[(.8, -np.pi / 2.0)], |
Maxwell Henderson | 5e7dc57 | 2023-03-23 11:39:59 -0700 | [diff] [blame] | 359 | alpha_unitizer=np.matrix( |
milind-u | d11146f | 2023-03-25 18:36:47 -0700 | [diff] [blame] | 360 | f"{1.0 / 15.0} 0 0; 0 {1.0 / 15.0} 0; 0 0 {1.0 / 70.0}"), |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 361 | )) |
| 362 | |
| 363 | points['ScoreFrontHighConeUp'] = to_theta_with_circular_index_and_roll( |
Maxwell Henderson | ce81612 | 2023-03-27 20:12:38 -0700 | [diff] [blame] | 364 | 0.98810344, 1.31536719, -np.pi / 2.0, circular_index=0) |
Maxwell Henderson | 1ac7aac | 2023-02-23 17:35:32 -0800 | [diff] [blame] | 365 | |
Austin Schuh | 9a11ebd | 2023-02-26 14:16:31 -0800 | [diff] [blame] | 366 | named_segments.append( |
| 367 | ThetaSplineSegment( |
| 368 | name="NeutralToFrontHighConeUpScore", |
| 369 | start=points['Neutral'], |
| 370 | control1=np.array([2.594244, 0.417442]), |
| 371 | control2=np.array([1.51325, 0.679748]), |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 372 | end=points['ScoreFrontHighConeUp'], |
milind-u | d11146f | 2023-03-25 18:36:47 -0700 | [diff] [blame] | 373 | control_alpha_rolls=[(.95, -np.pi / 2.0)], |
Austin Schuh | 9a11ebd | 2023-02-26 14:16:31 -0800 | [diff] [blame] | 374 | )) |
| 375 | |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 376 | points['ScoreFrontMidConeUp'] = to_theta_with_circular_index_and_roll( |
Maxwell Henderson | ce81612 | 2023-03-27 20:12:38 -0700 | [diff] [blame] | 377 | 0.64, 0.99, -np.pi / 2.0, circular_index=0) |
Maxwell Henderson | 1ac7aac | 2023-02-23 17:35:32 -0800 | [diff] [blame] | 378 | |
Austin Schuh | 9a11ebd | 2023-02-26 14:16:31 -0800 | [diff] [blame] | 379 | named_segments.append( |
| 380 | ThetaSplineSegment( |
| 381 | name="NeutralToFrontMidConeUpScore", |
| 382 | start=points['Neutral'], |
| 383 | control1=np.array([3.0, 0.317442]), |
| 384 | control2=np.array([2.9, 0.479748]), |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 385 | end=points['ScoreFrontMidConeUp'], |
milind-u | d11146f | 2023-03-25 18:36:47 -0700 | [diff] [blame] | 386 | control_alpha_rolls=[(.95, -np.pi / 2.0)], |
Austin Schuh | 9a11ebd | 2023-02-26 14:16:31 -0800 | [diff] [blame] | 387 | )) |
Maxwell Henderson | 1ac7aac | 2023-02-23 17:35:32 -0800 | [diff] [blame] | 388 | |
Austin Schuh | 700bfff | 2023-04-05 19:45:55 -0700 | [diff] [blame] | 389 | points['Starting'] = np.array((np.pi, -0.15, 0.0)) |
Maxwell Henderson | 3d0beaf | 2023-03-23 11:32:44 -0700 | [diff] [blame] | 390 | |
Austin Schuh | 90e655c | 2023-03-11 20:19:53 -0800 | [diff] [blame] | 391 | points['ScoreFrontMidConeUpAuto'] = to_theta_with_circular_index_and_roll( |
| 392 | 0.58, 0.97, -np.pi / 2.0, circular_index=0) |
| 393 | |
| 394 | named_segments.append( |
| 395 | ThetaSplineSegment( |
Maxwell Henderson | 3d0beaf | 2023-03-23 11:32:44 -0700 | [diff] [blame] | 396 | name="StartingToScoreFrontMidConeUpAuto", |
| 397 | start=points['Starting'], |
Austin Schuh | 90e655c | 2023-03-11 20:19:53 -0800 | [diff] [blame] | 398 | control1=np.array([2.99620794024176, 0.23620211875551145]), |
| 399 | control2=np.array([2.728197531599509, 0.5677148040671784]), |
| 400 | end=points['ScoreFrontMidConeUpAuto'], |
Austin Schuh | 700bfff | 2023-04-05 19:45:55 -0700 | [diff] [blame] | 401 | control_alpha_rolls=[(.85, -np.pi / 2.0)], |
Maxwell Henderson | 17365e5 | 2023-03-11 20:34:59 -0800 | [diff] [blame] | 402 | vmax=10.0, |
| 403 | alpha_unitizer=np.matrix( |
| 404 | f"{1.0 / 20.0} 0 0; 0 {1.0 / 25.0} 0; 0 0 {1.0 / 100.0}"), |
Austin Schuh | 90e655c | 2023-03-11 20:19:53 -0800 | [diff] [blame] | 405 | )) |
| 406 | |
| 407 | named_segments.append( |
| 408 | ThetaSplineSegment( |
| 409 | name="ScoreFrontMidConeUpAutoToGroundPickupBackCube", |
| 410 | start=points['ScoreFrontMidConeUpAuto'], |
| 411 | control1=np.array([3.1869633311848187, 0.2812689595803919]), |
| 412 | control2=np.array([2.906100237354555, -0.7760928122326023]), |
| 413 | end=points['GroundPickupBackCube'], |
| 414 | control_alpha_rolls=[(0.40, 0.0), (0.60, 0.0)], |
| 415 | )) |
| 416 | |
Austin Schuh | 9b3e41c | 2023-02-26 22:29:53 -0800 | [diff] [blame] | 417 | points['ScoreFrontLowCube'] = to_theta_with_circular_index_and_roll( |
Austin Schuh | 99dda68 | 2023-03-11 00:18:37 -0800 | [diff] [blame] | 418 | 0.325603, 0.39, np.pi / 2.0, circular_index=0) |
Austin Schuh | 9b3e41c | 2023-02-26 22:29:53 -0800 | [diff] [blame] | 419 | |
| 420 | named_segments.append( |
| 421 | ThetaSplineSegment( |
| 422 | name="NeutralToScoreFrontLowCube", |
| 423 | start=points['Neutral'], |
| 424 | control1=np.array([3.338852196583635, 0.34968650009090885]), |
| 425 | control2=np.array([4.28246270189025, 1.492916470137478]), |
| 426 | end=points['ScoreFrontLowCube'], |
milind-u | d11146f | 2023-03-25 18:36:47 -0700 | [diff] [blame] | 427 | control_alpha_rolls=[(.9, np.pi / 2.0)], |
Austin Schuh | 9b3e41c | 2023-02-26 22:29:53 -0800 | [diff] [blame] | 428 | )) |
| 429 | |
Austin Schuh | 9b3e41c | 2023-02-26 22:29:53 -0800 | [diff] [blame] | 430 | points['ScoreFrontMidCube'] = to_theta_with_circular_index_and_roll( |
| 431 | 0.517846, 0.87, np.pi / 2.0, circular_index=0) |
| 432 | |
| 433 | named_segments.append( |
| 434 | ThetaSplineSegment( |
| 435 | name="NeutralToScoreFrontMidCube", |
| 436 | start=points["Neutral"], |
| 437 | control1=np.array([3.1310824883477952, 0.23591705727105095]), |
| 438 | control2=np.array([3.0320025094685965, 0.43674789928668933]), |
| 439 | end=points["ScoreFrontMidCube"], |
milind-u | d11146f | 2023-03-25 18:36:47 -0700 | [diff] [blame] | 440 | control_alpha_rolls=[(0.95, np.pi * 0.5)], |
Austin Schuh | 9b3e41c | 2023-02-26 22:29:53 -0800 | [diff] [blame] | 441 | )) |
| 442 | |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 443 | named_segments.append( |
| 444 | ThetaSplineSegment( |
| 445 | name="ScoreFrontLowCubeToScoreFrontMidCube", |
| 446 | start=points["ScoreFrontLowCube"], |
| 447 | control1=np.array([3.8237323383577078, 1.2979562720646056]), |
| 448 | control2=np.array([3.63484177908944, 1.008850428344438]), |
| 449 | end=points["ScoreFrontMidCube"], |
| 450 | control_alpha_rolls=[], |
| 451 | )) |
| 452 | |
Austin Schuh | 9b3e41c | 2023-02-26 22:29:53 -0800 | [diff] [blame] | 453 | points['ScoreFrontHighCube'] = to_theta_with_circular_index_and_roll( |
| 454 | 0.901437, 1.16, np.pi / 2.0, circular_index=0) |
| 455 | |
| 456 | named_segments.append( |
| 457 | ThetaSplineSegment( |
| 458 | name="NeutralToScoreFrontHighCube", |
| 459 | start=points["Neutral"], |
| 460 | control1=np.array([2.537484161662287, 0.059700523547219]), |
| 461 | control2=np.array([2.449391812539668, 0.4141564369176016]), |
| 462 | end=points["ScoreFrontHighCube"], |
milind-u | d11146f | 2023-03-25 18:36:47 -0700 | [diff] [blame] | 463 | control_alpha_rolls=[(0.95, np.pi * 0.5)], |
Austin Schuh | 9b3e41c | 2023-02-26 22:29:53 -0800 | [diff] [blame] | 464 | )) |
| 465 | |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 466 | named_segments.append( |
| 467 | ThetaSplineSegment( |
| 468 | name="ScoreFrontMidCubeToScoreFrontHighCube", |
| 469 | start=points["ScoreFrontMidCube"], |
| 470 | control1=np.array([2.9229652375897004, 0.7771801809056819]), |
| 471 | control2=np.array([2.634276444896239, 0.5696525540129302]), |
| 472 | end=points["ScoreFrontHighCube"], |
| 473 | control_alpha_rolls=[], |
| 474 | )) |
| 475 | |
| 476 | points['ScoreBackLowCube'] = to_theta_with_circular_index_and_roll( |
Maxwell Henderson | 5e7dc57 | 2023-03-23 11:39:59 -0700 | [diff] [blame] | 477 | -1.102, 0.3712121, -np.pi / 2.0, circular_index=1) |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 478 | |
| 479 | named_segments.append( |
| 480 | ThetaSplineSegment( |
| 481 | name="NeutralToScoreLowBackCube", |
| 482 | start=points['Neutral'], |
| 483 | control1=np.array([3.153228, -0.497009]), |
| 484 | control2=np.array([2.972776, -1.026820]), |
| 485 | end=points['ScoreBackLowCube'], |
| 486 | control_alpha_rolls=[(0.7, 0.0), (.9, -np.pi / 2.0)], |
| 487 | )) |
| 488 | |
Austin Schuh | 9b3e41c | 2023-02-26 22:29:53 -0800 | [diff] [blame] | 489 | points['ScoreBackMidCube'] = to_theta_with_circular_index_and_roll( |
| 490 | -1.27896, 0.84, -np.pi / 2.0, circular_index=1) |
| 491 | |
| 492 | named_segments.append( |
| 493 | ThetaSplineSegment( |
| 494 | name="NeutralToScoreBackMidCube", |
| 495 | start=points["Neutral"], |
| 496 | control1=np.array([3.3485646154655404, -0.4369603013926491]), |
| 497 | control2=np.array([3.2653593368256995, -0.789587049476034]), |
| 498 | end=points["ScoreBackMidCube"], |
milind-u | d11146f | 2023-03-25 18:36:47 -0700 | [diff] [blame] | 499 | control_alpha_rolls=[(0.95, -np.pi * 0.5)], |
Austin Schuh | 9b3e41c | 2023-02-26 22:29:53 -0800 | [diff] [blame] | 500 | )) |
| 501 | |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 502 | named_segments.append( |
| 503 | ThetaSplineSegment( |
| 504 | name="ScoreBackLowCubeToScoreBackMidCube", |
| 505 | start=points["ScoreBackLowCube"], |
| 506 | control1=np.array([3.1075630474968694, -1.1675095818664531]), |
| 507 | control2=np.array([3.3377520447373232, -1.1054408842366303]), |
| 508 | end=points["ScoreBackMidCube"], |
| 509 | control_alpha_rolls=[], |
| 510 | )) |
| 511 | |
Austin Schuh | 9b3e41c | 2023-02-26 22:29:53 -0800 | [diff] [blame] | 512 | # TODO(austin): This doesn't produce the next line... |
| 513 | #points['ScoreBackHighCube'] = to_theta_with_circular_index_and_roll( |
| 514 | # -1.60932, 1.16839, np.pi / 2.0, circular_index=0) |
| 515 | points['ScoreBackHighCube'] = np.array( |
| 516 | (4.77284735761704, -1.19952193130714, -np.pi / 2.0)) |
| 517 | |
| 518 | named_segments.append( |
| 519 | ThetaSplineSegment( |
| 520 | name="NeutralToScoreBackHighCube", |
| 521 | start=points["Neutral"], |
| 522 | control1=np.array([3.6804854484103684, -0.3494541095053125]), |
| 523 | control2=np.array([3.9889380578509517, -0.6637934755748516]), |
| 524 | end=points["ScoreBackHighCube"], |
milind-u | d11146f | 2023-03-25 18:36:47 -0700 | [diff] [blame] | 525 | control_alpha_rolls=[(0.95, -np.pi * 0.5)], |
Austin Schuh | 9b3e41c | 2023-02-26 22:29:53 -0800 | [diff] [blame] | 526 | )) |
| 527 | |
Austin Schuh | 9a11ebd | 2023-02-26 14:16:31 -0800 | [diff] [blame] | 528 | named_segments.append( |
| 529 | ThetaSplineSegment( |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 530 | name="ScoreBackMidCubeToScoreBackHighCube", |
| 531 | start=points["ScoreBackMidCube"], |
| 532 | control1=np.array([4.03651864313893, -0.919229198708873]), |
| 533 | control2=np.array([4.377346803653962, -1.0167608157302999]), |
| 534 | end=points["ScoreBackHighCube"], |
| 535 | control_alpha_rolls=[], |
| 536 | )) |
| 537 | |
| 538 | points['GroundPickupFrontConeUp'] = to_theta_with_circular_index_and_roll( |
Maxwell Henderson | ce81612 | 2023-03-27 20:12:38 -0700 | [diff] [blame] | 539 | 0.313099, 0.390, -np.pi / 2.0, circular_index=0) |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 540 | |
| 541 | named_segments.append( |
| 542 | ThetaSplineSegment( |
| 543 | name="NeutralToGroundPickupFrontConeUp", |
Austin Schuh | 9a11ebd | 2023-02-26 14:16:31 -0800 | [diff] [blame] | 544 | start=points['Neutral'], |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 545 | control1=np.array([3.153481004695907, 0.4827717171390571]), |
| 546 | control2=np.array([4.107487625131798, 0.9935705415901082]), |
| 547 | end=points['GroundPickupFrontConeUp'], |
milind-u | d11146f | 2023-03-25 18:36:47 -0700 | [diff] [blame] | 548 | control_alpha_rolls=[(.95, -np.pi / 2.0)], |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 549 | )) |
| 550 | |
| 551 | points['ScoreFrontLowConeUp'] = to_theta_with_circular_index_and_roll( |
Maxwell Henderson | 5e7dc57 | 2023-03-23 11:39:59 -0700 | [diff] [blame] | 552 | 0.33, 0.42, -np.pi / 2.0, circular_index=0) |
Austin Schuh | e062be0 | 2023-03-04 21:12:07 -0800 | [diff] [blame] | 553 | |
| 554 | named_segments.append( |
| 555 | ThetaSplineSegment( |
| 556 | name="NeutralToScoreFrontLowConeUp", |
| 557 | start=points['Neutral'], |
| 558 | control1=np.array([3.153481004695907, 0.4827717171390571]), |
| 559 | control2=np.array([4.107487625131798, 0.9935705415901082]), |
| 560 | end=points['ScoreFrontLowConeUp'], |
| 561 | control_alpha_rolls=[(0.30, 0.0), (.95, -np.pi / 2.0)], |
| 562 | )) |
| 563 | |
| 564 | named_segments.append( |
| 565 | ThetaSplineSegment( |
| 566 | name="GroundPickupFrontConeUpToScoreFrontLowConeUp", |
| 567 | start=points['GroundPickupFrontConeUp'], |
| 568 | control1=np.array([4.14454438793702, 1.680256664914554]), |
| 569 | control2=np.array([4.159014136030164, 1.6617266432775355]), |
| 570 | end=points['ScoreFrontLowConeUp'], |
| 571 | control_alpha_rolls=[], |
| 572 | )) |
| 573 | |
| 574 | named_segments.append( |
| 575 | ThetaSplineSegment( |
| 576 | name="ScoreFrontLowConeUpToScoreFrontMidConeUp", |
| 577 | start=points['ScoreFrontLowConeUp'], |
| 578 | control1=np.array([4.144103145250675, 1.3519566301042056]), |
| 579 | control2=np.array([3.5357641970552223, 0.8105698293886593]), |
| 580 | end=points['ScoreFrontMidConeUp'], |
| 581 | control_alpha_rolls=[], |
| 582 | )) |
| 583 | |
| 584 | named_segments.append( |
| 585 | ThetaSplineSegment( |
| 586 | name="ScoreFrontMidConeUpToScoreFrontHighConeUp", |
| 587 | start=points['ScoreFrontMidConeUp'], |
| 588 | control1=np.array([2.417981958011055, 0.48234108399079134]), |
| 589 | control2=np.array([2.1651435746478045, 0.4937628492739232]), |
| 590 | end=points['ScoreFrontHighConeUp'], |
| 591 | control_alpha_rolls=[], |
Austin Schuh | 9a11ebd | 2023-02-26 14:16:31 -0800 | [diff] [blame] | 592 | )) |
Maxwell Henderson | 1ac7aac | 2023-02-23 17:35:32 -0800 | [diff] [blame] | 593 | |
Maxwell Henderson | 696f5db | 2023-03-10 16:37:22 -0800 | [diff] [blame] | 594 | named_segments.append( |
| 595 | ThetaSplineSegment( |
| 596 | name="GroundPickupBackConeUpToGroundPickupBackConeDownBase", |
| 597 | start=points["GroundPickupBackConeUp"], |
Maxwell Henderson | 5e7dc57 | 2023-03-23 11:39:59 -0700 | [diff] [blame] | 598 | control1=np.array([2.9926247819374154, -1.4933529586884973]), |
| 599 | control2=np.array([3.0109584409452284, -1.545647945665206]), |
Maxwell Henderson | 696f5db | 2023-03-10 16:37:22 -0800 | [diff] [blame] | 600 | end=points["GroundPickupBackConeDownBase"], |
| 601 | control_alpha_rolls=[], |
| 602 | )) |
| 603 | |
| 604 | named_segments.append( |
| 605 | ThetaSplineSegment( |
| 606 | name="GroundPickupBackCubeToGroundPickupBackConeUp", |
| 607 | start=points["GroundPickupBackCube"], |
Maxwell Henderson | 5e7dc57 | 2023-03-23 11:39:59 -0700 | [diff] [blame] | 608 | control1=np.array([3.0505709159476315, -1.2367645274118955]), |
| 609 | control2=np.array([3.092073954938234, -1.2212460452853597]), |
Maxwell Henderson | 696f5db | 2023-03-10 16:37:22 -0800 | [diff] [blame] | 610 | end=points["GroundPickupBackConeUp"], |
| 611 | control_alpha_rolls=[], |
| 612 | )) |
| 613 | |
| 614 | named_segments.append( |
| 615 | ThetaSplineSegment( |
| 616 | name="GroundPickupBackCubeToGroundPickupBackConeDownBase", |
| 617 | start=points["GroundPickupBackCube"], |
Maxwell Henderson | 5e7dc57 | 2023-03-23 11:39:59 -0700 | [diff] [blame] | 618 | control1=np.array([3.1162986756987365, -1.277140627447758]), |
| 619 | control2=np.array([3.040845013474888, -1.3101069219600996]), |
Maxwell Henderson | 696f5db | 2023-03-10 16:37:22 -0800 | [diff] [blame] | 620 | end=points["GroundPickupBackConeDownBase"], |
| 621 | control_alpha_rolls=[], |
| 622 | )) |
| 623 | |
| 624 | named_segments.append( |
| 625 | ThetaSplineSegment( |
| 626 | name="GroundPickupFrontConeUpToGroundPickupFrontConeDownBase", |
| 627 | start=points["GroundPickupFrontConeUp"], |
Maxwell Henderson | 5e7dc57 | 2023-03-23 11:39:59 -0700 | [diff] [blame] | 628 | control1=np.array([4.165611255924869, 1.776661759504955]), |
| 629 | control2=np.array([4.158617821533932, 1.8192037605481532]), |
Maxwell Henderson | 696f5db | 2023-03-10 16:37:22 -0800 | [diff] [blame] | 630 | end=points["GroundPickupFrontConeDownBase"], |
| 631 | control_alpha_rolls=[], |
| 632 | )) |
| 633 | |
| 634 | named_segments.append( |
| 635 | ThetaSplineSegment( |
| 636 | name="GroundPickupFrontCubeToGroundPickupFrontConeUp", |
| 637 | start=points["GroundPickupFrontCube"], |
Maxwell Henderson | 5e7dc57 | 2023-03-23 11:39:59 -0700 | [diff] [blame] | 638 | control1=np.array([4.24343254606187, 1.5218945203478058]), |
| 639 | control2=np.array([4.264613405238473, 1.4226736369442823]), |
Maxwell Henderson | 696f5db | 2023-03-10 16:37:22 -0800 | [diff] [blame] | 640 | end=points["GroundPickupFrontConeUp"], |
| 641 | control_alpha_rolls=[], |
| 642 | )) |
| 643 | |
| 644 | named_segments.append( |
| 645 | ThetaSplineSegment( |
| 646 | name="GroundPickupFrontCubeToGroundPickFrontCubeDownBase", |
| 647 | start=points["GroundPickupFrontCube"], |
Maxwell Henderson | 5e7dc57 | 2023-03-23 11:39:59 -0700 | [diff] [blame] | 648 | control1=np.array([4.291217306429481, 1.6211752281452299]), |
| 649 | control2=np.array([4.329997918670176, 1.6541325057673302]), |
Maxwell Henderson | 696f5db | 2023-03-10 16:37:22 -0800 | [diff] [blame] | 650 | end=points["GroundPickupFrontConeDownBase"], |
| 651 | control_alpha_rolls=[], |
| 652 | )) |
| 653 | |
Maxwell Henderson | 3d0beaf | 2023-03-23 11:32:44 -0700 | [diff] [blame] | 654 | # Auto express spline... |
| 655 | named_segments.append( |
| 656 | ThetaSplineSegment( |
| 657 | name="GroundPickupBackCubeToScoreFrontMidCube", |
| 658 | start=points['ScoreFrontMidCube'], |
| 659 | control1=np.array([3.2345111429709847, 0.45338639767112277]), |
| 660 | control2=np.array([3.098240119468829, -0.46161157069783254]), |
| 661 | end=points['GroundPickupBackCube'], |
| 662 | control_alpha_rolls=[(0.40, 0.0), (0.60, 0.0)], |
| 663 | )) |
| 664 | |
| 665 | named_segments.append( |
| 666 | ThetaSplineSegment( |
| 667 | name="GroundPickupBackCubeToScoreFrontHighCube", |
| 668 | start=points['ScoreFrontHighCube'], |
| 669 | control1=np.array([2.7074513232200186, 0.20154350392334375]), |
| 670 | control2=np.array([3.01714846217257, -0.6310437434614364]), |
| 671 | end=points['GroundPickupBackCube'], |
| 672 | control_alpha_rolls=[(0.40, 0.0), (0.60, 0.0)], |
| 673 | )) |
| 674 | |
Maxwell Henderson | 83cf6d6 | 2023-02-10 20:29:26 -0800 | [diff] [blame] | 675 | front_points = [] |
| 676 | back_points = [] |
| 677 | unnamed_segments = [] |
milind-u | 18a901d | 2023-02-17 21:51:55 -0800 | [diff] [blame] | 678 | segments = named_segments + unnamed_segments |
Maxwell Henderson | f582b14 | 2023-03-05 18:33:09 -0800 | [diff] [blame] | 679 | |
| 680 | # This checks that all points are unique |
| 681 | |
| 682 | seen_segments = [] |
| 683 | |
| 684 | for segment in segments: |
| 685 | # check for equality of the start and end values |
| 686 | |
| 687 | if (segment.start.tolist(), segment.end.tolist()) in seen_segments: |
| 688 | print("Repeated value") |
| 689 | segment.Print(points) |
| 690 | sys.exit(1) |
| 691 | else: |
| 692 | seen_segments.append((segment.start.tolist(), segment.end.tolist())) |
| 693 | |
| 694 | seen_points = [] |
| 695 | |
| 696 | for point in points: |
| 697 | if point in seen_points: |
| 698 | print(f"Repeated value {point}") |
| 699 | sys.exit(1) |
| 700 | else: |
| 701 | seen_points.append(point) |