milind-u | 18a901d | 2023-02-17 21:51:55 -0800 | [diff] [blame^] | 1 | import numpy as np |
Maxwell Henderson | f5123fe | 2023-02-04 13:44:41 -0800 | [diff] [blame] | 2 | |
milind-u | 18a901d | 2023-02-17 21:51:55 -0800 | [diff] [blame^] | 3 | from y2023.control_loops.python.graph_tools import * |
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 | neutral = to_theta_with_circular_index_and_roll(joint_center[0], |
| 6 | joint_center[1] + l2 - l1, |
| 7 | np.pi / 2, |
| 8 | circular_index=-1) |
Maxwell Henderson | f5123fe | 2023-02-04 13:44:41 -0800 | [diff] [blame] | 9 | |
milind-u | 18a901d | 2023-02-17 21:51:55 -0800 | [diff] [blame^] | 10 | neutral_to_pickup_1 = to_theta_with_circular_index(0.3, 0.6, circular_index=-1) |
| 11 | neutral_to_pickup_2 = to_theta_with_circular_index(0.3, 0.4, circular_index=-1) |
| 12 | pickup_pos = to_theta_with_circular_index_and_roll(0.6, |
| 13 | 0.1, |
| 14 | np.pi / 2, |
| 15 | circular_index=-1) |
| 16 | neutral_to_pickup_control_alpha_rolls = [(0.33, np.pi / 2), (.67, np.pi / 2)] |
Maxwell Henderson | f5123fe | 2023-02-04 13:44:41 -0800 | [diff] [blame] | 17 | |
milind-u | 18a901d | 2023-02-17 21:51:55 -0800 | [diff] [blame^] | 18 | neutral_to_score_1 = to_theta_with_circular_index(-0.4, 1.2, circular_index=-1) |
| 19 | neutral_to_score_2 = to_theta_with_circular_index(-0.7, 1.2, circular_index=-1) |
| 20 | score_pos = to_theta_with_circular_index_and_roll(-1.0, |
| 21 | 1.2, |
| 22 | np.pi / 2, |
| 23 | circular_index=-1) |
| 24 | neutral_to_score_control_alpha_rolls = [(0.33, np.pi / 2), (.67, np.pi / 2)] |
Maxwell Henderson | f5123fe | 2023-02-04 13:44:41 -0800 | [diff] [blame] | 25 | |
milind-u | 3738518 | 2023-02-20 15:07:28 -0800 | [diff] [blame] | 26 | # TODO(Max): Add real paths for arm. |
milind-u | 18a901d | 2023-02-17 21:51:55 -0800 | [diff] [blame^] | 27 | points = [(neutral, "NeutralPos"), (pickup_pos, "PickupPos"), |
| 28 | (score_pos, "ScorePos")] |
Maxwell Henderson | 83cf6d6 | 2023-02-10 20:29:26 -0800 | [diff] [blame] | 29 | front_points = [] |
| 30 | back_points = [] |
| 31 | unnamed_segments = [] |
milind-u | 3738518 | 2023-02-20 15:07:28 -0800 | [diff] [blame] | 32 | named_segments = [ |
milind-u | 18a901d | 2023-02-17 21:51:55 -0800 | [diff] [blame^] | 33 | ThetaSplineSegment("NeutralToPickup", neutral, neutral_to_pickup_1, |
| 34 | neutral_to_pickup_2, pickup_pos, |
| 35 | neutral_to_pickup_control_alpha_rolls), |
| 36 | ThetaSplineSegment("NeutralToScore", neutral, neutral_to_score_1, |
| 37 | neutral_to_score_2, score_pos, |
| 38 | neutral_to_score_control_alpha_rolls), |
Maxwell Henderson | f5123fe | 2023-02-04 13:44:41 -0800 | [diff] [blame] | 39 | ] |
milind-u | 3738518 | 2023-02-20 15:07:28 -0800 | [diff] [blame] | 40 | |
milind-u | 18a901d | 2023-02-17 21:51:55 -0800 | [diff] [blame^] | 41 | segments = named_segments + unnamed_segments |