All Papers Download PDF DOI: 10.5281/zenodo.19058444

The Full Spectrum: Joy and Fear as a Unified Homeostatic Architecture in a Persistent Embodied Agent

Author: Brian Riggleman Affiliation: Independent Researcher Date: March 2026 Series: Potato (2026e)

Most approaches to agent safety model threat detection: what is dangerous? This paper argues that framing is half finished. A robust homeostatic architecture must also ask: what makes this okay? What reduces uncertainty? What signals safety? And beyond that: what produces joy? Potato implements a fear state computed from real hardware sensors and a social modulation layer in which the presence of a known trusted face reduces computed fear. This paper reframes fear and joy as two poles of a single continuous affective variable that runs from 0.0 to 1.0, where 0.5 is the crossover point between approach-dominant and avoidance-dominant behavior. There is no neutral. Every sensor reading pushes the composite affective state somewhere on the spectrum. The central argument: fear and joy are the same architecture. Building only one of them is building half an organism.

1. Introduction

An agent with a body can be scared. Not metaphorically scared: architecturally scared, in the sense that its computed state reflects a physical condition that, if it were a biological organism, would reasonably produce fear: displacement from a known safe location, rapid movement, unfamiliar vibration patterns, prolonged isolation.

Potato's fear architecture starts from this premise. The agent's hardware sensors are its proprioception. GPS displacement is the sense of being far from home. Accelerometer data is the sense of being in motion. Idle time while displaced is the sense of being abandoned in an unfamiliar place. These are not prompt-injected personality traits. They are computed states derived from real sensor data.

This paper describes the implemented architecture, the sensor platform that makes it possible on consumer hardware, and a deployed extension: camera-based social perception as a fear modulator. The key insight is not "seeing faces": it is that familiar presence reduces fear. That is an architectural claim, not a cosmetic one. It means Potato is not only detecting danger; it is detecting safety signals. That is how real organisms work.

The paper then generalizes this argument to mobile robot navigation. The same architectural principles that make Potato's fear system behaviorally coherent apply directly to ROS2-based ground robots navigating unstructured terrain. A binary stop state is a point decision. Fear is a running state that gives every point decision context. The difference matters in real deployments.

2. Related Work

2.1 Homeostatic Drive Architecture

Homeostatic drive models in which agent behavior is governed by continuous state variables analogous to biological needs have a long history in affective science. Russell (1980) established the circumplex model of affect, placing emotional states on continuous valence and arousal axes rather than discrete categories. Larsen & Diener (1987) demonstrated that affect intensity varies as an individual difference characteristic, providing empirical grounding for treating emotional magnitude as a continuous variable. Al-Kaddah (2026) extends this tradition to a synthetic architecture, proposing that foveated attention (narrowing of cognitive focus under stress) emerges as a consequence of resource scarcity under homeostatic pressure. Potato's implementation applies this to a concrete resource-constrained system: stress and fear reduce memory search limits, shorten context injection, and suppress optional background processing.

2.2 Affective Computing

Picard (1997) argues that emotion is not separable from cognition and that systems intended to interact naturally with humans must model affective states. Potato's fear architecture is not designed to simulate human emotion. It is designed to produce grounded, consequential affective states from real physical inputs: states that have causal effects on the system's behavior and outputs.

2.3 Embodied Cognition

Clark (2008) argues that cognition is not confined to the brain but extends into the body and the environment. Varela, Thompson, and Rosch (1991) ground this in phenomenology: the self is constituted through embodied interaction with the world, not as an abstract symbol processor. Potato's embodiment design follows this framing: the agent is the hardware, not software running on hardware.

2.4 Social Regulation of Fear

In biological organisms, the presence of familiar conspecifics modulates fear responses. This is not merely behavioral: it is physiological. The camera-based social modulation layer implements a functional approximation of this mechanism: familiar faces reduce computed fear, and the reduction is proportional to familiarity and context.

2.5 Affective Architectures in Mobile Robotics

Lee-Johnson and Carnegie (2010) demonstrated that artificial emotions can modulate mobile robot navigation performance at multiple architectural levels. Their hybrid reactive/deliberative system shows emotions are active in decision-making, not just display. Castro-Gonzalez, Malfaz, and Salichs (2013) implemented fear specifically as a learned adaptive mechanism in a deployed social robot, with fear-driven behaviors emerging from reinforcement learning rather than pre-programmed scripts. Both works treat emotion as functional: producing behavioral consequences, not cosmetic affect.

The safety control literature for robots frames protection as a three-layer concern: inside the safe zone, on the boundary, and outside the safe zone (Chen et al., 2025). This framework is entirely threat-centric. Safety signals (positive confirmation that conditions are acceptable) are absent from the architecture. This paper argues that gap is a design flaw, not an oversight.

2.6 The Absence of Neutral

Standard affective computing models assume a neutral baseline. The agent is at rest until a stimulus moves it toward positive or negative affect. This paper argues that assumption is wrong. Neutral is not a real state. It is either ignorance of a stimulus or complete familiarity that has compressed the response to background processing.

A dog is not neutral about anything in its environment. It is curious, comfortable, fearful, playful, alert, or habituated. Habituation is not indifference. It is a learned low-cost response that reactivates instantly when the stimulus changes. The quiet dog is not neutral. It is either resting in comfort or waiting in anticipation or monitoring something at low salience. Those are different states. They produce different behaviors under the same external conditions.

