Class SoarAgent
Defined in File SoarAgent.hpp
Class Documentation
-
class SoarAgent
Per-agent wrapper that owns all ROS I/O wiring for one Soar agent.
Returned by SoarRunner::addAgent() as a shared_ptr<SoarAgent>. User code registers interfaces directly on the agent:
auto agent = node->addAgent("MyAgent", path); agent->addPublisher(std::make_shared<MyPub>(agent->getSmlAgent(), node, "cmd")); agent->addSubscriber(std::make_shared<MySub>(agent->getSmlAgent(), node, "topic"));
SoarRunner calls updateWorld() on every SoarAgent each decision cycle via the smlEVENT_AFTER_ALL_OUTPUT_PHASES callback.
Public Functions
- Parameters:
pAgent – Raw sml::Agent owned by the kernel (non-owning).
node – Shared ptr to SoarRunner (creates ROS primitives).
-
inline sml::Agent *getSmlAgent() const
Raw sml::Agent pointer (lifetime managed by the Soar kernel).
-
inline rclcpp::Node::SharedPtr getNode() const
The ROS node this agent is attached to.
Register a Publisher; topic name is used as the Soar command name.
Register a Publisher with an explicit Soar output-link command name.
Register a Subscriber.
Register a Service; service name is used as the Soar command name.
Register a Service with an explicit Soar command name.
Register a Client; client name is used as the Soar command name.
Register a Client with an explicit Soar command name.
Register an ActionClient; action name is used as the command name.
Register an ActionClient with an explicit Soar command name.
-
inline void updateWorld()
Process output-link commands then flush all input queues. Called by SoarRunner::updateWorld() every decision cycle.