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

#include <cb_attach_object.h>

Inheritance diagram for cl_move_group_interface::CbAttachObject:
Inheritance graph
Collaboration diagram for cl_move_group_interface::CbAttachObject:
Collaboration graph

Public Member Functions

 CbAttachObject (std::string targetObjectName)
 
 CbAttachObject ()
 
virtual void onEntry () override
 
virtual void onExit () override
 
virtual void onEntry () override
 
virtual void onExit () override
 
- 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 ()
 

Public Attributes

std::string targetObjectName_
 

Additional Inherited Members

- 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 ()
 

Detailed Description

Definition at line 14 of file cb_attach_object.h.

Constructor & Destructor Documentation

◆ CbAttachObject() [1/2]

cl_move_group_interface::CbAttachObject::CbAttachObject ( std::string  targetObjectName)

Definition at line 12 of file cb_attach_object.cpp.

13 : targetObjectName_(targetObjectName)
14 {
15 }

◆ CbAttachObject() [2/2]

cl_move_group_interface::CbAttachObject::CbAttachObject ( )

Definition at line 17 of file cb_attach_object.cpp.

18 {
19 }

Member Function Documentation

◆ onEntry()

void cl_move_group_interface::CbAttachObject::onEntry ( )
overridevirtual

Reimplemented from smacc::SmaccClientBehavior.

Definition at line 21 of file cb_attach_object.cpp.

22 {
24 this->requiresClient(moveGroup);
25
27 this->requiresComponent(graspingComponent);
28
29 // auto cubepos = cubeinfo->pose_->toPoseStampedMsg();
30
31 moveit_msgs::CollisionObject targetCollisionObject;
32
33 bool found = graspingComponent->getGraspingObject(targetObjectName_, targetCollisionObject);
34
35 if (found)
36 {
37 targetCollisionObject.operation = moveit_msgs::CollisionObject::ADD;
38 targetCollisionObject.header.stamp = ros::Time::now();
39
40 moveGroup->planningSceneInterface.applyCollisionObject(targetCollisionObject);
41 // collisionObjects.push_back(cubeCollision);
42
44 moveGroup->moveGroupClientInterface.attachObject(targetObjectName_, "gripper_link", graspingComponent->fingerTipNames);
45 }
46 }
moveit::planning_interface::PlanningSceneInterface planningSceneInterface
Definition: cl_movegroup.h:76
moveit::planning_interface::MoveGroupInterface moveGroupClientInterface
Definition: cl_movegroup.h:74
bool getGraspingObject(std::string name, moveit_msgs::CollisionObject &object)
boost::optional< std::string > currentAttachedObjectName
void requiresComponent(SmaccComponentType *&storage)
void requiresClient(SmaccClientType *&storage)

References cl_move_group_interface::GraspingComponent::currentAttachedObjectName, cl_move_group_interface::GraspingComponent::fingerTipNames, cl_move_group_interface::GraspingComponent::getGraspingObject(), cl_move_group_interface::ClMoveGroup::moveGroupClientInterface, cl_move_group_interface::ClMoveGroup::planningSceneInterface, smacc::ISmaccClientBehavior::requiresClient(), smacc::ISmaccClientBehavior::requiresComponent(), and targetObjectName_.

Here is the call graph for this function:

◆ onExit()

void cl_move_group_interface::CbAttachObject::onExit ( )
overridevirtual

Reimplemented from smacc::SmaccClientBehavior.

Definition at line 48 of file cb_attach_object.cpp.

49 {
50 }

Member Data Documentation

◆ targetObjectName_

std::string cl_move_group_interface::CbAttachObject::targetObjectName_

Definition at line 25 of file cb_attach_object.h.

Referenced by onEntry().


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