GazeboGraspGripper.h
Go to the documentation of this file.
00001 //
00002 // Created by tom on 19/09/16.
00003 //
00004 
00005 #ifndef ROBOTICAN_COMMON_GAZEBOGRASPGRIPPER_H_H
00006 #define ROBOTICAN_COMMON_GAZEBOGRASPGRIPPER_H_H
00007 
00008 #include <boost/bind.hpp>
00009 #include <gazebo/gazebo.hh>
00010 #include <gazebo/physics/physics.hh>
00011 #include <gazebo/common/common.hh>
00012 #include <gazebo/transport/TransportTypes.hh>
00013 #include <stdio.h>
00014 
00015 namespace gazebo {
00016 
00023     class GazeboGraspGripper {
00024     public:
00025         GazeboGraspGripper();
00026         GazeboGraspGripper(const GazeboGraspGripper& o);
00027         virtual ~GazeboGraspGripper();
00028 
00034         bool Init(physics::ModelPtr& _model,
00035                   const std::string& _gripperName,
00036                   const std::string& palmLinkName,
00037                   const std::vector<std::string>& fingerLinkNames,
00038                   bool _disableCollisionsOnAttach,
00039                   std::map<std::string, physics::CollisionPtr>& _collisions);
00040 
00041         const std::string& getGripperName() const;
00042 
00046         bool hasLink(const std::string& linkName) const;
00047 
00051         bool hasCollisionLink(const std::string& linkName) const;
00052 
00053         bool isObjectAttached() const;
00054 
00055         const std::string& attachedObject() const;
00056 
00060         bool HandleAttach(const std::string& objName);
00061         void HandleDetach(const std::string& objName);
00062 
00063     private:
00064 
00065         physics::ModelPtr model;
00066 
00067         // name of the gripper
00068         std::string gripperName;
00069 
00070         // names of the gripper links
00071         std::vector<std::string> linkNames;
00072         // names and Collision objects of the collision links in Gazebo (scoped names)
00073         // Not necessarily equal names and size to linkNames.
00074         std::map<std::string, physics::CollisionPtr> collisionElems;
00075 
00076         physics::JointPtr fixedJoint;
00077 
00078         physics::LinkPtr palmLink;
00079 
00080         // when an object is attached, collisions with it may be disabled, in case the
00081         // robot still keeps wobbling.
00082         bool disableCollisionsOnAttach;
00083 
00084         // flag holding whether an object is attached. Object name in \e attachedObjName
00085         bool attached;
00086         // name of the object currently attached.
00087         std::string attachedObjName;
00088     };
00089 
00090 }
00091 
00092 #endif //ROBOTICAN_COMMON_GAZEBOGRASPGRIPPER_H_H


robotican_common
Author(s):
autogenerated on Fri Oct 27 2017 03:02:37