Curves with moveToPose
So far your robot drives in straight lines: point, turn, point, turn. Real paths curve. moveToPose lets the robot swoop into a spot already facing the right way, in one smooth motion.
Point vs pose A point is just a spot: x and y. A pose is a spot plus a direction : x, y and the heading the robot should be facing when it gets there. How it curves: the carrot Have you ever seen a cartoon where someone hangs a carrot on a stick in front of a donkey? The donkey keeps walking toward the carrot, so whoever holds the stick gets to steer it. LemLib steers your robot the same way. It's called the boomerang controller , but you can just think "carrot." The robot never aims straight at its parking spot. It chases a carrot, and LemLib moves the carrot to steer the robot into a nice curve. 1 Place the carrot 2 Chase it 3 Carrot slides in 4 Park it ▶ Play Drag the robot Robot Parking spot (and the way it should face) Carrot Where the robot is aiming Here's the secret. The carrot sits on an invisible line sticking out behind the parking spot. Because the robot follows that line in at the end, it arrives already facing the right way. Why bother? A race Both robots below drive to the same spot and end facing the same way. The left one drives straight, stops , then turns. The right one chases the carrot and never stops. Stop and turn 0.0 s moveToPose (carrot) 0.0 s ▶ Race again Shown in slow motion. The curved path is a bit longer, but skipping the stop and the turn wins. Try it yourself Tap anywhere on the field to move the green parking spot. Slide Target heading to change which way it should face. Then press Drive it to watch the robot chase the carrot. Lab: Boomerang tap the field to move the target ▶ Drive it Target heading 90° lead 0.6 Show point-then-turn path (dashed) Show carrot trail Tuning lead lead is how far behind the parking spot the carrot starts. Think of it as how long the stick is . Watch all three robots try the same parking spot: lead = 0 No stick. The carrot sits right on the spot, so the robot drives straight there and ends up facing the wrong way . lead = 0.5 A medium stick. It makes a smooth curve and parks facing the right way. 0.3 to 0.6 is the sweet spot (LemLib's default is 0.6). lead = 0.95 A super long stick. The robot makes a huge swing. It looks cool, but it often hits things. When not to use it: If the target is right next to you and you need to end up facing the opposite way, a pose move swings in a big…
Ends with a 10-question quiz.
Next mission: Chain moves for speed
All Competition Pro missions
- Curves with moveToPose · about 35 min
- Chain moves for speed · about 35 min
- Follow a drawn path · about 45 min
- Two things at once · about 40 min
- Sensors that score · about 40 min
- Driver control that feels great · about 35 min
- Plan a skills run · about 45 min
- Save your code like a pro · about 35 min