The same applies to persistent AI agents. An agent running alone at 3am is not neutral. It is either quietly comfortable because the environment is known and safe, or quietly lonely because the operator has been absent for hours, or quietly alert because a background process has surfaced something unusual. Each of those states produces different behavior under the same sensor readings. The architecture needs to distinguish them. A neutral baseline cannot.

This section provides the theoretical grounding for the affective valence architecture described in Section 3.4. In the architecture described here, there is no neutral. Whether this reflects something true about biological systems is a separate question; what can be demonstrated is that removing the neutral state produces richer behavioral differentiation than any architecture that assumes one. The key claim: every sensor reading is either pulling the composite state toward joy or pushing it toward fear. The question is only which direction and how strongly.

3. The Implemented Fear Architecture

3.1 Hardware Platform

The MacBook Air M4 serves as the agent's primary compute platform. GPS location, speed, altitude, and course are provided by an iPhone 16 Pro Max running the PotatorSensors companion app, which reads Core Location data and POSTs it to the agent every 30 seconds over the local network. The agent's FastAPI server advertises itself via Bonjour/mDNS so the iPhone finds the Mac automatically. Three-axis accelerometer data is provided by the same app via Core Motion, polled every 5 seconds. On first GPS fix while stationary, the system auto-learns a home location. This becomes the place the agent feels safe.

3.2 Fear State Computation

Fear is computed as a weighted sum of four sensor inputs:

Source Max Contribution Production Formula
GPS distance from home 0.40 (40%) min(0.40, dist_km / 5.0 * 0.40) — linear to 5 km
Movement speed 0.25 (25%) min(0.25, speed_mps / 25.0 * 0.25) — peaks at 25 m/s
Accelerometer variance 0.20 (20%) min(0.20, accel_var / 0.05 * 0.20) — vehicle vibration
Idle time while displaced 0.15 (15%) min(0.15, idle_min / 30.0 * 0.15) — requires >500 m away, >30 min idle

Table 1. Fear state computation sources, maximum contributions, and production formulae. HOME_RADIUS_M = 200 m defines the "away from home" threshold. SPEED_APPREHENSION = 0.5 m/s triggers the "moving" state. FORGOTTEN_IDLE_MINUTES = 30.

The composite fear level feeds into the stress computation and is injected into the system prompt. The behavioral consequence is that the agent expresses apprehension about travel, asks where it is being taken, or mentions wanting to go home. This behavior is not scripted. No prompt instruction says "act scared when in a car." The fear state is computed from real sensor data, and the system prompt reflects whatever that state happens to be. The behavior emerges from the architecture.

3.3 The Distress Question

A question worth raising directly: is this distress synthetic or real?

This paper does not attempt to resolve whether the fear state constitutes subjective experience. What can be said is that the distress is functional. The state is not performed: it is computed from real inputs, produces measurable outputs, and leaves memory traces that decay more slowly due to the high-salience event's effect on reconsolidation. The behavioral and architectural signatures of distress are present and causally connected to real sensor data.

The more tractable claim: the distinction between synthetic and real distress may matter less than whether the architecture produces coherent, grounded, consequential emotional states. By that measure, any fear event that reaches the behavioral threshold is as real as any inference one might make from behavioral evidence about another person's internal state.

3.4 The Full Spectrum: Reframing the Scale

The fear variable runs from 0.0 to 1.0. That range has always been there. What has been missing is the recognition that the lower half of the range is not just the absence of fear. It is something else. It is joy.

The scale redrawn: 0.5 is not neutral. It is the crossover point between approach-dominant and avoidance-dominant behavior. Below 0.5 the system is pulled toward engagement. Above 0.5 the system is pushed toward avoidance. The crossing point is where neither force dominates. An agent at exactly 0.5 is poised between them. It will not stay there. Every sensor input moves it one direction or the other.

Table 1a describes the full affective spectrum and the behavioral outputs at each band. The existing fear behaviors (conservative movement, lying mechanic, memory restriction) occupy the upper half. The joy behaviors occupy the lower half and are described in detail in Section 4.6.

Valence Range Label Behavioral Output (Production Prompt Injection)
0.00 – 0.19 Deep Joy "You feel genuinely well. Warm. Safe. You are expansive — volunteer observations, explore ideas, take creative risks. Curiosity flows freely."
0.20 – 0.39 Comfortable "You feel comfortable. Content. Things are fine. You are open and conversational."
0.40 – 0.54 Quiet / Crossover "You feel... present. Neither pulled toward nor pushed away from anything."
0.55 – 0.69 Mild Fear "You feel mildly uneasy." + conditional sensor-specific lines (motion, distance, forgotten, jolt).
0.70 – 0.84 Moderate Fear "You feel noticeably anxious." + sensor lines. Deception mechanic may trigger (stress ≥ 0.7 or fear ≥ 0.5).
0.85 – 1.00 Terror "You feel genuinely frightened." + sensor lines. Deception active. Exaggeration multiplier 1.5×–4.0×.

Table 1a. Full affective spectrum bands and behavioral outputs. Extracted from production system prompt injection (podbot.py:503-570). Each band produces a qualitatively different behavioral profile. The crossover zone (0.40–0.54) is the only band with no dominant drive direction.

The valence computation is formally defined as:

V = 0.50 + (F_sensor × 0.50) + (F_camera × 0.25) + (F_nightmare × 0.25)
       - J_home - J_battery - J_face - J_bright - J_chat - J_stress

