Perception Learning, Prediction And Motion Planning For Energy Efficient Driving Of Connected And Automated Vehicles