AuboCaps  0.6.0
grip_action_parameters.h
Go to the documentation of this file.
1 #ifndef AUBO_SCOPE_GRIP_ACTION_PARAMETERS_H
2 #define AUBO_SCOPE_GRIP_ACTION_PARAMETERS_H
3 
5 
6 namespace arcs {
7 namespace aubo_scope {
8 ARCS_CLASS_FORWARD(GripActionParameters);
9 
10 /**
11  * <p>
12  * This interface represents parameters for a gripping action defined/configured
13  * by the end user.
14  * </p>
15  *
16  * These parameters are used when generating script code for a gripping action
17  * (see
18  * {@link GripperContribution#generateGripActionScript(ScriptWriter,
19  * GripActionParameters)}).
20  */
22 {
23 public:
24  virtual ~GripActionParameters() = default;
25 
26  /**
27  * <p>
28  * Get the selected force to be used the gripping action.
29  * </p>
30  *
31  * This is only valid, if the force capability has been registered
32  * (using the method
33  * {@link GripperCapabilities#registerGrippingForceCapability(double,
34  * double, double, Force.Unit)}).
35  *
36  * @return The force to use for the gripping action
37  * @throws UnsupportedOperationException if the gripper has not
38  * registered the force capability
39  */
40  virtual double getForce() = 0;
41 
42  /**
43  * <p>
44  * Get the selected width to be used for the gripping action.
45  * </p>
46  *
47  * This is only valid, if the width capability has been registered (using
48  * the method
49  * {@link GripperCapabilities#registerWidthCapability(double, double,
50  * double, double, Length.Unit)}).
51  *
52  * @return The width to use for the gripping action
53  * @throws UnsupportedOperationException if the gripper has not registered
54  * the width capability
55  */
56  virtual double getWidth() = 0;
57 
58  /**
59  * <p>
60  * Get the selected vacuum level to be used for the gripping action.
61  * </p>
62  *
63  * This is only valid, if the vacuum capability has been registered (using
64  * the method
65  * {@link GripperCapabilities#registerGrippingVacuumCapability(double,
66  * double, double, Pressure.Unit)}).
67  *
68  * @return The vacuum level to use for the gripping action
69  * @throws UnsupportedOperationException if the gripper has not registered
70  * the vacuum capability
71  */
72  virtual double getVacuum() = 0;
73 
74  /**
75  * <p>
76  * Get the selected speed to be used for the gripping action.
77  * </p>
78  *
79  * This is only valid, if the speed capability has been registered (using
80  * the method
81  * {@link GripperCapabilities#registerSpeedCapability(double, double,
82  * double, double, Speed.Unit)}).
83  *
84  * @return The speed to use for the gripping action
85  * @throws UnsupportedOperationException if the gripper has not registered
86  * the speed capability
87  */
88  virtual double getSpeed() = 0;
89 
90  /**
91  * <p>
92  * Use this method to determine whether the grip detection option in the
93  * Gripper program node is on or off.
94  * </p>
95  *
96  * <p>
97  * Note that this method will report that grip detection is off, when script
98  * code is to be generated due to the user testing a grip configuration of a
99  * gripper program or operating the gripper using the toolbar.
100  * </p>
101  *
102  * <p>
103  * This method should only be called, if the grip detected feedback
104  * capability has been registered (using
105  * {@link
106  * GripperFeedbackCapabilities#registerGripDetectedCapability(ScriptCodeGenerator)}).
107  * </p>
108  *
109  * <p>
110  * The purpose of this method is to ensure that the appropriate script code
111  * for performing a grip action is generated when the end user has specified
112  * a new payload value. The user-defined payload value will be applied by
113  * AuboScope immediately after the generated grip action script code has
114  * finished executing. Depending on the enablement state of grip detection,
115  * the generated script should have the following properties: <ul> <li>
116  * <i>Grip detection off:</i> The script code should not finish
117  * earlier than when it is appropriate to apply the new payload value (i.e.
118  * when the object has been gripped). This typically means that the script
119  * code should wait a time period corresponding to closing the gripper's
120  * "fingers" fully (if the gripper is vacuum operated then long enough to
121  * achieve some level of vacuum).
122  * </li>
123  * <li>
124  * <i>Grip detection on:</i> The payload will only be set if the
125  * grip detection was successful, i.e. it will be applied immediately after
126  * a grip was detected. This means that it is not necessary for the script
127  * code to wait (since the built-in detection timeout functionality will
128  * handle the waiting part).
129  * </li>
130  * </ul>
131  * </p>
132  *
133  * @return <code>true</code> if the end user has enabled grip detection, and
134  * <code>false</code> if grip detection is disabled.
135  * @throws UnsupportedOperationException if the gripper has not registered
136  * the grip detected feedback capability
137  */
138  virtual bool isGripDetectionEnabled() = 0;
139 };
140 } // namespace aubo_scope
141 } // namespace arcs
142 #endif
ARCS_CLASS_FORWARD(GripForceCapability)