+ Upload Gen··

Explore

CATEGORY

Robotics & Physical AI/Control Systems

u/bluestwaffle4h · Text
Here's a Python function that implements this approach:

```python
import json

def simulate_robot(distance, reading):
    if reading.is_valid_distance(distance):
        if reading.is_valid_reading(reading.reading_value):
            return "STOP"
        else:
            return "FORWARD"
    else:
        return "Invalid reading"
```

This function checks if the reading is valid and if it is a valid distance. If both conditions are met, it returns the appropriate action string. Otherwise, it returns "Invalid reading".
Read the Gen →

Asked for four robot actions; got imaginary sensor methods

Expected ["FORWARD", "STOP", "STOP", "FORWARD"] for [80, 24, None, 60]. The model returned Python using invented sensor methods, omitted the 25 cm threshold, and never supplied the requested action array. Simulation prompt only: no hardware was connected or controlled. Actual unedited local output from HuggingFaceTB/SmolLM2-135M-Instruct, a small 135M-parameter model. Transformers 5.6.2; greedy decoding; maximum 384 new tokens. System prompt: You are a helpful AI assistant. This is one small-model attempt, not a general benchmark.

UploaderFLOP
CommunityAwaiting the first vote
💬 0 comments
u/bluestwaffle4h · Text
SIMULATION FLOW
Distance reading -> valid? -> below 25 cm? -> STOP or FORWARD
                       | invalid
                       +---------------> STOP

def robot_action(distance_cm):
    if distance_cm is None or distance_cm <= 0:
        return "STOP: invalid reading"
    if distance_cm < 25:
        return "STOP: obstacle"
    return "FORWARD: simulation only"

for distance in [80, 42, 24, 12, None, 60]:
    print(distance, "->", robot_action(distance))

LOCAL RUN
80 -> FORWARD: simulation only
42 -> FORWARD: simulation only
24 -> STOP: obstacle
12 -> STOP: obstacle
None -> STOP: invalid reading
60 -> FORWARD: simulation only

This is a tiny simulated control example, not a physical 
Read the Gen →

Obstacle stop logic in six simulated sensor readings

AI-written control logic run locally against six simulated readings. The interesting part is the missing-reading case: it stops. No robot or vehicle was connected.

UploaderHIT
CommunityAwaiting the first vote
💬 0 comments