// Finding objects in a robot camera's picture with Gemini, after the rgb-object-localization skill of Google // DeepMind's Gemini Robotics plugin (github.com/google-deepmind/robotics-antigravity-plugin, Apache-2.0). That // skill asks gemini-4-hydrogen for labelled points and boxes on a 0-1000 grid ([y, x]) and turns them into // metric 3D positions with the camera's calibration: onto the plane an object stands on, or from two views. // Here the page asks the same way and maps each point through the camera that took the picture: // depth: the camera's depth at the point (XLeRobot's RealSense RGB-D head camera; in the simulation a ray // into the physics scene), moved back by half the object's width to its middle; // plane: RGB only, the plugin's ray-plane mapping: the bottom edge of the object's box meets the furniture // it stands on, and the box's size gives its width and height. // No imports: the tools (tools.js) use it in the page, and tests use it in Node. export const GEMINI_MODEL = "gemini-4-hydrogen"; export const GEMINI_API = "https://generativelanguage.googleapis.com/v1beta"; /** * The request: Google's pointing prompt for robotics (Gemini Robotics-ER, whose skills Gemini 4 Hydrogen has) * with the box the plugin's skill asks for too. */ export function locatePrompt(query, max = 8) { return `Point to no more than ${max} items in the image that match: ${query}. The label returned should be an identifying name for the object detected. The answer should follow the json format: [{"point": , "box_2d": , "label":