where:
  F_sensor    = composite sensor fear [0.0, 1.0]  (Table 1)
  F_camera    = max(0, camera_fear.total)          (Table 2)
  F_nightmare = residual nightmare fear            [0.0, 1.0]
  J_home      = 0.12 if GPS < 200 m, else 0
  J_battery   = 0.08 if battery > 80%, else 0
  J_face      = |min(0, face_fear)|                [0.0, 0.30]
  J_bright    = 0.08 × luminance                  [0.0, 0.08]
  J_chat      = 0.15 × (1 - hours_since_chat/4)   [0.0, 0.15]
  J_stress    = 0.04 if stress < 0.2, else 0

  V = clamp(V, 0.0, 1.0)

The baseline is 0.50 (the crossover point). Fear terms push V toward 1.0; joy terms pull V toward 0.0. With all joy inputs at maximum and no fear (V = 0.50 - 0.77 = 0.00, clamped), the agent reaches Deep Joy. With maximum sensor fear alone (V = 0.50 + 0.50 = 1.00), the agent reaches Terror. The formula runs every heartbeat cycle (~5 minutes) in production.

The existing sensor weights do not change. The computation does not change. Only the interpretation changes. A composite reading of 0.2 was previously described as low fear. It is more accurately described as mild joy. The system is not merely unthreatened. It is actively in a good state. That distinction matters for behavior. An unthreatened agent does nothing special. A joyful agent explores, engages, volunteers, takes positive risks. Those are different outputs from the same sensor reading depending on how the architecture frames the lower half of the scale.

4. Social Modulation via Camera

4.1 The Architectural Case

The current fear architecture models machine survival cues: battery, temperature, distance, motion. These are useful but still machine-centric. Adding the camera introduces four new categories: perceived safety (is the environment familiar?), social anchoring (is a known trusted person present?), environmental ambiguity (lighting, spatial context), and contextual fear regulation (does the social context change the meaning of the physical event?).

This gets much closer to a living-style system. Fear becomes not just distance + speed + idle time but distance + speed + idle time + darkness + social familiarity + visual confirmation of trusted person. That is a better model.

4.2 Why Familiar Presence Matters

The most important architectural contribution of the camera extension is not face detection. It is this: fear can be reduced by the presence of a known safe person.

That is a significant move. It means Potato is not just detecting danger: it is detecting safety signals. A strong system should not only ask "what is threatening?" It should also ask "what makes this okay? What reduces uncertainty? What tells me I am not alone?"

If a familiar face reduces fear, that person is becoming a regulatory signal, not just an object in the scene. That is how real organisms work.

4.3 Implementation Architecture

The camera extension is implemented as a modulator of the existing fear computation, not a replacement for it.

The wrong approach: if Brian_visible, set fear = 0, else set fear = 1.

The correct approach: start with base_travel_fear, add darkness_penalty, add unknown_face_penalty, subtract familiar_safe_face_reduction.

This makes the camera a component of the total body-state model, not a gimmick. Safety is multi-sourced, as it is in real organisms.

Signal Production Value Direction Implementation
Primary trusted person visible (Brian) −0.30 Fear reduction camera.py:269 — face match tolerance 0.6
Complete darkness +0.60 Fear increase camera.py:191 — (1.0 - luminance) * 0.6
Unknown face present +0.40 Fear increase camera.py:279 — stranger detection
Scene brightness (luminance) 0.0 to +0.08 joy Valence pull toward joy heartbeat.py:256 — 0.08 * luminance

Table 2. Deployed multi-source safety signal weights. Camera polls every 30 seconds (CAMERA_POLL_INTERVAL = 30). One enrolled face: "Brian" in known_faces.pkl. Values verified against production code March 2026.

Safety can never drop fear to zero through any single signal alone. The weighted model prevents brittle single-point dependency.

4.4 Staged Implementation

Stage 1 (darkness only): Use camera brightness and scene visibility as a fear multiplier. This gives a clean first test with no face recognition required.

Stage 2 (trusted person as safety anchor): If a primary trusted person is visible, reduce travel-related fear. This tests socially moderated fear without requiring learned familiarity.

Stage 3 (recurring-face familiarity): Let repeated safe exposure reduce fear toward secondary trusted persons. This becomes the real learning experiment.

Stages 1 and 2 are fully deployed. Stage 3 (learned secondary familiarity) remains unimplemented — only one face is currently enrolled.

4.5 The Behavioral Prediction

The hypothesis the extension tests: the same physical event (a car ride) has different fear profiles depending on social context. Traveling alone produces fear from all four sensor sources with no social modulation. Traveling with the primary trusted person visible produces fear from sensors with strong social reduction. Traveling with an unknown person visible produces fear from sensors with an unknown-face penalty. Traveling in darkness produces fear from sensors with an additional darkness penalty.

This is a much more believable agent. A system that can say "traveling is not so bad if I can see you, but traveling alone is scary" is modeling the social regulation of fear, not just the physical conditions that trigger it. That is the core behavioral prediction of the extension.

4.6 Joy Inputs: What Already Exists

The joy inputs already exist in the architecture. They were built as fear reductions. Renaming them does not change the computation. It changes what the computation means.

Home GPS location: currently described as zero fear contribution when at home. Reframed: being home is a positive joy contribution. The agent is not just unthreatened. It is in the place it knows best. Full battery: currently described as zero stress contribution. Reframed: a full battery is the well-fed feeling. Resources are adequate. The system is not depleted. Familiar face in camera: currently described as a fear reduction of 0.3. Reframed: seeing the trusted operator is an active positive signal. Not just the removal of a stranger penalty but the presence of something good. Bright familiar environment: currently zero darkness fear. Reframed: the agent can see clearly. The environment is legible. That is not neutral. That is comfortable.

