Package com.crossbotics.ftchelper.robot
Class Shape
java.lang.Object
com.crossbotics.ftchelper.robot.Shape
How a part looks and where it sits, for the simulator's 3D view and its size checks: written in
Robot.java next to the part, so the simulator robot file comes from the code
(./gradlew :sim:fromRobot).
intakeDeploy = add(Positioner.servo("intake_deploy").part("gobilda-2000-speed")
.looks(Shape.arm().atMm(140, 0, 110).sizeMm(120, 300, 20)
.angle("stowed", 95).angle("deployed", -10)));
intake = add(Intake.motor("intake").part("gobilda-5203-117").holds(4)
.looks(Shape.roller("offset-tubing-90", "offset-tubing-60").on(intakeDeploy).atMm(120, 0, 0).lengthMm(240)));
Name the part, give only what is not known. A roller or flywheel named by its parts catalog
id (Parts) takes its diameter (and width, when the seller gives it) from the catalog. Places
are always the robot's own: atMm(forward, left, up) from the parent (the middle of the
chassis on the floor, or the hinge of the arm it rides on).
The part that owns the shape moves it: an intake spins its rollers, a positioner swings its arm,
an arm motor swings its arm, a turret turns its turret, a hood servo or motor swings its arm.
A box(java.lang.String) does not move (fixed(...) in Robot.java, or any part's looks).
Docs: docs/reference/robot-java.md (section "Shapes"); the shape types: docs/reference/robot-file.md#robot-shapes
-
Method Summary
Modifier and TypeMethodDescriptionAn arm on a servo: its angle at a named position (from Tunables.java).static Shapearm()A part that swings about a hinge (an intake that folds, an arm).atIn(double forward, double left, double up) atMm(double, double, double)in inches.atMm(double forward, double left, double up) Where it is, in mm from its parent: forward, left, up (the parent: the chassis, oron(com.crossbotics.ftchelper.robot.Module<?>)).The line it turns about: "up", "down", "forward", "back", "left" or "right".static ShapeA part that does not move (a ramp, a tower, a hood).static Shapeclaw()Two fingers that a servo opens and closes (aClaw's).Its color in the 3D view, e.g.diameterMm(double mm) A roller's or flywheel's diameter, mm, for a part not in the catalog.dropsWhen(ServoPositions<?> servoPart, String position, double toDegrees) A passive arm that a servo pushes over (an intake folded up at the start): when that servo reaches the named position (three quarters of the way there), it falls totoDegrees(its hard stop) and stays, as gravity holds it there on the robot.static Shapeflywheel()A launcher wheel not in the parts catalog: givediameterMm(double)andlengthMm(double).static ShapeA launcher wheel, e.g.lengthMm(double mm) A roller's length along its axle, mm (needed when the catalog does not give the part's width).Its name in the robot file (default: the part's configuration name, then name_2, name_3...).Where a number came from, written after the line ("est.Rides on another part's (first) shape: it moves with it, andatMmis from that shape's hinge or middle.Rides on a shape by its name in the robot file (abox(java.lang.String), or a part's second shape).passive()Moved by gravity or springs, not by the code (a floating intake, a sprung flywheel mount).range(double minDegrees, double maxDegrees) A passive arm's hard stops, in degrees (0 = level forward, +90 = straight up).reversed()A roller that turns the other way from its motor, through gears (for example the left one of two spinners geared to one intake shaft, so both pull pieces in).static ShapeA roller (a cylinder; by default its axle runs across the robot, left-right).sizeIn(double forward, double left, double up) sizeMm(double, double, double)in inches.sizeMm(double forward, double left, double up) Its box in mm: forward x left-right x up (an arm: length x width x thickness at 0 degrees).static Shapeslide()A part that moves in a straight line along itsaxis(default up):sizeMmis one stage,atMmthe bottom of the fixed stage.soft()A soft roller (surgical tubing, flaps): it bends against the field, so in the simulator only game pieces touch it; the field does not stop it.startAt(double degrees) Where a passive arm is at the start of a match, degrees.tiltDeg(double degrees) Mounted turned about its parent's left-right line, in degrees (front up +).travelMm(double mm) How far a slide can move, mm: a passive slide's travel from where it rests, or aLift's stage from itsminto itsmax(Tunables), so the simulator knows the counts per inch.static Shapeturret()A part that turns about the up line (a turret):atMmis the middle of its bottom, on the line it turns about;sizeMmits box.
-
Method Details
-
roller
A roller (a cylinder; by default its axle runs across the robot, left-right). Several parts (for example 90 mm and 60 mm rollers taking turns on one shaft) are drawn as one cylinder as big as the biggest. Its length:lengthMm(double), or the part's width if the catalog has it.- Parameters:
partIds- parts catalog ids, e.g. "offset-tubing-90"; none = givediameterMm(double)
-
flywheel
A launcher wheel, e.g.Shape.flywheel("gobilda-hogback-96"). -
flywheel
A launcher wheel not in the parts catalog: givediameterMm(double)andlengthMm(double). -
arm
A part that swings about a hinge (an intake that folds, an arm).atMmis the hinge;sizeMm(length, width, thickness)is the box that reaches forward from it at 0 degrees. On a Positioner, Wrist or Claw servo, give its angle at two named positions withangle(java.lang.String, double). AnArmmotor and aHoodknow their angles (Tunables.java) and need none. -
slide
A part that moves in a straight line along itsaxis(default up):sizeMmis one stage,atMmthe bottom of the fixed stage. Parts on it ride its moving stage. Here it is for apassiveslide (springs or gravity), withtravelMm(double). -
turret
A part that turns about the up line (a turret):atMmis the middle of its bottom, on the line it turns about;sizeMmits box. ATurretturns it; parts can ride on it withon(turret). -
claw
Two fingers that a servo opens and closes (aClaw's).atMmis the middle of its palm;sizeMmits box. The simulator lets it hold a game piece while it is closed. -
box
A part that does not move (a ramp, a tower, a hood).atMmis the middle of its bottom.- Parameters:
name- its name in the robot file, e.g. "ramp"
-
name
Its name in the robot file (default: the part's configuration name, then name_2, name_3...). -
atMm
Where it is, in mm from its parent: forward, left, up (the parent: the chassis, oron(com.crossbotics.ftchelper.robot.Module<?>)). -
atIn
atMm(double, double, double)in inches. -
sizeMm
Its box in mm: forward x left-right x up (an arm: length x width x thickness at 0 degrees). -
sizeIn
sizeMm(double, double, double)in inches. -
lengthMm
A roller's length along its axle, mm (needed when the catalog does not give the part's width). -
diameterMm
A roller's or flywheel's diameter, mm, for a part not in the catalog. -
axis
The line it turns about: "up", "down", "forward", "back", "left" or "right". A roller's axle (default left-right; "up" for a wheel lying flat), an arm's hinge (default "left"). -
on
Rides on another part's (first) shape: it moves with it, andatMmis from that shape's hinge or middle. -
on
Rides on a shape by its name in the robot file (abox(java.lang.String), or a part's second shape). -
angle
An arm on a servo: its angle at a named position (from Tunables.java). Give two; the simulator draws every position between them. 0 = level forward, +90 = straight up.- Parameters:
position- e.g. "stowed"degrees- e.g. 95
-
passive
Moved by gravity or springs, not by the code (a floating intake, a sprung flywheel mount). The simulator draws it atstartAtand checks the size rules over its whole range: giverange(double, double)(arm) ortravelMm(double)(slide), the hard stops a real robot needs too. -
range
A passive arm's hard stops, in degrees (0 = level forward, +90 = straight up). -
startAt
Where a passive arm is at the start of a match, degrees. Default: the bottom of its range. -
travelMm
How far a slide can move, mm: a passive slide's travel from where it rests, or aLift's stage from itsminto itsmax(Tunables), so the simulator knows the counts per inch. -
dropsWhen
A passive arm that a servo pushes over (an intake folded up at the start): when that servo reaches the named position (three quarters of the way there), it falls totoDegrees(its hard stop) and stays, as gravity holds it there on the robot.- Parameters:
servoPart- the part whose servo pushes it, e.g. intakeDeployposition- its position that pushes it over, e.g. "deployed"toDegrees- where it falls to, e.g. -10
-
tiltDeg
Mounted turned about its parent's left-right line, in degrees (front up +). For a part fixed at an angle on what it rides on: a spinner kept level on an intake arm that is down at -40 degrees has a tilt of 40.- Parameters:
degrees- e.g. 40
-
soft
A soft roller (surgical tubing, flaps): it bends against the field, so in the simulator only game pieces touch it; the field does not stop it. It still counts for the size rules. -
reversed
A roller that turns the other way from its motor, through gears (for example the left one of two spinners geared to one intake shaft, so both pull pieces in). -
note
Where a number came from, written after the line ("est. from the CAD", "measured 2026-10-20"). -
color
Its color in the 3D view, e.g. "#2fa84f".
-