SMACC
Loading...
Searching...
No Matches
cb_attach_object.cpp
Go to the documentation of this file.
1/*****************************************************************************************************************
2 * ReelRobotix Inc. - Software License Agreement Copyright (c) 2018-2020
3 * Authors: Pablo Inigo Blasco, Brett Aldrich
4 *
5 ******************************************************************************************************************/
6
9
11{
12 CbAttachObject::CbAttachObject(std::string targetObjectName)
13 : targetObjectName_(targetObjectName)
14 {
15 }
16
18 {
19 }
20
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 }
47
49 {
50 }
51} // namespace cl_move_group_interface
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)