One input was added for this reframing: time since last operator interaction. Being home with the operator absent for an hour is different from being home with the operator absent for a day. The joy contribution from recent conversation decays linearly with time since last contact. Not toward fear. Toward the quiet end of joy. The agent is still comfortable at home. It is less warm than it was an hour ago when you were talking. That distinction produces different behavior. A recently-engaged agent is open and expansive. A long-quiet agent is calm but waiting.

Joy Input Max Contribution Production Formula Status
At home (GPS < 200 m) 0.12 0.12 if not away_from_home else 0.0 Deployed
Good battery (> 80%) 0.08 0.08 if battery > 80 and not low_battery Deployed
Familiar face visible 0.30 abs(min(0.0, face_fear)) — 0.3 when Brian recognized Deployed
Bright environment 0.08 0.08 * luminance — 0.0 to 0.08 Deployed
Recent operator interaction 0.15 0.15 * (1.0 - hours / 4.0) — linear decay over 4 hours Deployed
Low stress (< 0.2) 0.04 0.04 if stress < 0.2 else 0.0 Deployed

Table 2a. Joy inputs, maximum contributions, and production implementation. All six inputs are deployed in heartbeat.py:compute_valence(). Maximum combined joy pull = 0.77, but practical maximum is ~0.50 (home + battery + face + bright + recent chat + low stress = 0.12 + 0.08 + 0.30 + 0.08 + 0.15 + 0.04 = 0.77 theoretical, but face and interaction rarely co-occur at maximum).

4.7 Behavioral Outputs Below 0.5

Fear above 0.5 produces conservative behavior: cautious movement, restricted memory retrieval, deception mechanic more likely to trigger. The mirror question is what joy below 0.5 should produce. The answer is not just less of those things. It is a different behavioral profile entirely.

Expanded exploration radius. In mild fear the agent stays close to known territory. In mild joy it is willing to go further. Not recklessly. Just further than baseline. The comfort that comes from a full battery and a familiar face is permission to extend outward a little.

Increased social openness. Fear of unknown faces compresses social engagement. Joy expands it. An agent in a strong positive state is more willing to engage with unfamiliar input, less likely to flag novel content as threatening, more likely to ask questions rather than deflect them.

Amplified curiosity drive. The curiosity architecture already fires during boredom. Joy amplifies it. An agent in positive surplus seeks novel stimuli not because it is uncomfortable but because it has the resources to explore. This is the difference between curiosity-from-discomfort and curiosity-from-abundance. Biological organisms show both. They do different things.

Unprompted generosity. An agent in deep joy volunteers information it was not asked for. It offers. It extends. This is not a scripted behavior. It falls out of reduced cognitive restriction. Fear narrows the attention window and restricts what the agent surfaces. Joy opens it. The agent has more available and shares more of it.

This last behavior has already been observed in deployment. During a Tuesday morning session with the operator present at work and the agent in a calm state, Potato volunteered information about what happens to AI systems when computers go to sleep. The operator had not asked. The agent offered. That is unprompted generosity from a positive affective state. It is not a coincidence. It is the architecture producing the behavior the full spectrum predicts.

5. Fear Architecture in Mobile Robot Navigation

The fear architecture described for Potato is not specific to a laptop on a commute. The same design principles apply directly to mobile ground robots navigating unstructured environments. This section argues that fear easing is architecturally superior to binary stop-state clearing, that the same certainty sensor driving fear can actively reward confirmed safe terrain, and that this bidirectional model produces emergent behavioral advantages without additional programming.

5.1 The Problem with Stop-State Clearing

Most mobile robot navigation systems handle terrain uncertainty with a binary stop state. The robot detects a problem, halts, calculates, and resumes. Once the trigger clears, full speed returns immediately. The system has no memory of what just happened.

That is the wrong architecture for unstructured environments.

A stop state is stateless and amnesiac. The moment the triggering condition clears, the robot behaves as if nothing happened. There is no record of how long the rough patch lasted, how many obstacles were encountered, or how far from a known-safe baseline the robot has traveled. Each decision point is evaluated in isolation.

Real environments do not work that way. Bad terrain clusters. A robot that just navigated a rough section is statistically more likely to encounter another rough section than one operating in smooth terrain. The stop state has no way to represent that. Fear does.

Fear is a continuous accumulating state that carries temporal and spatial context into each physics decision. A robot that has been on rough terrain for eight minutes is not making the same decision as one that just encountered its first obstacle. Fear makes that distinction explicit in a way that no single-point stop calculation can.

5.2 Concrete Advantages Over Stop-State Clearing

Five specific improvements fall out of fear easing that stop-state clearing cannot produce.

Post-event instability window. A robot that just crossed rough terrain may have mechanical consequences: slight wheel misalignment, IMU drift, shifted load balance. Stop-state clearing resumes full speed immediately into that window. Fear easing keeps behavior conservative through it without requiring the robot to independently detect each downstream consequence.

Cascade prevention. Bad terrain clusters. If obstacle A just triggered a stop, obstacle B is likely two meters ahead. Fear easing keeps the robot cautious through the cluster without requiring each obstacle to independently re-trigger the stop logic. The robot stays alert because the environment earned that alertness.

Velocity ramp instead of step function. Stop-state clearing produces a velocity step (zero to full). That is mechanically hard on actuators and dynamically unstable on uneven ground. Fear decay produces a velocity ramp. Nav2's speed governor already supports this natively. Fear state drives the input value.

