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

#include <cp_grasping_objects.hpp>

Inheritance diagram for cl_move_group_interface::CpGraspingComponent:
Inheritance graph
Collaboration diagram for cl_move_group_interface::CpGraspingComponent:
Collaboration graph

Public Member Functions

bool getGraspingObject (std::string name, moveit_msgs::msg::CollisionObject &object)
 
void createGraspableBox (std::string frameid, float x, float y, float z, float xl, float yl, float zl)
 
- Public Member Functions inherited from smacc2::ISmaccComponent
 ISmaccComponent ()
 
virtual ~ISmaccComponent ()
 
virtual std::string getName () const
 

Public Attributes

std::vector< std::string > fingerTipNames
 
std::string gripperLink_ = "gripper_link"
 
std::optional< std::string > currentAttachedObjectName
 

Private Attributes

std::map< std::string, moveit_msgs::msg::CollisionObject > graspingObjects
 

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 30 of file cp_grasping_objects.hpp.

Member Function Documentation

◆ createGraspableBox()

void cl_move_group_interface::CpGraspingComponent::createGraspableBox ( std::string  frameid,
float  x,
float  y,
float  z,
float  xl,
float  yl,
float  zl 
)

Definition at line 39 of file cp_grasping_objects.cpp.

41{
42 RCLCPP_INFO_STREAM(
43 getLogger(), "[" << getName() << "] creating grasping object in planning scene: " << frameid);
44 moveit_msgs::msg::CollisionObject collision;
45 auto boxname = frameid;
46 ;
47 collision.id = boxname;
48 collision.header.frame_id = frameid;
49
50 collision.primitives.resize(1);
51 collision.primitives[0].type = collision.primitives[0].BOX;
52 collision.primitives[0].dimensions.resize(3);
53
54 collision.primitives[0].dimensions[0] = xl;
55 collision.primitives[0].dimensions[1] = yl;
56 collision.primitives[0].dimensions[2] = zl;
57
58 collision.primitive_poses.resize(1);
59 collision.primitive_poses[0].position.x = x;
60 collision.primitive_poses[0].position.y = y;
61 collision.primitive_poses[0].position.z = z;
62 collision.primitive_poses[0].orientation.w = 1.0;
63
64 graspingObjects[boxname] = collision;
65}
std::map< std::string, moveit_msgs::msg::CollisionObject > graspingObjects
virtual std::string getName() const
rclcpp::Logger getLogger() const
const std::string frameid

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

Here is the call graph for this function:

◆ getGraspingObject()

bool cl_move_group_interface::CpGraspingComponent::getGraspingObject ( std::string  name,
moveit_msgs::msg::CollisionObject &  object 
)

Definition at line 25 of file cp_grasping_objects.cpp.

27{
28 if (this->graspingObjects.count(name))
29 {
30 object = this->graspingObjects[name];
31 return true;
32 }
33 else
34 {
35 return false;
36 }
37}

References graspingObjects.

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

Here is the caller graph for this function:

Member Data Documentation

◆ currentAttachedObjectName

std::optional<std::string> cl_move_group_interface::CpGraspingComponent::currentAttachedObjectName

◆ fingerTipNames

std::vector<std::string> cl_move_group_interface::CpGraspingComponent::fingerTipNames

◆ graspingObjects

std::map<std::string, moveit_msgs::msg::CollisionObject> cl_move_group_interface::CpGraspingComponent::graspingObjects
private

Definition at line 33 of file cp_grasping_objects.hpp.

Referenced by createGraspableBox(), and getGraspingObject().

◆ gripperLink_

std::string cl_move_group_interface::CpGraspingComponent::gripperLink_ = "gripper_link"

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