![]() |
ImFusion SDK 4.3
|
#include <RoboticsPlugin/Include/ImFusion/Robotics/RobotRunner.h>
Core class for managing robot execution and real-time control in the ImFusion SDK. More...
Inheritance diagram for RobotRunner:Core class for managing robot execution and real-time control in the ImFusion SDK.
RobotRunner serves as the backbone for implementation robot control system, providing essential functionality for both real and simulated robots. It manages the robot's execution lifecycle, from connection and state monitoring to motion control and error handling.
The RobotRunner tracks motion states using the MotionData structure, which handles active motions and provides completion features for motion synchronization. Additionally robot state updates are emitted through the stateUpdated signal, providing current e.g joint positions, velocities and other robot-specific data.
Derived classes implement specific robot interfaces
Classes | |
| struct | MotionData |
| Data structure holding information about the current motion. More... | |
Public Types | |
| enum | RunnerStatus { Disconnected , Paused , Ready , Moving , Busy , Error } |
| Define the possible states of the robot runner. More... | |
Public Types inherited from DynamicsInterface | |
| enum class | Source { Any , Native , Generic } |
Public Member Functions | |
| RobotRunner (std::unique_ptr< RobotLocation > robotLocation, const std::shared_ptr< RobotInstance > &instance, const RateLimits &rateLimits={}) | |
| Construct the new robot runner. | |
| std::shared_ptr< const RobotState > | lastState () const |
| Get the most recent robot state. | |
| virtual RunnerStatus | status () const =0 |
| Get the current status of the robot runner. | |
| virtual bool | connect ()=0 |
| Establish connection to the robot hardware. | |
| virtual bool | disconnect ()=0 |
| Safety disconnect from the robot hardware. | |
| void | configure (const Properties *p) override |
| Configure the Robot Runner. | |
| void | configuration (Properties *p) const override |
| Retrieve the properties of the RobotRunner. | |
| bool | isConnected () const |
| Check if the robot is currently connected. | |
| MotionGeneratorBase * | activeMotionGenerator () override |
| Get currently active motion generator. | |
| std::optional< std::shared_future< bool > > | currentMotionFuture () const |
| Get the future associated with the current motion execution. | |
Public Member Functions inherited from Configurable | |
| virtual void | configureDefaults () |
| Retrieve the properties of this object, replaces values with their defaults and sets it again. | |
| void | registerParameter (ParameterBase *param) |
| Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration(). | |
| void | unregisterParameter (const ParameterBase *param) |
| Remove the given Parameter or SubProperty from the list of registered parameters. | |
| Configurable (const Configurable &rhs) | |
| Configurable (Configurable &&rhs) noexcept | |
| Configurable & | operator= (const Configurable &) |
| Configurable & | operator= (Configurable &&) noexcept |
Public Member Functions inherited from StatusInterface | |
| StatusInterface (RateLimits rateLimits) | |
| RobotLocation * | robotLocation () const |
| template<typename LocationType> | |
| LocationType * | typedRobotLocation () const |
| template<typename LocationType> | |
| bool | updateRobotLocation (std::unique_ptr< LocationType > newLocation) |
| RateLimits | rateLimits () const |
| virtual void | setRateLimits (RateLimits rateLimits) |
| virtual bool | isMoving () const =0 |
| virtual bool | isError () const =0 |
| virtual bool | canStartNewMotion () const =0 |
| virtual bool | tryRecoverFromError ()=0 |
| virtual void | stopMotion ()=0 |
Public Member Functions inherited from DynamicsInterfaceWithFallback | |
| CoriolisSolution | computeCoriolis (const RobotState &state, Source source) override |
| JacobianSolution | computeJacobian (const RobotState &state, Source source) override |
| GravitySolution | computeGravity (const RobotState &state, Source source) override |
| virtual CoriolisSolution | computeCoriolisNative (const RobotState &state) |
| virtual JacobianSolution | computeJacobianNative (const RobotState &state) |
| virtual GravitySolution | computeGravityNative (const RobotState &state) |
Public Member Functions inherited from DynamicsInterface | |
| CoriolisSolution | computeCoriolis (const RobotState &state) |
| JacobianSolution | computeJacobian (const RobotState &state) |
| GravitySolution | computeGravity (const RobotState &state) |
Public Attributes | |
| Signal< std::shared_ptr< const RobotState > > | stateUpdated |
| Signal emitted when the robot state is updated. | |
Public Attributes inherited from Configurable | |
| Signal | signalParametersChanged |
Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted. | |
Public Attributes inherited from StatusInterface | |
| Signal | motionStarted |
| Signal | motionFinished |
Protected Member Functions | |
| void | publishState (std::shared_ptr< const RobotState > state) |
| Update and publish a new robot state. | |
Protected Attributes | |
| std::optional< MotionData > | m_currentMotionData |
| Active motion data if robot is moving, std::nullopt when idle or motion completed. | |
| std::shared_ptr< RobotInstance > | m_robotInstance |
| Maintains robot kinematic model and joint configuration bounds. | |
| std::shared_ptr< const RobotState > | m_lastState |
| Cached robot state for external queries, updated via publishState() | |
Protected Attributes inherited from Configurable | |
| std::vector< Param > | m_params |
| List of all registered Parameter and SubProperty instances. | |
Protected Attributes inherited from StatusInterface | |
| RateLimits | m_rateLimits |
| std::unique_ptr< RobotLocation > | m_robotLocation |
| Robot location (e.g. | |
Additional Inherited Members | |
Static Public Member Functions inherited from StatusInterface | |
| static std::string | id () |
| enum RunnerStatus |
Define the possible states of the robot runner.
| RobotRunner | ( | std::unique_ptr< RobotLocation > | robotLocation, |
| const std::shared_ptr< RobotInstance > & | instance, | ||
| const RateLimits & | rateLimits = {} ) |
Construct the new robot runner.
| robotLocation | owning pointer to the robot parameters required by the individual robot SDK to connect to a device. |
| instance | encapsulates a RobotModel and handles the distinct variables associated with its kinematics. |
| rateLimits | defines velocity and acceleration limits for robot motion. |
| std::shared_ptr< const RobotState > lastState | ( | ) | const |
Get the most recent robot state.
|
pure virtual |
Get the current status of the robot runner.
Implemented in URRunner.
|
pure virtual |
Establish connection to the robot hardware.
Derived classes should implement this method to: Extract the particular robot location and the dedicated connection parameters (e.g IP address). Initialize hardware communication. Setup monitoring threads if needed. Publish initial robot state.
Implemented in URRunner.
|
pure virtual |
Safety disconnect from the robot hardware.
Derived classes should implement this method to: Check if the robot is currently executing a motion. Stop and clean up any monitoring threads and reset dedicated variables. Release hardware resources and connections.
Implemented in URRunner.
|
overridevirtual |
Configure the Robot Runner.
Reimplemented from Configurable.
|
overridevirtual |
Retrieve the properties of the RobotRunner.
Reimplemented from Configurable.
| bool isConnected | ( | ) | const |
Check if the robot is currently connected.
|
overridevirtual |
Get currently active motion generator.
Implements StatusInterface.
| std::optional< std::shared_future< bool > > currentMotionFuture | ( | ) | const |
Get the future associated with the current motion execution.
|
protected |
Update and publish a new robot state.
Validate the incoming state and store it as the last known state. Notify the subscribers by emitting the stateUpdated signal.
| state | New robot state to publish, must be non-null. |