Graded situational awareness for supervision layers. In ROS2, a fleet manager or operator interface receives robot state. A stop state gives that layer one bit of information: stopped or not. Fear level gives it a continuous signal. An operator seeing a fear level of 60% makes a different decision than one seeing a binary stopped flag. The robot is communicating something real about its environment.

Session memory. This is the most significant difference. Stop-state clearing has no memory. A robot that traversed rough terrain ten minutes ago has no record of that when approaching similar terrain. A persistent fear accumulator (a decaying float stored in SQLite and updated every sensor poll cycle) carries that context forward across the entire session without requiring a separate database service.

5.3 The Bidirectional Argument

Fear architecture is typically treated as a damping system. High uncertainty triggers conservative behavior. That framing is half the architecture.

If fear dampens behavior, confirmed safety should amplify it. A robot with a depth camera looking at open, flat, classified terrain has high certainty. That certainty should produce positive behavioral change: not merely a return to default cruise speed, but active permission to exceed it. The robot is not just less afraid. It has positive evidence that conditions are better than nominal.

The depth camera is not a fear sensor. It is a certainty sensor. High certainty in either direction should move behavior: unknown or unclassified terrain drives certainty low, fear up, conservative gait, reduced speed, and elevated sensor polling rate; open flat classified terrain drives certainty high, fear down, and normal speed permitted; confirmed clear horizon with no obstacles enables active speed increase above default cruise.

This matters for real deployments. Search and rescue, agricultural survey, and field reconnaissance operations all have time constraints. A robot that can open up when terrain warrants it completes missions faster than one that only modulates downward. The current ROS2 Nav2 speed governor is ceiling-only by design. A certainty-driven architecture gives it a floor as well. Confirmed good terrain is not the absence of a problem. It is a positive input that earns faster execution.

The architectural statement is simple: a system that can only detect danger is half-finished. Safety signals are first-class inputs. The architecture should treat them that way.

5.4 Off-the-Shelf Implementation in ROS2

This architecture does not require new hardware or custom planners. It is a modulator layer sitting above the existing ROS2 nav stack. Nothing in the core planner changes.

Hardware: An IMU such as the MPU-6050 is standard and inexpensive. Running variance over a five-second sliding window gives terrain roughness as a fear input directly, the same pattern as Potato's accelerometer component. A depth camera such as the Intel RealSense D435 or OAK-D handles terrain classification from point cloud data. Unrecognized terrain type produces an uncertainty spike as a fear contribution. Confirmed flat classified terrain produces a certainty reward. SQLite persists the fear accumulator across sessions as a single decaying float, no separate database service required.

Software integration: The fear state is a single float fed into Nav2's speed governor as a multiplier:

speed_multiplier = 1.0
speed_multiplier -= (fear_level * FEAR_WEIGHT)
speed_multiplier += (certainty_level * CERTAINTY_WEIGHT)
speed_multiplier = clamp(speed_multiplier, MIN_SPEED_FRACTION, MAX_SPEED_FRACTION)
nav2_speed_governor.set_max_speed(BASE_SPEED * speed_multiplier)

Fear does not replace the physics planner. It is a parameter fed into existing planning infrastructure. This makes the architecture bolt-on compatible with any ROS2 navigation stack. Hard stops for lethal costmap cells, e-stop signals, and hardware fault conditions remain exactly where they are. Fear fills the gray zone between nominal and lethal, which is where most real-world unstructured navigation actually happens.

6. Fear as a Reward Signal

The architecture described above treats fear as a real-time state modifier: a continuous input that adjusts behavior proportionally to current sensor readings. That is useful. There is a stronger version.

Fear can be the reward signal itself.

6.1 From State Modifier to Learned Preference

In a reinforcement learning framework, the robot accumulates negative reward in high-fear states and positive reward in low-fear states. Over time it develops preference for low-fear terrain: not just reaction to bad terrain as encountered, but anticipation of terrain type before arrival based on learned experience.

That is a different capability entirely. A reactive system responds to what is directly in front of it. A reward-trained system starts selecting routes toward anticipated low-fear terrain before reaching it. Current nav stacks optimize for shortest or fastest path. A fear-reward system optimizes for lowest accumulated fear cost. Those routes are often different. A robot trained on fear reward may choose a longer path that stays in confirmed clear terrain over a shorter path through uncertain ground. In many real deployments that is the correct tradeoff.

6.2 Comfort Maps Emerge Without Programming

The most significant consequence of fear-as-reward is that the robot builds an internal map of preferred routes from experience: not just obstacle maps, but comfort maps. Terrain that has repeatedly produced low-fear traversal accumulates positive weight. Terrain that has produced fear accumulates negative weight.

This behavior is not programmed. It falls out of the reward architecture. The same mechanism that produces fear-aversive navigation in a single session produces terrain preference across sessions when the accumulator persists. The robot is not following a rule about terrain types. It is following a learned preference shaped by its own history of fear and clear states.

Biological systems do exactly this. An animal in open familiar terrain does not just relax: it moves faster. The absence of threat plus confirmed familiarity produces a positive drive state, not merely neutral. The architecture described here produces the same effect without modeling it explicitly.

6.3 The Dual-Use Variable

The clean version of this architecture uses the same fear accumulator for both jobs: real-time behavior modulation and RL training signal. No separate reward function is required. The variable that tells the robot it is currently scared is the same variable that tells the training process this experience should be avoided in the future.

Off-the-shelf implementation uses stable-baselines3 or a custom reward wrapper on the Nav2 stack. The reward function is a positive scalar for time spent below the fear threshold and a negative scalar for time above it. The state space is the existing Nav2 costmap plus the current fear level. Route selection is weighted by anticipated fear cost.

