ImFusion SDK 4.3
RobotRunner Class Referenceabstract

#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:

Detailed Description

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

See also
FrankaRobotRunner and should handle
  • Hardware connection/disconnection logic
  • State monitoring and updates
  • Motion execution and control

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 RobotStatelastState () 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.
 
MotionGeneratorBaseactiveMotionGenerator () 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
 
Configurableoperator= (const Configurable &)
 
Configurableoperator= (Configurable &&) noexcept
 
- Public Member Functions inherited from StatusInterface
 StatusInterface (RateLimits rateLimits)
 
RobotLocationrobotLocation () 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< MotionDatam_currentMotionData
 Active motion data if robot is moving, std::nullopt when idle or motion completed.
 
std::shared_ptr< RobotInstancem_robotInstance
 Maintains robot kinematic model and joint configuration bounds.
 
std::shared_ptr< const RobotStatem_lastState
 Cached robot state for external queries, updated via publishState()
 
- Protected Attributes inherited from Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.
 
- Protected Attributes inherited from StatusInterface
RateLimits m_rateLimits
 
std::unique_ptr< RobotLocationm_robotLocation
 Robot location (e.g.
 

Additional Inherited Members

- Static Public Member Functions inherited from StatusInterface
static std::string id ()
 

Member Enumeration Documentation

◆ RunnerStatus

Define the possible states of the robot runner.

Enumerator
Disconnected 

Robot is not connected to the hardware.

Paused 

Robot execution is temporarily suspended.

Ready 

Robot is connected and ready to accept commands.

Moving 

Robot is currently executing a motion.

Busy 

Robot is performing an operation other than motion.

Error 

An error condition has occurred.

Constructor & Destructor Documentation

◆ RobotRunner()

RobotRunner ( std::unique_ptr< RobotLocation > robotLocation,
const std::shared_ptr< RobotInstance > & instance,
const RateLimits & rateLimits = {} )

Construct the new robot runner.

Parameters
robotLocationowning pointer to the robot parameters required by the individual robot SDK to connect to a device.
instanceencapsulates a RobotModel and handles the distinct variables associated with its kinematics.
rateLimitsdefines velocity and acceleration limits for robot motion.

Member Function Documentation

◆ lastState()

std::shared_ptr< const RobotState > lastState ( ) const

Get the most recent robot state.

Returns
shared pointer to the recent robot state or nullptr if not available. The retrieved data is read-only and cannot be modified.

◆ status()

virtual RunnerStatus status ( ) const
pure virtual

Get the current status of the robot runner.

Returns
an identifier of the robot runner's operational state.

Implemented in URRunner.

◆ connect()

virtual bool connect ( )
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.

Returns
true if connection was successful, false if the connection failed.

Implemented in URRunner.

◆ disconnect()

virtual bool disconnect ( )
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.

Returns
true if disconnection was successful, false if the robot is busy executing a motion or disconnection failed.
Note
should not disconnect while the robot is executing a motion.

Implemented in URRunner.

◆ configure()

void configure ( const Properties * p)
overridevirtual

Configure the Robot Runner.

Reimplemented from Configurable.

◆ configuration()

void configuration ( Properties * p) const
overridevirtual

Retrieve the properties of the RobotRunner.

Reimplemented from Configurable.

◆ isConnected()

bool isConnected ( ) const

Check if the robot is currently connected.

Returns
true if connected to the robot hardware, false otherwise.

◆ activeMotionGenerator()

MotionGeneratorBase * activeMotionGenerator ( )
overridevirtual

Get currently active motion generator.

Implements StatusInterface.

◆ currentMotionFuture()

std::optional< std::shared_future< bool > > currentMotionFuture ( ) const

Get the future associated with the current motion execution.

Returns
the feature that can be used to track the completion status of the currently executing motion. If no motion is active return std::nullopt.

◆ publishState()

void publishState ( std::shared_ptr< const RobotState > state)
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.

Parameters
stateNew robot state to publish, must be non-null.

The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close