SMACC2
Public Member Functions | Private Attributes | List of all members
cl_move_group_interface::CbUndoLastTrajectory Class Reference

#include <cb_undo_last_trajectory.hpp>

Inheritance diagram for cl_move_group_interface::CbUndoLastTrajectory:
Inheritance graph
Collaboration diagram for cl_move_group_interface::CbUndoLastTrajectory:
Collaboration graph

Public Member Functions

 CbUndoLastTrajectory ()
 
 CbUndoLastTrajectory (int backIndex)
 
virtual ~CbUndoLastTrajectory ()
 
virtual void onEntry () override
 
virtual void generateTrajectory ()
 
- Public Member Functions inherited from cl_move_group_interface::CbMoveEndEffectorTrajectory
 CbMoveEndEffectorTrajectory (std::optional< std::string > tipLink=std::nullopt)
 
 CbMoveEndEffectorTrajectory (const std::vector< geometry_msgs::msg::PoseStamped > &endEffectorTrajectory, std::optional< std::string > tipLink=std::nullopt)
 
template<typename TOrthogonal , typename TSourceObject >
void onOrthogonalAllocation ()
 
virtual void onEntry () override
 
virtual void onExit () override
 
virtual void update () override
 
- Public Member Functions inherited from smacc2::SmaccAsyncClientBehavior
template<typename TOrthogonal , typename TSourceObject >
void onOrthogonalAllocation ()
 
virtual ~SmaccAsyncClientBehavior ()
 
template<typename TCallback , typename T >
boost::signals2::connection onSuccess (TCallback callback, T *object)
 
template<typename TCallback , typename T >
boost::signals2::connection onFinished (TCallback callback, T *object)
 
template<typename TCallback , typename T >
boost::signals2::connection onFailure (TCallback callback, T *object)
 
- Public Member Functions inherited from smacc2::ISmaccClientBehavior
 ISmaccClientBehavior ()
 
virtual ~ISmaccClientBehavior ()
 
ISmaccStateMachinegetStateMachine ()
 
std::string getName () const
 
template<typename SmaccClientType >
void requiresClient (SmaccClientType *&storage)
 
template<typename SmaccComponentType >
void requiresComponent (SmaccComponentType *&storage)
 
- Public Member Functions inherited from smacc2::ISmaccUpdatable
 ISmaccUpdatable ()
 
 ISmaccUpdatable (rclcpp::Duration duration)
 
void executeUpdate (rclcpp::Node::SharedPtr node)
 
void setUpdatePeriod (rclcpp::Duration duration)
 

Private Attributes

int backIndex_ = -1
 
moveit_msgs::msg::RobotTrajectory trajectory
 
moveit_msgs::msg::RobotTrajectory reversed
 

Additional Inherited Members

- Public Attributes inherited from cl_move_group_interface::CbMoveEndEffectorTrajectory
std::optional< std::string > group_
 
std::optional< std::string > tipLink_
 
std::optional< boolallowInitialTrajectoryStateJointDiscontinuity_
 
- Protected Member Functions inherited from cl_move_group_interface::CbMoveEndEffectorTrajectory
ComputeJointTrajectoryErrorCode computeJointSpaceTrajectory (moveit_msgs::msg::RobotTrajectory &computedJointTrajectory)
 
void executeJointSpaceTrajectory (const moveit_msgs::msg::RobotTrajectory &computedJointTrajectory)
 
virtual void generateTrajectory ()=0
 
virtual void createMarkers ()
 
void getCurrentEndEffectorPose (std::string globalFrame, tf2::Stamped< tf2::Transform > &currentEndEffectorTransform)
 
- Protected Member Functions inherited from smacc2::SmaccAsyncClientBehavior
void postSuccessEvent ()
 
void postFailureEvent ()
 
virtual void dispose () override
 
bool isShutdownRequested ()
 
- Protected Member Functions inherited from smacc2::ISmaccClientBehavior
virtual void runtimeConfigure ()
 
virtual void onEntry ()
 
virtual void onExit ()
 
template<typename EventType >
void postEvent (const EventType &ev)
 
template<typename EventType >
void postEvent ()
 
ISmaccStategetCurrentState ()
 
virtual void dispose ()
 
