-
Notifications
You must be signed in to change notification settings - Fork 0
/
graspEvalPlugin.h
69 lines (50 loc) · 1.71 KB
/
graspEvalPlugin.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef GRASPEVAL_H
#define GRASPEVAL_H
#include <map>
#include <QObject>
#include <QtGui>
//GraspIt! includes
#include <include/plugin.h>
#include "mongo/client/dbclient.h" // for the driver
//Qt headers
#include <QJsonObject.h>
class GraspPlanningState;
class GraspableBody;
class Hand;
//! Main class, combining a ROS node with a GraspIt! interface
/*! Note that this class inherits from GraspIt's Plugin class and implements the necessary functions to serve
as a GraspIt plugin. See include/plugin.h in the GraspIt code for the base class.
Provides a number of ROS services that directly operate on the GraspIt world, such as loading objects or
obstacles, simulating 3D scans of objects, etc.
In particular, note that this class uses the mainLoop() function to perform the ROS event management calls.
*/
class GraspEvalPlugin : public QObject, public Plugin
{
Q_OBJECT
public:
//! Inits ROS, but (for now) without passing any arguments
GraspEvalPlugin();
//! Deletes the node handle and the db manager
~GraspEvalPlugin();
//! Creates the node handles, advertises services, connects to the database
virtual int init(int argc, char **argv);
//! Simply calls ros::spinOnce() to process the ROS event loop
virtual int mainLoop();
bool liftHand(double moveDist, bool oneStep);
protected:
// mongo::BSONObj toMongoGrasp(GraspPlanningState *gps, QString energyType);
private:
GraspPlanningState *mHandObjectState;
GraspableBody *mObject;
Hand *mHand;
QJsonObject modelJson;
QString dbName;
mongo::DBClientBase *c;
bool hasAutoGrasped;
bool hasApproachedTilContact;
bool hasLifted;
int step_count;
bool worldLoaded;
void getGrasps(mongo::DBClientBase *c);
};
#endif // GRASPEVAL_H