Upvote:6
Unfortunately, this is not permitted:
Within Yosemite National Park, you may not sleep in your car or RV except in a campsite that you're registered to stay in (except at Camp 4, where sleeping in cars is not allowed because it's a walk-in campground). Sleeping in your car along the side of the road is also not allowed.
You'd need to sleep at a campsite or outside the park. See the guide to Visiting Yosemite With an RV, including this map showing free and paid locations around the park with RV parking.