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

#include <cb_move_last_trajectory_initial_state.h>

Inheritance diagram for cl_move_group_interface::CbMoveLastTrajectoryInitialState:
Inheritance graph
Collaboration diagram for cl_move_group_interface::CbMoveLastTrajectoryInitialState:
Collaboration graph

Public Member Functions

 CbMoveLastTrajectoryInitialState ()
 
 CbMoveLastTrajectoryInitialState (int backIndex)
 
virtual ~CbMoveLastTrajectoryInitialState ()
 
virtual void onEntry () override
 
- Public Member Functions inherited from cl_move_group_interface::CbMoveJoints
 CbMoveJoints ()
 
 CbMoveJoints (const std::map< std::string, double > &jointValueTarget)
 
virtual void onEntry () override
 
virtual void onExit () override
 
- Public Member Functions inherited from smacc::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 smacc::ISmaccClientBehavior
 ISmaccClientBehavior ()
 
virtual ~ISmaccClientBehavior ()
 
ISmaccStateMachinegetStateMachine ()
 
std::string getName () const
 
template<typename SmaccClientType >
void requiresClient (SmaccClientType *&storage)
 
template<typename SmaccComponentType >
void requiresComponent (SmaccComponentType *&storage)
 
ros::NodeHandle getNode ()
 

Private Attributes

int backIndex_ = -1
 

Additional Inherited Members

- Public Attributes inherited from cl_move_group_interface::CbMoveJoints
boost::optional< double > scalingFactor_
 
std::map< std::string, double > jointValueTarget_
 
boost::optional< std::string > group_
 
- Protected Member Functions inherited from cl_move_group_interface::CbMoveJoints
void moveJoints (moveit::planning_interface::MoveGroupInterface &moveGroupInterface)
 
- Protected Member Functions inherited from smacc::SmaccAsyncClientBehavior
virtual void executeOnEntry () override
 
virtual void executeOnExit () override
 
void postSuccessEvent ()
 
void postFailureEvent ()
 
virtual void dispose () override
 
- Protected Member Functions inherited from smacc::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 executeOnEntry ()
 
virtual void executeOnExit ()
 
virtual void dispose ()
 
- Protected Attributes inherited from cl_move_group_interface::CbMoveJoints
ClMoveGroupmovegroupClient_
 

Detailed Description

Definition at line 13 of file cb_move_last_trajectory_initial_state.h.

Constructor & Destructor Documentation

◆ CbMoveLastTrajectoryInitialState() [1/2]

cl_move_group_interface::CbMoveLastTrajectoryInitialState::CbMoveLastTrajectoryInitialState ( )

Definition at line 12 of file cb_move_last_trajectory_initial_state.cpp.

13 {
14 }

◆ CbMoveLastTrajectoryInitialState() [2/2]

cl_move_group_interface::CbMoveLastTrajectoryInitialState::CbMoveLastTrajectoryInitialState ( int  backIndex)

◆ ~CbMoveLastTrajectoryInitialState()

cl_move_group_interface::CbMoveLastTrajectoryInitialState::~CbMoveLastTrajectoryInitialState ( )
virtual

Definition at line 21 of file cb_move_last_trajectory_initial_state.cpp.

22 {
23 }

Member Function Documentation

◆ onEntry()

void cl_move_group_interface::CbMoveLastTrajectoryInitialState::onEntry ( )
overridevirtual

Reimplemented from cl_move_group_interface::CbMoveJoints.

Definition at line 25 of file cb_move_last_trajectory_initial_state.cpp.

26 {
27 CpTrajectoryHistory *trajectoryHistory;
28 this->requiresComponent(trajectoryHistory);
29
30 if (trajectoryHistory != nullptr)
31 {
32 moveit_msgs::RobotTrajectory trajectory;
33
34 bool trajectoryFound = trajectoryHistory->getLastTrajectory(backIndex_, trajectory);
35
36 if (trajectoryFound)
37 {
38 trajectory_msgs::JointTrajectoryPoint &initialPoint = trajectory.joint_trajectory.points.front();
39
40 std::stringstream ss;
41 for (int i = 0; i < trajectory.joint_trajectory.joint_names.size(); i++)
42 {
43 auto &name = trajectory.joint_trajectory.joint_names[i];
44
45 jointValueTarget_[name] = initialPoint.positions[i];
46 ss << name << ": " << jointValueTarget_[name] << std::endl;
47 }
48 ROS_INFO_STREAM("[" << this->getName() << "]" << std::endl
49 << ss.str());
50
51 ROS_INFO_STREAM("[" << this->getName() << "] move joint onEntry");
53 ROS_INFO_STREAM("[" << this->getName() << "] move joint onEntry finished");
54 }
55 }
56
57 //call base OnEntry
58 }
std::map< std::string, double > jointValueTarget_
void requiresComponent(SmaccComponentType *&storage)

References backIndex_, cl_move_group_interface::CpTrajectoryHistory::getLastTrajectory(), smacc::ISmaccClientBehavior::getName(), cl_move_group_interface::CbMoveJoints::jointValueTarget_, cl_move_group_interface::CbMoveJoints::onEntry(), and smacc::ISmaccClientBehavior::requiresComponent().

Here is the call graph for this function:

Member Data Documentation

◆ backIndex_

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

Definition at line 25 of file cb_move_last_trajectory_initial_state.h.

Referenced by onEntry().


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