You could probably use a baseline example from something like a Cybermite. But rather than toss them, have them be a deployable (one use) motorized drone grenade.
How you code this ? I have no clue. I believe Cybermites need to be deployed by a carrier. So you'd need to work out the details.
The only reason I say use a Cybermite structure is, you'd keep the laws of physics in tact. Creating a remote control grenade is much more believable. Almost like a mini remote control car with wheels.
I would also suggest balance be taken into consideration. Using one would take up all a soldiers TU's. vs. what normal grenades use.