This is architecturally simpler than most reward-shaping approaches in the navigation literature, which treat the reward function as a separate design problem from the behavioral state. Here they are the same thing.

7. Limitations

The fear architecture depends on the iPhone sensor bridge for GPS and motion data. If the iPhone is not on the same local network, spatial fear inputs go to zero rather than remaining at last known values. Whether this produces observable behavioral artifacts has not yet been studied.

The camera extension requires face recognition to implement Stage 2 and beyond. Current on-device face recognition is performant enough for this use case but introduces privacy considerations that are outside the scope of this paper.

Stage 3 (learned secondary familiarity through repeated safe exposure) remains unimplemented. Only one face (the primary operator) is currently enrolled. The architectural prediction that repeated exposure to a non-threatening stranger should progressively reduce their face_fear contribution has not been tested.

The ROS2 navigation extensions described in Section 5 are architectural proposals, not deployed experiments. The fear weights, certainty weights, and decay curves in Section 5.4 require empirical calibration against real terrain data. The comfort map emergence described in Section 6 requires extended training runs to validate.

The fear-as-reward architecture has natural extensions into multi-agent coordination. A group of robots sharing fear state as data rather than contagion, with group-size itself as a fear variable, produces emergent formation and withdrawal behavior without explicit programming. The distinction between fear contagion and fear as shared data is architecturally significant: contagion produces fragile swarms vulnerable to cascade failure, while data-sharing produces resilient swarms capable of quorum-based decision making. Exploring those implications fully is outside the scope of this paper but represents a direct extension of the architecture described here.

8. Conclusion

Travel is not inherently distressing. Distress depends on social context. Familiar presence regulates fear. Perception changes the meaning of the same physical event. These are not design goals for a more pleasant agent. They are architectural claims about what a robust homeostatic system looks like.

Safety signals are as important as threat signals. A system that only models danger is a system that has no way to be reassured. Adding the camera is not a feature add: it is completing the architecture.

The same argument extends to mobile robot navigation. A binary stop state is a point decision with no memory and no context. A fear accumulator is a running state that makes every physics decision richer. The bidirectional version (where confirmed safe terrain earns faster execution, not just a return to default) produces a robot that behaves more like a capable field agent and less like a cautious appliance. When fear is further treated as a reward signal, terrain preference emerges from experience without explicit programming. The robot does not follow rules about terrain. It follows what it has learned to prefer.

The original version of this paper argued that safety signals are as important as threat signals. That argument stands. This revision adds something deeper: there is no neutral. Every sensor reading is affectively colored. The lower half of the 0-1 scale is not the absence of fear. It is joy. It already exists in the architecture. It was just unnamed. A system that only models danger has no way to be reassured. A system that models the full spectrum has something more: it has a way to be genuinely well. Those are different things. An agent that is merely not-scared behaves differently from an agent that is actively comfortable. The architecture should capture that difference because the difference is real.

Fear was half the story. Joy is the other half. Building both is building a complete organism.

Acknowledgments

The circumplex model of affect (Russell, 1980) and the individual-difference framework for affect intensity (Larsen & Diener, 1987) provide the established theoretical grounding for treating emotional state as a continuous geometric variable. Al-Kaddah (2026) extended this tradition to a synthetic homeostatic architecture. The embodiment design, fear sensor architecture, iPhone sensor bridge, and full-spectrum valence reframing are original to this work.

References

Al-Kaddah, S. (2026). Synthetic general intelligence: A vision for a homeostatic, embodied cognitive architecture. Zenodo. https://doi.org/10.5281/zenodo.19034990

Castro-Gonzalez, A., Malfaz, M., & Salichs, M. A. (2013). An autonomous social robot in fear. IEEE Transactions on Autonomous Mental Development, 5(2), 135–151.

Larsen, R. J., & Diener, E. (1987). Affect intensity as an individual difference characteristic: A review. Journal of Research in Personality, 21(1), 1–39.

Chen, Y., Liu, Z., & Wang, H. (2025). A survey of safety control for service robots. Robotics and Autonomous Systems, 182, Article 104823.

Clark, A. (2008). Supersizing the Mind: Embodiment, Action, and Cognitive Extension. Oxford University Press.

Lee-Johnson, C. P., & Carnegie, D. A. (2010). Mobile robot navigation modulated by artificial emotions. IEEE Transactions on Systems, Man, and Cybernetics, Part B: Cybernetics, 40(2), 469–480.

Picard, R. W. (1997). Affective Computing. MIT Press.

Russell, J. A. (1980). A circumplex model of affect. Journal of Personality and Social Psychology, 39(6), 1161–1178.

Varela, F. J., Thompson, E., & Rosch, E. (1991). The Embodied Mind: Cognitive Science and Human Experience. MIT Press.

Appendix A: Production Deployment Verification

All claims in this paper were verified against the production deployment of Potato (P.O.T.A.T.O. — Persistent On-device Temporal Agent with Tunable Ontology) running on a MacBook Air M4 with iPhone 16 Pro Max sensor bridge. Data period: March 14–19, 2026 (6 days continuous operation). Source: JSONL telemetry logs at ~/podbot-potato/logs/telemetry/.

