Japanese printer company Brother has invented a battery that can be recharged by shaking it. It's intended for devices like remote controls that use very little power and would normally require infrequent battery charges, so unfortunately you couldn't use it to power a car that could drive forever on a bumpy road.

However, you can create systems that recycle as much of the energy as possible. For example, when we are walking, all of the energy we expend is lost.

Not really. A huge part of the energy is recycled through elasticity in our tendons and joints. That's why a human can walk using only 50 W of power, while most human-sized walking robots need something in the order of 700 W.