|
SMACC2
|
Component for centralized trajectory execution. More...
#include <cp_trajectory_executor.hpp>


Public Member Functions | |
| CpTrajectoryExecutor ()=default | |
| virtual | ~CpTrajectoryExecutor ()=default |
| void | onInitialize () override |
| Initialize the component and get references to required components/clients. | |
| ExecutionResult | execute (const moveit_msgs::msg::RobotTrajectory &trajectory, const ExecutionOptions &options={}) |
| Execute a trajectory synchronously. | |
| ExecutionResult | executePlan (const moveit::planning_interface::MoveGroupInterface::Plan &plan, const ExecutionOptions &options={}) |
| Execute a motion plan synchronously. | |
| void | cancel () |
| Cancel ongoing execution. | |
| CpTrajectoryHistory * | getTrajectoryHistory () |
| Get the trajectory history component. | |
Public Member Functions inherited from smacc2::ISmaccComponent | |
| ISmaccComponent () | |
| virtual | ~ISmaccComponent () |
| virtual std::string | getName () const |
Private Member Functions | |
| void | applyExecutionOptions (moveit::planning_interface::MoveGroupInterface &moveGroup, const ExecutionOptions &options) |
| Apply execution options to MoveGroupInterface. | |
| void | recordToHistory (const moveit_msgs::msg::RobotTrajectory &trajectory, const moveit_msgs::msg::MoveItErrorCodes &errorCode, const std::string &name) |
| Record trajectory to history component. | |
Private Attributes | |
| ClMoveit2z * | moveit2zClient_ = nullptr |
| CpTrajectoryHistory * | trajectoryHistory_ = nullptr |
Additional Inherited Members | |
Protected Member Functions inherited from smacc2::ISmaccComponent | |
| template<typename TOrthogonal , typename TClient > | |
| void | onComponentInitialization () |
| template<typename EventType > | |
| void | postEvent (const EventType &ev) |
| template<typename EventType > | |
| void | postEvent () |
| template<typename TOrthogonal , typename TSourceObject > | |
| void | onOrthogonalAllocation () |
| template<typename TOrthogonal , typename TSourceObject > | |
| void | onStateOrthogonalAllocation () |
| template<typename TComponent > | |
| void | requiresComponent (TComponent *&requiredComponentStorage, bool throwExceptionIfNotExist) |
| template<typename TComponent > | |
| void | requiresComponent (std::string name, TComponent *&requiredComponentStorage, bool throwExceptionIfNotExist) |
| template<typename TComponent > | |
| void | requiresComponent (TComponent *&requiredComponentStorage, ComponentRequirement requirementType=ComponentRequirement::SOFT) |
| template<typename TComponent > | |
| void | requiresComponent (std::string name, TComponent *&requiredComponentStorage, ComponentRequirement requirementType=ComponentRequirement::SOFT) |
| template<typename TClient > | |
| void | requiresClient (TClient *&requiredClientStorage) |
| template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs> | |
| SmaccComponentType * | createSiblingComponent (TArgs... targs) |
| template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs> | |
| SmaccComponentType * | createSiblingNamedComponent (std::string name, TArgs... targs) |
| rclcpp::Node::SharedPtr | getNode () |
| rclcpp::Logger | getLogger () const |
| ISmaccStateMachine * | getStateMachine () |
Protected Attributes inherited from smacc2::ISmaccComponent | |
| ISmaccStateMachine * | stateMachine_ |
| ISmaccClient * | owner_ |
Component for centralized trajectory execution.
This component provides a unified interface for executing trajectories with:
Pattern: Executor with signals (like action clients)
Definition at line 76 of file cp_trajectory_executor.hpp.
|
default |
|
virtualdefault |
|
inlineprivate |
Apply execution options to MoveGroupInterface.
| moveGroup | Reference to MoveGroupInterface |
| options | Execution options to apply |
Definition at line 238 of file cp_trajectory_executor.hpp.
References cl_moveit2z::ExecutionOptions::maxAccelerationScaling, and cl_moveit2z::ExecutionOptions::maxVelocityScaling.
|
inline |
Cancel ongoing execution.
Note: This is a best-effort cancellation and may not immediately stop the robot
Definition at line 199 of file cp_trajectory_executor.hpp.
References smacc2::ISmaccComponent::getLogger(), cl_moveit2z::ClMoveit2z::moveGroupClientInterface, and moveit2zClient_.

|
inline |
Execute a trajectory synchronously.
| trajectory | The robot trajectory to execute |
| options | Execution configuration options |
Definition at line 114 of file cp_trajectory_executor.hpp.
Referenced by cl_moveit2z::CbMoveEndEffectorTrajectory::executeJointSpaceTrajectory().

|
inline |
Execute a motion plan synchronously.
Convenience method that accepts a MoveGroupInterface::Plan directly
| plan | The motion plan containing the trajectory |
| options | Execution configuration options |
Definition at line 187 of file cp_trajectory_executor.hpp.
Referenced by cl_moveit2z::CbMoveJoints::moveJoints(), and cl_moveit2z::CbMoveEndEffector::moveToAbsolutePose().

|
inline |
Get the trajectory history component.
Definition at line 226 of file cp_trajectory_executor.hpp.
References trajectoryHistory_.
|
inlineoverridevirtual |
Initialize the component and get references to required components/clients.
Reimplemented from smacc2::ISmaccComponent.
Definition at line 85 of file cp_trajectory_executor.hpp.
References smacc2::ISmaccComponent::getLogger(), moveit2zClient_, smacc2::ISmaccComponent::requiresClient(), smacc2::ISmaccComponent::requiresComponent(), and trajectoryHistory_.

|
inlineprivate |
Record trajectory to history component.
| trajectory | The executed trajectory |
| errorCode | Execution result error code |
| name | Name for this trajectory entry |
Definition at line 259 of file cp_trajectory_executor.hpp.
References smacc2::ISmaccComponent::getLogger(), cl_moveit2z::CpTrajectoryHistory::pushTrajectory(), and trajectoryHistory_.

|
private |
Definition at line 229 of file cp_trajectory_executor.hpp.
Referenced by cancel(), and onInitialize().
|
private |
Definition at line 230 of file cp_trajectory_executor.hpp.
Referenced by getTrajectoryHistory(), onInitialize(), and recordToHistory().