Issue getting Path from PathfindHolonomic command using PathplannerLib

We are using the PathfindHolonomic command from the PathplannerLib, but are having trouble retrieving the path it generates. We don’t know how to, and any help would be appreciated.

   Command pathfindingCommand = new PathfindHolonomic(
            targetPose,
            constraints,
            goalEndVelocity,
            s_Swerve::getPose,
            s_Swerve::getChassisSpeeds,
            s_Swerve::driveChassisSpeeds,
            Constants.Swerve.pathFollowingConfig, // Path following config
            rotationDelayDistance,
            s_Swerve); 
        

I would suggest you tell us what you are actually trying to do. There may be a better way to do it.

If you run the command you can get the path via the activepathcallback

I don’t think there is a way currently to get the path without running it.

We got the solutuion

I am happy you found a solution but one of the benefits of CD is to be a resource to future teams with the same problem. Can you explain the solution?

1 Like