Rather than making herbivores/carnivores for the sake of having herbivores/carnivores, let's consider some reasons why it's not optimal to make all robots autotrophic. I'm making the assumption that your robo-ecosystem primarily thrives on the following direct sources of power: the sun, nuclear energy, chemical fuel, and physical forces (which are indirectly cause by the sun). In most of the aforementioned, your energy producers are not going to be the dexterous sort of robots seen on <PERSON>. It's just not optimal to produce energy in a machine that has to move around all the time. Coral-like tidal power robots may only move every decade or so to follow the long-term oceanic current shifts. Chemical plants need to get very big to approach the Carnot limits on thermodynamic efficiency. 943
In particular, nuclear fusion robots are likely to be more sensitive and bulkier than the rest.
However there are some noteworthy exceptions: If your planet is similar in triboelectric properties to Earth, then static potential differences may regularly build up across large distances separated by insulators. However, since we're "working on a planet with robotic life", then maybe its chemistry is tuned for such an existance: snowstorms with snowflaskes made of nylon and silicone may do the trick.
Unlike bulky producers, predator robots are not constrained by the same efficiency curves, so you can imagine a sort of parasitic symbiosis between the producers and consumers with the ladder tapping into the formers' power supplies, and the former designing defensive and offensive countermeasures, even employing other robots to defend them in exchange for power.
Of course, this begs the question: why are these robots even trying to eat each other? There must be scarcity of physical resources which are most easily satisfied by preying on other robots. Since we're "working on a planet with robotic life", metals may already be abundant, but processors and other high end electronics...? It seems logical that energy producers would want to use their energy to run computations. Therefore, a correlation may be found between power production and consumption.
Finally, it's worth noting that zoological autotroph/heterotroph, herbivore/carnivore/detritivore, etc. distictions may not be the most appropriate in clasifying your robots. The autotroph/herbivore distinction breaks down when you have mining robots work for a power plant robot. 445