I’m experimenting with on the fly path following and it keeps running into the obstacles. Is it supposed to automatically avoid them or is there something I need to add for it to do that?
1 Like
(This post has been deleted)
Here is the code
public static Command makePathOnTheFly(Pose2d targetPose, double targetEndVelocity, boolean rotateFast) {
final List bezierPoints = PathPlannerPath.bezierFromPoses(
RobotContainer.POSE_ESTIMATOR.getCurrentPose().toAlliancePose(),
targetPose
);
final PathPlannerPath path = new PathPlannerPath(
bezierPoints,
getPathConstraints(),
new GoalEndState(targetEndVelocity, targetPose.getRotation(), rotateFast)
);
path.preventFlipping = true;
return AutoBuilder.followPath(path);
}
It doesn’t automatically do that I think. You have to use Path Finding.
My team hasn’t been able to figure out how to do that yet though. Our robot doesn’t move when we try to run pathfinding. Here is an example of where we use it in our code. Our team uses Advantage Kit so it will probably look different to what you have.
My team also uses Akit but it still looks pretty different. The Path Finding link was very helpful though and it seems to be working now. Thank you.
1 Like