Reasoning Table Placement

reasoning_table_placement.py

Overview

reasoning_table_placement.py is a bridge between cognition and the manipulation stack. It listens to high-level decisions on /{robot}/placement_decision and maps them onto low-level commands that the arm / gripper planners understand.

Interfaces (strongly-typed, stateless)

Direction

Topic

Message type

Notes

Required

/{robot}/placement_decision

std_msgs/String

e.g. "Decision: PLACE, IGNORE"

Provided

/{robot}/table_reasoning_commands

std_msgs/String

"PLACE_DISH" | "CLEAR_TABLE" | "NO_ACTION"

Food Placement Integration KPIs

Metric

Target

Placement decision time (/placement_decision/table_reasoning_commands)

≤ 200 ms

Spot-detection accuracy (correctly free & stable spots)

≥ 95 %

Replanning responsiveness (after clutter update)

≤ 100 ms

Decision Mapping

Decision

Published cmd

Rationale

PLACE

PLACE_DISH

Room for one more plate

CLEAR

CLEAR_TABLE

Table finished; remove crockery

other

NO_ACTION

Either “FULL” or “IGNORE” → do nothing

Contract

Pre-conditions

  • Upstream decision topic must contain “Decision:” and one keyword.

Post-conditions

  • Exactly one command published per decision message.

  • Mapper never blocks; if queue is full older commands drop first (queue_size=10).

Implementation notes

  • Uses simple substring checks so future metadata (timestamps, scores) won’t break parsing.

  • Publisher is latched at 10 messages to absorb bursts.

  • All log lines throttled or filtered to keep console tidy.

class reasoning_table_placement.ReasoningTablePlacement[source]

Bases: object

Runtime object that wires subscriber → callback → publisher.

  1. Initialise ROS under {robot}_reasoning_table_placement_node

  2. Subscribe to high-level decisions.

  3. Advertise low-level commands.

decision_callback(msg)[source]

Translate DecisionCommand.

Translation logic

  • contains PLACEPLACE_DISH

  • else contains CLEARCLEAR_TABLE

  • otherwise → NO_ACTION

reasoning_table_placement.main()[source]

Instantiate node and hand control to ROS spin loop.