Remember the XM25 CDTE (Counter Defilade Target Engagement) project? If not check it out here.
Here is a brief description/explanation of the XM25.
The 14-pound XM25 features a target acquisition system that calculates the target range with a push of a button, and transfers the data to the electronic fuse built into the 25mm round. When fired, the projectile is designed to explode directly above targets out to 600 meters, peppering enemy fighters with shrapnel.
The new Small Arms Grenade Munitions or SAGM for short, is an update for the 40mm grenades used in the M203 and M320 launchers. The scientists are utilizing modern technology. They make the fuse smart by adding sensors to the grenade.
With this new capability, which is fully autonomous on-board smart sensors, much like a smartphone, the grenade can perform a task without being told to do so by the user. It is designed so that, when fired, it will recognize its surroundings and can detonate over an obstacle that might conceal the enemy.
Here is a pdf I found detailing some of the concepts and design of the SAGM.