You are on the right track.
Make sure you use 2" drain line all along the horizontal run and the stand pipe for the washer. The new washing machine pumps move a lot of water in a hurry and time after time I see 1-1/2 drain pipe back up water. Even though the water should back up into your tub...better safe than sorry.
Keep that trap within 30" of the stand pipe, at least per the code I have to use.
Yes, in pic 2 it looks like an AAV.