Skip to content

AutoBuilder.followPath() trajectory briefly appears then disappears #1141

Description

@rakrakon

Describe the bug
When using AutoBuilder.followPath(), the trajectory briefly appears in the PathPlanner logging for a split second and then immediately disappears. The robot does not move at all, and the command appears to end almost instantly without any visible errors.

To Reproduce
Steps to reproduce the behavior:

  1. Configure AutoBuilder normally (pose supplier, reset pose, drive method, etc.)
  2. Call AutoBuilder.followPath(path) from an autonomous command or routine
  3. Observe the trajectory briefly appear in the logger, then disappear, with no robot movement

Expected behavior
The trajectory should remain visible while the command is active, and the robot should begin following the path and drive along it as expected.

**Versions: **

  • OS: Linux (Ubuntu)
  • PPLib Version: 1.2
  • PPLib Language: Kotlin and Java

Additional context:
Our autonomous command is built like this:

fun getAutonomousCommand(): Command {
        val path = PathPlannerPath.fromPathFile("StartToFuelDepotSide")
        val startPose = path.pathPoses[0]
        return AutoBuilder.resetOdom(startPose).andThen(AutoBuilder.followPath(path))
    }

Then scheduled like this:

CommandScheduler.getInstance().schedule(autonomousCommand)

Configured in Drive like this:

    private static final RobotConfig PP_CONFIG =
            new RobotConfig(
                    ROBOT_MASS_KG,
                    ROBOT_MOI,
                    new ModuleConfig(
                            TunerConstants.FrontLeft.WheelRadius,
                            TunerConstants.kSpeedAt12Volts.in(MetersPerSecond),
                            WHEEL_COF,
                            DCMotor.getKrakenX60Foc(1)
                                    .withReduction(TunerConstants.FrontLeft.DriveMotorGearRatio),
                            TunerConstants.FrontLeft.SlipCurrent,
                            1),
                    getModuleTranslations());

private void configureAutoBuilder(PIDConstants translationConstants, PIDConstants rotationConstants) {
        AutoBuilder.configure(
                this::getPose,
                this::resetOdometry,
                this::getChassisSpeeds,
                this::runVelocity,
                new PPHolonomicDriveController(
                        translationC        CommandScheduler.getInstance().schedule(autonomousCommand)onstants,
                        rotationConstants
                ),https://github.com/Galaxia5987/robot-2026
                PP_CONFIG,
                () ->
                        DriverStation.getAlliance().isPresent()
                                && DriverStation.getAlliance().get() == DriverStation.Alliance.Red,
                this);
    }

The robot drives fine in simulation when using a controller.

Link to the robot code

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions