Work record: , 9 minute read

A rover arm that types

My Mongol-Tori work: key detection, OCR, a separate vision unit and a two-link arm. The preserved controller makes the distance between solving a triangle and pressing a key unusually clear.

From December 2024 to May 2025 I worked with BRACU Mongol-Tori’s autonomous sub-team. My part was the typing task: inverse kinematics for a two-degree-of-freedom arm, a lightweight vision unit, OCR and image processing for key identification, the URC 2025 dataset pipeline, and a GUI and simulation environment for testing and calibration.

Underwater vision had already made me think about whether a target was visible. This task added a more physical question: even after finding it, where does the end of the mechanism actually go? A correctly labelled F is not yet a coordinate the arm can use—and arriving above F is not yet pressing it.

Individual keyboard keys boxed by the detector, with a threaded metal tip in front of the F key
The preserved keyboard-detection frame, cropped only to remove its empty upper area. Inspect the uncropped frame.Open image to inspect at full size.

What the competition actually asked

The distinction between autonomous navigation and autonomous typing matters. In the official 2025 equipment-servicing Q&A, teams could manually align with Q initially, without pressing it. After that alignment, typing had to proceed autonomously: no manual repositioning to the other keys. The keyboard itself could serve as the fiducial; a team could not place convenient markers beside it.

That is a more specific problem than “find any keyboard anywhere, with no human involvement.” It still leaves the difficult part: preserve a useful relationship between the camera, the key layout and the arm as the task progresses. The same Q&A says holding a key does not auto-repeat. Another occurrence needs a release and another press. Position, contact and sequencing are separate requirements.

From a box in an image to a key on the plane

I built the lightweight vision unit separately from the rover’s main computer. That separated the typing workload from the main computing arrangement; it was not a proof that contention or integration failures were impossible. Custom OCR and image processing handled key identification, and I managed the dataset pipeline for the 2025 task.

The detection image shows why identifying the keyboard alone is insufficient. Individual keys occupy different parts of a perspective-distorted plane. Function keys, letters and the space bar are different shapes. Neighbouring boxes can overlap, and a large printed character is not necessarily the centre of the surface that should be contacted. The values beside those boxes are detector confidence scores, not measured positional accuracy or a probability that the arm will press successfully.

A useful calibration separates three coordinate systems:

  1. Image pixels. A detected key provides a location in the camera image, with uncertainty from the box, viewing angle and identification.
  2. Keyboard coordinates. A planar mapping can rectify the view into a consistent layout. A homography needs enough independent correspondences; it does not magically provide scale in inches.
  3. Arm coordinates. The mechanism needs a metric target relative to its base, including the relationship between the camera and that base. Moving either invalidates assumptions in the mapping.

This is the reasoning behind the calibration GUI and simulation work. The preserved Arduino sketch starts at the third interface: it accepts X/Y values over Serial. It contains neither OCR nor the competition task sequencer. Treating that file as the complete autonomous typing system would hide most of the integration work.

The geometry inside my controller

The two planar links are 15.5 in and 14 in. Ignoring joint limits, their tip can reach an annulus: the outer radius is 29.5 in, and the inner hole has radius 1.5 in. A point inside the outer circle can still be unreachable because the links cannot fold short enough.

For a target at distance r, the law of cosines gives the relative elbow angle q2. The shoulder q1 follows by subtracting the triangle’s internal direction from the target direction. There are generally two geometric branches; this controller selects one. A real joint’s zero and direction are not necessarily the mathematical angle’s zero and direction.

Two-link geometry and the archived servo mappingA two-link schematic beside the equations. The source uses mirrored X coordinates, then subtracts 60 degrees from the shoulder and adds 10 degrees to the relative elbow angle. Ideal radial reach is 1.5 to 29.5 inches, before command limits.15.5 in14 intargetXYrTwo-link schematicSource coordinates → servo anglesX = −x; Y = y; r² = x² + y²cos q2 = (r² − L1² − L2²) / (2 L1 L2)q1 = atan2(y, −x)− atan2(L2 sin q2, L1 + L2 cos q2)servo1 = q1 − 60°; servo2 = q2 + 10°Ideal radial reach: 1.5–29.5 inThen apply the source’s joint limits and integer writes.Planar position only—not contact, stiffness or a verified keypress.
The equations use the file’s reflected-X convention. The sketch’s internal triangle angle is converted into the relative elbow angle shown here. Schematic, not a dimensioned mechanical drawing.

