SMACC2
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
cl_move_group_interface::CpTrajectoryHistory Class Reference

#include <cp_trajectory_history.hpp>

Inheritance diagram for cl_move_group_interface::CpTrajectoryHistory:
Inheritance graph
Collaboration diagram for cl_move_group_interface::CpTrajectoryHistory:
Collaboration graph

Public Member Functions

bool getLastTrajectory (int backIndex, moveit_msgs::msg::RobotTrajectory &trajectory)
 
bool getLastTrajectory (moveit_msgs::msg::RobotTrajectory &trajectory)
 
void pushTrajectory (std::string name, const moveit_msgs::msg::RobotTrajectory &trajectory, moveit_msgs::msg::MoveItErrorCodes result)
 
- Public Member Functions inherited from smacc2::ISmaccComponent
 ISmaccComponent ()
 
virtual ~ISmaccComponent ()
 
virtual std::string getName () const
 

Private Attributes

std::vector< TrajectoryHistoryEntrytrajectoryHistory_
 

Additional Inherited Members

- Protected Member Functions inherited from smacc2::ISmaccComponent
virtual void onInitialize ()
 
template<typename EventType >
void postEvent (const EventType &ev)
 
template<typename EventType >
void postEvent ()
 
template<typename TOrthogonal , typename TSourceObject >
void onOrthogonalAllocation ()
 
template<typename TComponent >
void requiresComponent (TComponent *&requiredComponentStorage, bool throwExceptionIfNotExist=false)
 
template<typename TComponent >
void requiresComponent (std::string name, TComponent *&requiredComponentStorage, bool throwExceptionIfNotExist=false)
 
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
 
ISmaccStateMachinegetStateMachine ()
 
- Protected Attributes inherited from smacc2::ISmaccComponent
ISmaccStateMachinestateMachine_
 
ISmaccClientowner_
 

Detailed Description

Definition at line 37 of file cp_trajectory_history.hpp.

Member Function Documentation

◆ getLastTrajectory() [1/2]

bool cl_move_group_interface::CpTrajectoryHistory::getLastTrajectory ( int  backIndex,
moveit_msgs::msg::RobotTrajectory &  trajectory 
)

Definition at line 25 of file cp_trajectory_history.cpp.

27{
28 if (trajectoryHistory_.size() == 0)
29 {
30 RCLCPP_WARN_STREAM(
31 getLogger(), "[" << getName() << "] requested index: " << backIndex
32 << ", history size: " << trajectoryHistory_.size());
33 return false;
34 }
35
36 if (backIndex < 0)
37
38 {
39 backIndex = 0;
40 }
41 else if ((size_t)backIndex >= this->trajectoryHistory_.size())
42 {
43 RCLCPP_WARN_STREAM(
44 getLogger(), "[" << getName() << "] requested index: " << backIndex
45 << ", history size: " << trajectoryHistory_.size());
46 return false;
47 }
48
49 trajectory = this->trajectoryHistory_[this->trajectoryHistory_.size() - 1 - backIndex].trajectory;
50 return true;
51}
std::vector< TrajectoryHistoryEntry > trajectoryHistory_
virtual std::string getName() const
rclcpp::Logger getLogger() const

References smacc2::ISmaccComponent::getLogger(), smacc2::ISmaccComponent::getName(), and trajectoryHistory_.

Referenced by getLastTrajectory(), cl_move_group_interface::CbExecuteLastTrajectory::onEntry(), cl_move_group_interface::CbMoveLastTrajectoryInitialState::onEntry(), and cl_move_group_interface::CbUndoLastTrajectory::onEntry().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLastTrajectory() [2/2]

bool cl_move_group_interface::CpTrajectoryHistory::getLastTrajectory ( moveit_msgs::msg::RobotTrajectory &  trajectory)

Definition at line 53 of file cp_trajectory_history.cpp.

54{
55 return getLastTrajectory(-1, trajectory);
56}
bool getLastTrajectory(int backIndex, moveit_msgs::msg::RobotTrajectory &trajectory)

References getLastTrajectory().

Here is the call graph for this function:

◆ pushTrajectory()

void cl_move_group_interface::CpTrajectoryHistory::pushTrajectory ( std::string  name,
const moveit_msgs::msg::RobotTrajectory &  trajectory,
moveit_msgs::msg::MoveItErrorCodes  result 
)

Definition at line 58 of file cp_trajectory_history.cpp.

61{
62 RCLCPP_INFO_STREAM(
63 getLogger(), "[" << getName() << "] adding a new trajectory to the history ( "
64 << trajectory.joint_trajectory.points.size() << " poses)");
65
66 TrajectoryHistoryEntry entry;
67 this->trajectoryHistory_.push_back(entry);
68
69 auto & last = this->trajectoryHistory_.back();
70 last.trajectory = trajectory;
71 last.result = result;
72 last.name = name;
73}

References smacc2::ISmaccComponent::getLogger(), smacc2::ISmaccComponent::getName(), and trajectoryHistory_.

Referenced by cl_move_group_interface::CbMoveEndEffectorTrajectory::onEntry().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ trajectoryHistory_

std::vector<TrajectoryHistoryEntry> cl_move_group_interface::CpTrajectoryHistory::trajectoryHistory_
private

Definition at line 49 of file cp_trajectory_history.hpp.

Referenced by getLastTrajectory(), and pushTrajectory().


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