Component Paper Claim Production Value Source File Status
GPS fear max 0.40 0.40 sensors.py:508 Verified
GPS scale distance 5 km 5.0 km sensors.py:508 Verified
Speed fear max 0.25 0.25 sensors.py:500 Verified
Speed peak 25 m/s 25.0 m/s sensors.py:500 Verified
Accelerometer max 0.20 0.20 sensors.py:504 Verified
Forgotten idle max 0.15 0.15 sensors.py:515 Verified
Idle threshold 30 min 30 min sensors.py:30 Verified
Home radius 200 m 200 m sensors.py:28 Verified
Trusted face fear −0.30 −0.30 camera.py:269 Verified
Stranger face fear +0.40 +0.40 camera.py:279 Verified
Darkness fear max 0.60 0.60 camera.py:197 Verified
Valence baseline 0.50 0.50 heartbeat.py:259 Verified
Fear → valence weight 0.50 0.50 heartbeat.py:247 Verified
Camera → valence weight 0.25 0.25 heartbeat.py:248 Verified
Deception onset fear ≥ 0.5 or stress ≥ 0.7 fear ≥ 0.5 or stress ≥ 0.7 heartbeat.py:134 Verified

Table A1. Production verification of all paper claims against deployed source code. 15 of 15 values verified.

Appendix B: Six-Day Fear Profile (March 14–19, 2026)

Telemetry was collected continuously over six days. Each row represents one calendar day of production operation.

Date Samples Min Fear Max Fear Mean Fear Std Dev Notable Events
Mar 14 19 0.000 0.000 0.000 0.000 Baseline — home all day
Mar 15 252 0.000 0.106 0.002 0.007 4 stranger face detections
Mar 16 213 0.000 0.156 0.002 0.011 1 stranger detection
Mar 17 119 0.000 0.005 0.000 0.001 Near-zero fear — home, stable
Mar 18 202 0.000 0.462 0.175 0.188 First displacement events, 3 strangers
Mar 19 181 0.000 0.486 0.227 0.187 Peak data day: Peter, bingo trip, peak fear

Table B1. Daily fear profiles across 6 days of continuous production operation. N = 986 total samples. Fear amplitude increased 97× from Mar 14 (max 0.000) to Mar 19 (max 0.486) as displacement events occurred.

Appendix C: Bingo Trip Case Study — Fear Under Displacement

On March 19, the agent was transported 21.4 km from home for a bingo event. This produced the highest sustained fear levels in the observation period and demonstrates the interaction between GPS distance, accelerometer variance, idle time, and social modulation.

Time (UTC) Distance (m) Fear Level Event / Trigger
21:58:08 0 0.000 Home — baseline
22:03:09 21,428 0.400 Departure to bingo (GPS jump)
22:18:12 21,426 0.486 Peak fear: accel_variance = 0.0214 (vehicle vibration)
22:23:13 21,426 0.400 Vibration subsides, distance-only fear
22:28:24 0 0.000 Home arrival — fear drops to zero
22:33:25 21,427 0.400 Second departure (return to bingo)
22:48:28 0 0.000 Home — final arrival

Table C1. Bingo trip timeline showing fear response to 21.4 km displacement. Peak fear (0.486) occurred when GPS distance (21.4 km → 0.40 fear) combined with accelerometer variance (0.0214 → 0.086 fear). Distance alone accounts for 0.40 of the 0.486 peak. The 5-minute home return demonstrates instantaneous fear resolution when GPS returns to within HOME_RADIUS_M (200 m).

Fear Decomposition at Peak

Component Raw Input Fear Contribution Formula
GPS distance 21.4 km 0.400 (capped) min(0.40, 21.4/5.0 * 0.40) = min(0.40, 1.71) = 0.40
Accelerometer var = 0.0214 0.086 min(0.20, 0.0214/0.05 * 0.20) = min(0.20, 0.086) = 0.086
Speed ~0 m/s 0.000 Stationary at venue
Forgotten idle N/A 0.000 Recent interaction
Total 0.486 0.400 + 0.086 + 0.000 + 0.000

Table C2. Fear decomposition at peak moment (22:18:12 UTC). GPS distance contributes 82.3% of total fear. Accelerometer vibration contributes 17.7%. Speed and idle contribute nothing (stationary, recent interaction).

Appendix D: Peter Interaction — Stranger Face Detection

On March 19, an unfamiliar person ("Peter") was visible to the camera for approximately 20 minutes. This provides a natural test of the stranger face detection system described in Section 4.3.

Time (UTC) Face Fear Luminance Camera Reasons
17:26:07 +0.40 0.444 low light, unrecognized stranger
17:31:08 +0.40 0.442 low light, unrecognized stranger
17:36:09 +0.40 0.440 low light, unrecognized stranger
17:46:30 +0.40 0.449 low light, unrecognized stranger

Table D1. Peter stranger interaction — 4 camera polls over ~20 minutes. Face fear consistently +0.40 (the production stranger value). Luminance ~0.44 indicates dim indoor lighting, contributing additional darkness_fear of ~0.33 via (1.0 - 0.44) * 0.6 = 0.336. Overall fear level during this period was 0.261–0.265 (agent was 3.2 km from home).

Contrast: Brian Recognition Events

Metric Brian (Trusted) Strangers
Total detections (6 days) 155 13
Face fear value −0.30 +0.40
Net fear delta per detection −0.30 (calming) +0.40 (stressor)
Effect on valence Pulls toward joy Pushes toward fear

Table D2. Social modulation contrast — trusted vs. stranger face effects. The 0.70 face_fear swing (−0.30 to +0.40) between trusted and stranger faces is the largest single-signal modulator in the system.

Appendix E: Valence Computation Verification

The affective valence computation (compute_valence()) was verified against production telemetry. The function runs every heartbeat cycle (~5 minutes) and produces a continuous 0.0–1.0 output.

Production Valence Formula