virtual rclcpp::Node::SharedPtr getNode ()
 
virtual rclcpp::Logger getLogger ()
 
virtual void update ()=0
 
- Protected Attributes inherited from cl_move_group_interface::CbMoveEndEffectorTrajectory
std::vector< geometry_msgs::msg::PoseStamped > endEffectorTrajectory_
 
ClMoveGroupmovegroupClient_ = nullptr
 
visualization_msgs::msg::MarkerArray beahiorMarkers_
 

Detailed Description

Definition at line 28 of file cb_undo_last_trajectory.hpp.

Constructor & Destructor Documentation

◆ CbUndoLastTrajectory() [1/2]

cl_move_group_interface::CbUndoLastTrajectory::CbUndoLastTrajectory ( )

Definition at line 26 of file cb_undo_last_trajectory.cpp.

26{}

◆ CbUndoLastTrajectory() [2/2]

cl_move_group_interface::CbUndoLastTrajectory::CbUndoLastTrajectory ( int  backIndex)

◆ ~CbUndoLastTrajectory()

cl_move_group_interface::CbUndoLastTrajectory::~CbUndoLastTrajectory ( )
virtual

Definition at line 30 of file cb_undo_last_trajectory.cpp.

30{}

Member Function Documentation

◆ generateTrajectory()

void cl_move_group_interface::CbUndoLastTrajectory::generateTrajectory ( )
virtual

◆ onEntry()

void cl_move_group_interface::CbUndoLastTrajectory::onEntry ( )
overridevirtual

Reimplemented from cl_move_group_interface::CbMoveEndEffectorTrajectory.

Definition at line 34 of file cb_undo_last_trajectory.cpp.

35{
36 CpTrajectoryHistory * trajectoryHistory;
37 this->requiresComponent(trajectoryHistory);
39
40 if (trajectoryHistory->getLastTrajectory(backIndex_, trajectory))
41 {
42 RCLCPP_WARN_STREAM(
43 getLogger(), "[" << getName() << "] reversing last trajectory [" << backIndex_ << "]");
44
45 auto initialTime = trajectory.joint_trajectory.points.back().time_from_start;
46
48
49 std::reverse(reversed.joint_trajectory.points.begin(), reversed.joint_trajectory.points.end());
50
51 for (auto & jp : reversed.joint_trajectory.points)
52 {
53 jp.time_from_start = rclcpp::Duration(initialTime) - rclcpp::Duration(jp.time_from_start);
54 }
55
57 }
58 else
59 {
60 RCLCPP_WARN_STREAM(
61 getLogger(), "[" << getName() << "] could not undo last trajectory, trajectory not found.");
62 }
63}
void executeJointSpaceTrajectory(const moveit_msgs::msg::RobotTrajectory &computedJointTrajectory)
void requiresClient(SmaccClientType *&storage)
void requiresComponent(SmaccComponentType *&storage)

References backIndex_, cl_move_group_interface::CbMoveEndEffectorTrajectory::executeJointSpaceTrajectory(), cl_move_group_interface::CpTrajectoryHistory::getLastTrajectory(), smacc2::ISmaccClientBehavior::getLogger(), smacc2::ISmaccClientBehavior::getName(), cl_move_group_interface::CbMoveEndEffectorTrajectory::movegroupClient_, smacc2::ISmaccClientBehavior::requiresClient(), smacc2::ISmaccClientBehavior::requiresComponent(), reversed, and trajectory.

Here is the call graph for this function:

Member Data Documentation

◆ backIndex_

int cl_move_group_interface::CbUndoLastTrajectory::backIndex_ = -1
private

Definition at line 42 of file cb_undo_last_trajectory.hpp.

Referenced by onEntry().

◆ reversed

moveit_msgs::msg::RobotTrajectory cl_move_group_interface::CbUndoLastTrajectory::reversed
private

Definition at line 45 of file cb_undo_last_trajectory.hpp.

Referenced by onEntry().

◆ trajectory

moveit_msgs::msg::RobotTrajectory cl_move_group_interface::CbUndoLastTrajectory::trajectory
private

Definition at line 44 of file cb_undo_last_trajectory.hpp.

Referenced by onEntry().


The documentation for this class was generated from the following files: