In ARCore and ARKit, tracking of vertical surfaces is a bit more difficult to achieve than tracking of horizontal surfaces. Firstly, all you need is an appropriate surface for tracking. Wall with a solid color (with no distinguishing features on it) is very bad sample. The best sample for tracking of a vertical surface is a well-lit brick wall, or a wall with pictures on it, etc. The worst sample for tracking is a solid-color wall, or wall with repetitive texture pattern (like polka dot), or reflective/refractive surface.
The same principles apply to horizontal tracking.

Secondly, the easiest way of creating an Anchor
in the center of your detected plane is to use the following code (make sure you call it once, so it couldn't create a new Anchor
on every update):
Anchor newAnchor;
for (Plane plane : mSession.getAllTrackables(Plane.class)) {
if (plane.getType() == Plane.Type.VERTICAL &&
plane.getTrackingState() == TrackingState.TRACKING) {
newAnchor = plane.createAnchor(plane.getCenterPose());
break;
}
}