Unity collision detection not working.

So I have 2 prefabs, 1 with a 2d box collider, and one with a 2d box collider and a 2d Rigidbody:

I instantiated both of them, the robot prefab in a robot script and the grass prefab in the board manager script. I want to check if the robot is colliding with the grass in the code, so I add this in the robot script:

void OnCollisionEnter2D(Collision2D coll) {
    Debug.Log ("Detected!");
}

When I run, the robot falls onto the grass, and the console remains silent. Did I do something wrong?

I reread your question.

If the console remains empty, do you have the console box enabled to read logs?

I dont see the script with your code on either of the gameobjects you have in your screenshot.