The implementation uses atan2(y, -x), normalizes a negative direction into 0–360°, then applies offsets of −60° and +10°. Its command bounds are 30–135° for servo 1 and 10–135° for servo 2. Those bounds are applied independently, after the inverse calculation.

That ordering matters. Clamping an angle does not preserve the requested tip position. In this mapping, the allowed relative elbow angle is 0–125°, which alone raises the smallest nominal reachable radius to about 13.686 in. The shoulder bound also restricts which directions are reachable. The blue region in the instrument is the image of those command bounds—not the entire ideal annulus and not a measured physical workspace.

What the preserved sketch really does at the edges

The original function does not reject every unreachable request. For a target beyond the total link length, it requests a straight arm in that direction and returns. Later joint limits can change that direction further. For a point inside the inner hole, it still evaluates the inverse-cosine expressions. At the base, one expression also divides by zero. These cases can produce non-finite angles; they are not useful servo commands.

A short excerpt captures the distinction between requesting an angle and writing it:

// Constants in my archived sketch; lengths are inches.
const double len1 = 15.5, len2 = 14;
const int LIMIT1[] = {30, 135}, LIMIT2[] = {10, 135};

// After setIK(), constrain() and the smoothing step:
sg1.write(int(cAng1));
sg2.write(int(cAng2));

The smoothing moves each current command toward its target by 2° per loop, followed by a 15 ms delay. That is not a guaranteed update rate: computation and Serial parsing also take time, and reading an incomplete line can block. The two axes may finish at different times. A point-to-point position solution says nothing about whether the swept path clears the keyboard or surrounding structure.

Integer writes introduce a further difference even without a joint-limit violation. To make that visible, I compiled the original setIK function in a host-side numerical probe, then applied the source’s limits, integer conversion and nominal forward kinematics. These are computed positions assuming perfect realization of the commands, not measurements from the arm.

Requested X/Y, inWritten servo anglesNominal settled tip, inPosition miss
21.4 / 13.8—the source’s starting target58° / 70°21.268 / 14.1740.397 in
10 / 10—geometrically reachable, command limited30° / 132°11.873 / 8.0812.681 in
40 / 0—beyond the link lengths120° / 10°29.500 / 0.00010.500 in
1 / 0—inside the inner holeNon-finite inverse resultNo valid poseNot defined
0 / 0—at the baseNon-finite inverse resultNo valid poseNot defined

The starting target’s roughly 0.4 in nominal discrepancy is a consequence of this particular geometry and integer conversion. It is not an accuracy specification for the physical servos. Backlash, calibration, compliance and load would add their own effects.

Ideal reach versus my archived commands

Loading the diagram. It needs JavaScript; the text around it says the same thing in words.

Lengths in inches. Select a boundary case, compare the modes, then move the target. The plot shows settled nominal geometry; it does not simulate the smoothing trajectory or press a key.

Reaching is not pressing

Two joint variables position a tip in a plane. They do not independently specify an arbitrary 3D location and tool orientation. A typing mechanism still needs a consistent relationship to the keyboard surface, appropriate contact travel and a way to withdraw. Neither the diagram nor the two-servo archive models a contact force, key stroke or successful electrical input.

That makes the complete task a chain of checks rather than one inverse formula: identify the intended key, obtain a usable coordinate, reject or handle an infeasible request, move without an unwanted collision, make contact, release, and establish that the expected input occurred. Repeating a character requires that release/press transition; the official keyboard’s no-auto-repeat behavior makes the distinction explicit.

The lesson I take from this work is not that manipulation becomes easy once perception works. It is that each interface needs a meaning both sides can honour. A key label is not a coordinate. A coordinate is not a feasible joint command. A command is not a measured tip position. A tip position is not a completed keystroke.

The team result belongs to the team

BRAC University reported Mongol-Tori’s global top-10 finish at URC 2025, and published an innovation-award report about the team in October 2025. Those reports belong here alongside the engineering, rather than disappearing because they are news coverage.

They describe the team’s achievement across a rover programme. My contribution was the autonomous typing work described above—not the entire vehicle, its drive system or its science mission. The surviving sketch and detection frame make one part of that contribution inspectable; they do not establish a typing success rate at the competition.

Read the interfaces, not just the formula

Start with the 2025 task Q&A: it changes what “autonomous” means in this specific task. For the general mathematical treatment, Modern Robotics’ inverse-kinematics material separates a desired pose from the joint variables that can realize it.

For the perception side of my own work, Duburi is the longer history, and Half a second looks at the difference between an estimate and where the target actually is. Rupsha returns to ground vehicles with a different set of constraints. They share the same habit: keep the observations, model and physical claims distinguishable.