rah
This commit is contained in:
parent
97503a8551
commit
df004f6d82
@ -113,6 +113,7 @@ void competition_initialize() {}
|
|||||||
// get a path used for pure pursuit
|
// get a path used for pure pursuit
|
||||||
// this needs to be put outside a function
|
// this needs to be put outside a function
|
||||||
ASSET(example_txt); // '.' replaced with "_" to make c++ happy
|
ASSET(example_txt); // '.' replaced with "_" to make c++ happy
|
||||||
|
ASSET(testingpath_txt);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runs during auto
|
* Runs during auto
|
||||||
@ -120,23 +121,20 @@ ASSET(example_txt); // '.' replaced with "_" to make c++ happy
|
|||||||
* This is an example autonomous routine which demonstrates a lot of the features LemLib has to offer
|
* This is an example autonomous routine which demonstrates a lot of the features LemLib has to offer
|
||||||
*/
|
*/
|
||||||
void autonomous() {
|
void autonomous() {
|
||||||
// example movement: Move to x: 20 and y:15, and face heading 90. Timeout set to 4000 ms
|
chassis.follow(testingpath_txt, 15, 4000);
|
||||||
chassis.moveTo(20, 15, 90, 4000);
|
|
||||||
// example movement: Turn to face the point x:45, y:-45. Timeout set to 1000
|
|
||||||
// dont turn faster than 60 (out of a maximum of 127)
|
|
||||||
chassis.turnTo(45, -45, 1000, true, 60);
|
|
||||||
// example movement: Follow the path in path.txt. Lookahead at 15, Timeout set to 4000
|
|
||||||
// following the path with the back of the robot (forwards = false)
|
|
||||||
// see line 116 to see how to define a path
|
|
||||||
chassis.follow(example_txt, 15, 4000, false);
|
|
||||||
// wait until the chassis has travelled 10 inches. Otherwise the code directly after
|
|
||||||
// the movement will run immediately
|
|
||||||
// Unless its another movement, in which case it will wait
|
|
||||||
chassis.waitUntil(10);
|
|
||||||
pros::lcd::print(4, "Travelled 10 inches during pure pursuit!");
|
|
||||||
// wait until the movement is done
|
|
||||||
chassis.waitUntilDone();
|
chassis.waitUntilDone();
|
||||||
pros::lcd::print(4, "pure pursuit finished!");
|
|
||||||
|
// chassis.moveTo(20, 15, 90, 4000);
|
||||||
|
|
||||||
|
// chassis.turnTo(45, -45, 1000, true, 60);
|
||||||
|
|
||||||
|
// chassis.follow(example_txt, 15, 4000, false);
|
||||||
|
|
||||||
|
// chassis.waitUntil(10);
|
||||||
|
// pros::lcd::print(4, "Travelled 10 inches during pure pursuit!");
|
||||||
|
|
||||||
|
// chassis.waitUntilDone();
|
||||||
|
// pros::lcd::print(4, "pure pursuit finished!");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
47
RUN-THAT-BACK/static/testingpath.txt
Normal file
47
RUN-THAT-BACK/static/testingpath.txt
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
61.449, -28.859, 100
|
||||||
|
61.966, -30.791, 100
|
||||||
|
62.42, -32.738, 100
|
||||||
|
62.797, -34.701, 100
|
||||||
|
63.067, -36.683, 100
|
||||||
|
63.202, -38.678, 100
|
||||||
|
63.203, -40.677, 100
|
||||||
|
63.047, -42.669, 100
|
||||||
|
62.711, -44.638, 100
|
||||||
|
62.173, -46.562, 97.5
|
||||||
|
61.422, -48.413, 94.862
|
||||||
|
60.454, -50.162, 92.148
|
||||||
|
59.255, -51.761, 89.351
|
||||||
|
57.875, -53.205, 87.714
|
||||||
|
56.342, -54.487, 90.121
|
||||||
|
54.688, -55.608, 95.531
|
||||||
|
52.939, -56.576, 100
|
||||||
|
51.118, -57.402, 100
|
||||||
|
49.242, -58.094, 100
|
||||||
|
47.328, -58.674, 98.362
|
||||||
|
45.388, -59.157, 95.745
|
||||||
|
43.428, -59.555, 93.055
|
||||||
|
41.454, -59.876, 90.284
|
||||||
|
39.471, -60.131, 87.426
|
||||||
|
37.48, -60.326, 84.471
|
||||||
|
35.485, -60.468, 81.409
|
||||||
|
33.488, -60.564, 78.226
|
||||||
|
31.489, -60.618, 74.909
|
||||||
|
29.489, -60.635, 71.438
|
||||||
|
27.489, -60.619, 67.789
|
||||||
|
25.489, -60.574, 63.933
|
||||||
|
23.49, -60.504, 59.828
|
||||||
|
21.493, -60.412, 55.42
|
||||||
|
19.496, -60.302, 50.63
|
||||||
|
17.499, -60.179, 45.337
|
||||||
|
15.504, -60.046, 39.337
|
||||||
|
13.508, -59.91, 32.24
|
||||||
|
11.513, -59.777, 23.052
|
||||||
|
9.424, -59.655, 0
|
||||||
|
9.424, -59.655, 0
|
||||||
|
-10.542, -58.49, 0
|
||||||
|
endData
|
||||||
|
127
|
||||||
|
100
|
||||||
|
200
|
||||||
|
61.449, -28.859, 72.811, -67.13, 27.065, -60.552, 9.424, -59.655
|
||||||
|
#PATH.JERRYIO-DATA {"appVersion":"0.4.0","format":"LemLib v0.4.x (inch, byte-voltage)","gc":{"robotWidth":13.6,"robotHeight":15,"robotIsHolonomic":false,"showRobot":true,"uol":2.54,"pointDensity":2,"controlMagnetDistance":0.7750015500031,"fieldImage":{"displayName":"VRC 2024 - Over Under","signature":"VRC 2024 - Over Under","origin":{"__type":"built-in"}}},"paths":[{"segments":[{"controls":[{"uid":"PisA8JQbWI","x":61.44919168591223,"y":-28.85887495875948,"lock":false,"visible":true,"heading":0,"__type":"end-point"},{"uid":"VotFhb8yH1","x":72.81095348069942,"y":-67.13007258330583,"lock":false,"visible":true,"__type":"control"},{"uid":"DlV0frkxjS","x":27.06491257010887,"y":-60.552210491586926,"lock":false,"visible":true,"__type":"control"},{"uid":"PbleKPZRgX","x":9.424282415044534,"y":-59.65522929726162,"lock":false,"visible":true,"heading":270,"__type":"end-point"}],"speedProfiles":[],"uid":"kb5k5M2fZB"}],"pc":{"speedLimit":{"minLimit":{"value":0,"label":"0"},"maxLimit":{"value":127,"label":"127"},"step":1,"from":20,"to":100},"bentRateApplicableRange":{"minLimit":{"value":0,"label":"0"},"maxLimit":{"value":4,"label":"4"},"step":0.01,"from":1.4,"to":1.8},"maxDecelerationRate":127},"name":"Path","uid":"8NSjgK0B38","lock":false,"visible":true}]}
|
||||||
Loading…
x
Reference in New Issue
Block a user