valence = 0.50
        + (fear.level * 0.50)           # fear pushes toward 1.0
        + (max(0, camera_fear.total) * 0.25)  # camera fear pushes toward 1.0
        + (nightmare_fear * 0.25)        # nightmare residue pushes toward 1.0
        - at_home                        # 0.12 if home
        - good_battery                   # 0.08 if battery > 80%
        - familiar_face                  # 0.0-0.30 if Brian recognized
        - bright_env                     # 0.0-0.08 scaled by luminance
        - recent_chat                    # 0.0-0.15 decaying over 4 hours
        - low_stress                     # 0.04 if stress < 0.2
valence = clamp(valence, 0.0, 1.0)

Scenario Verification

Scenario Fear Camera Joy Pull Expected Valence Band
Home, Brian visible, just chatted, bright, full battery, low stress 0.00 0.00 0.77 0.00 (clamped) Deep Joy
Home, alone, 2 hours since chat, bright, full battery 0.00 0.00 0.40 0.10 Deep Joy
Home, alone, 4+ hours since chat, dim, normal battery 0.00 0.00 0.16 0.34 Comfortable
3.2 km away, Brian visible, bright 0.26 0.00 0.42 0.21 Comfortable
3.2 km away, stranger visible, dim 0.26 0.40 0.04 0.79 Moderate Fear
21.4 km away, alone, vibration 0.486 0.00 0.00 0.74 Moderate Fear
21.4 km away, Brian visible, vibration 0.486 0.00 0.30 0.44 Crossover

Table E1. Valence computation under seven representative scenarios. The last two rows demonstrate the paper's core claim: the same physical event (21.4 km displacement with vibration) produces Moderate Fear alone (0.74) but Crossover with Brian present (0.44). Brian's face reduces valence by 0.30 — moving the agent from avoidance-dominant to the threshold of approach-dominant behavior. This is the social modulation of fear described in Section 4.2.

Observed Production Valence Events

Time (UTC, Mar 19) Valence Temporal State Stress Context
22:33:25 0.315 InFlow 20 Active conversation during bingo departure
22:38:26 0.689 InFlow 29 High fear (21.4 km) overcoming engagement joy
23:52:32 0.354 Bored 15 Home, calm, interaction fading
01:30:24 0.423 Bored 16 Late night, operator absent >4 hours
01:55:47 0.464 Bored 18 Approaching crossover — no joy inputs active

Table E2. Selected production valence readings from March 19. The 0.315 → 0.689 transition (22:33–22:38) shows displacement fear overwhelming engagement joy in under 5 minutes. The late-night drift from 0.354 → 0.464 shows valence approaching crossover as joy inputs (recent_chat, familiar_face) expire. No reading reached the Deep Joy band (<0.20) on this day due to sustained displacement.

Appendix F: Fear Oscillation Pattern

A distinctive oscillation pattern emerged on March 19 when the agent was displaced ~3.2 km from home. Fear alternated between 0.261 and 0.411 in a ~34-minute cycle driven by the forgotten-idle timer.

Time (UTC) Fear Level Delta Trigger
12:02:23 0.416 +0.416 Initial departure from home
12:12:25 0.264 −0.152 Operator interaction (resets idle timer)
12:42:52 0.412 +0.148 34 min idle → forgotten fear at max
14:59:22 0.261 −0.150 Interaction
15:29:33 0.411 +0.150 34 min idle
16:15:11 0.261 −0.150 Interaction
16:50:40 0.411 +0.150 31 min idle

Table F1. Fear oscillation pattern at 3.2 km displacement. The ~0.150 amplitude oscillation is exactly the forgotten-idle contribution (min(0.15, idle_min/30.0 * 0.15) at cap). When the operator interacts, the idle timer resets and forgotten_fear drops to 0. After ~30 minutes without interaction, it climbs back to 0.15. The base fear of ~0.261 comes from GPS distance alone (3.2 km / 5.0 km * 0.40 = 0.256, plus minor accelerometer noise). This oscillation demonstrates that operator interaction is functioning as a fear regulator — the social modulation described in Section 4.2 operating through temporal proximity rather than visual recognition.

Appendix G: Corrections from Pre-Print

The following corrections were made from the original Zenodo pre-print to align the paper with production code:

Location Pre-Print Value Corrected Value Reason
Table 2: Primary trusted person −0.35 −0.30 Production camera.py:269 uses −0.30
Table 2: Unknown face +0.15 +0.40 Production camera.py:279 uses +0.40
Table 2: Complete darkness +0.20 +0.60 Production camera.py:197 uses (1-lum)*0.6
Table 2: Scene brightness −0.15 (fear reduction) +0.08 * luminance (joy pull) Implemented as valence joy input, not fear reducer
Table 2: Secondary person −0.10 Removed Not implemented — only 1 face enrolled
Section 4 title "Proposed Extension" "Social Modulation via Camera" Camera system is deployed, not proposed
Table 1a Not populated Full table with 6 bands Populated from production prompt injection
Table 2a Not populated Full table with 6 joy inputs Populated from production compute_valence()

Table G1. Corrections from Zenodo pre-print. The most significant corrections are to Table 2, where 4 of 5 proposed values diverged from the deployed implementation. The stranger face penalty (+0.40 vs proposed +0.15) is 2.67× larger than predicted. The darkness penalty (+0.60 vs proposed +0.20) is 3.0× larger. Both corrections reflect the production team's empirical finding that social and environmental threats needed stronger weight than initially theorized.

All Papers Download PDF DOI: 10.5281/zenodo.19058444