AuboStudio SDK  0.6.3
user_interaction.h
浏览该文件的文档.
1#ifndef AUBO_SCOPE_USER_INTERACTION_H
2#define AUBO_SCOPE_USER_INTERACTION_H
3
4#include <vector>
5#include <functional>
6
10
11namespace arcs {
12namespace aubo_scope {
13
16
17using RobotPositionCallback = std::function<void(
18 bool accepted, const std::vector<double> &pose,
19 const std::vector<double> &q, const std::vector<double> &offset)>;
20using RobotMovementCallback = std::function<void(bool accepted, int error)>;
21
22/**
23 * @ingroup UserInterfaceApi
24 * This interface provides functionality for requesting input or actions from
25 * end users
26 */
28{
29public:
33
34 /**
35 * @ingroup UserInteraction
36 * <p>
37 * Request the end user to use the robot to define a robot position.
38 * Override the
39 * {@link RobotPositionCallback2#onOk(PositionParameters)} method to execute
40 * code once the end user is done. Optionally override the {@link
41 * RobotPositionCallback2#onCancel()} method to execute code if the end user
42 * cancels the operation.
43 * </p>
44 *
45 * <p>
46 * This method is asynchronous, i.e. the method will return immediately.
47 * Only when the end user is done, either
48 * {@link RobotPositionCallback2#onOk(PositionParameters)} or {@link
49 * RobotPositionCallback2#onCancel()} will be called.
50 * </p>
51 *
52 * NOTE: This functionality should not be used in a toolbar contribution
53 * (see {@link ToolbarService}).
54 *
55 * @param callback the instance callbacks will be made to.
56 */
58
59 /**
60 * @ingroup UserInteraction
61 * 指定 tcpOfffset
62 *
63 * @param tcpOffset
64 * @param callback
65 */
66 void getUserDefinedRobotPosition(const std::vector<double> &tcpOffset,
67 RobotPositionCallback callback);
68
69 /**
70 * @ingroup UserInteraction
71 * 指定 tcpOfffset
72 *
73 * @param tcpOffset
74 * @param callback
75 */
76 void getUserDefinedRobotPosition(const std::string &tcpOffset,
77 RobotPositionCallback callback);
78
79 /**
80 * @ingroup UserInteraction
81 * 指定 tcpOfffset
82 *
83 * @param tcpOffset
84 * @param callback
85 */
86 void getUserDefinedRobotPosition(const TCPPtr tcpOffset,
87 RobotPositionCallback callback);
88
89 /**
90 * @ingroup UserInteraction
91 * <p>
92 * This method provides a factory for creating keyboard inputs which are
93 * used to configure a virtual keyboard/keypad and to request it to be
94 * displayed for a Swing GUI component.
95 * </p>
96 *
97 * NOTE: This functionality is only relevant for AuboCap nodes with a
98 * Swing-based user interface (see {@link ProgramNodeService},
99 * {@link InstallationNodeService} and {@link ToolbarService}).
100 *
101 * @return factory providing access to keyboard inputs.
102 */
103 KeyboardManagerPtr getKeyboardManager();
104
105 /**
106 * @ingroup UserInteraction
107 * <p>
108 * Transition to the move tab widget to allow/request the end user to move
109 * the robot (either automatically or manually) to a desired target position
110 * specified by joint positions.
111 * </p>
112 *
113 * <p>
114 * The Automove function will move the robot to the target joint positions
115 * linearly in joint space.
116 * </p>
117 *
118 * <b>NOTE:</b> This method does not take the currently active TCP offset
119 * into account, i.e. the Automove function will have the specified joint
120 * positions as target.
121 *
122 * @param q The target joint positions to move to.
123 * @param callback The instance which callbacks will be made to.
124 * @throws IllegalStateException If the plugin screen is not active
125 * (visible).
126 */
127 int requestUserToMoveJoint(const std::vector<double> &q,
128 RobotMovementCallback callback);
129 /**
130 * @ingroup UserInteraction
131 * @brief requestUserToMoveJoint
132 * @param q
133 * @param callback
134 * @return
135 */
136 int requestUserToMoveJoint(const std::string &q,
137 RobotMovementCallback callback);
138 /**
139 * @ingroup UserInteraction
140 * @param pose The target pose the robot TCP will move to.
141 * @param q The reference joint Angle.
142 * @param callback The instance which callbacks will be made to.
143 * @throws IllegalStateException If the plugin screen is not active
144 * (visible).
145 */
146 int requestUserToMoveJoint(const std::vector<double> &pose,
147 const std::vector<double> &q,
148 RobotMovementCallback callback);
149
150 /**
151 * @ingroup UserInteraction
152 * <p>
153 * Transition to the move tab widget to allow/request the end user to move
154 * the robot (either automatically or manually) to a desired target position
155 * specified by a pose.
156 * </p>
157 *
158 * <p>
159 * The Automove function will move the robot TCP to the target position
160 * linearly in Cartesian space. If this it not possible, the robot will move
161 * to the target linearly in joint space.
162 * </p>
163 *
164 * The current joint positions of the robot will be used as starting point
165 * for inverse kinematics to calculate a target joint vector corresponding
166 * to desired pose, taking the currently active TCP offset into account.
167 *
168 * @param pose The target pose the robot TCP will move to.
169 * @param callback The instance which callbacks will be made to.
170 * @throws IllegalStateException If the plugin screen is not active
171 * (visible).
172 */
173 QT_DEPRECATED int requestUserToMoveLine(const std::vector<double> &pose,
174 RobotMovementCallback callback);
175
176 /**
177 * @ingroup UserInteraction
178 * <p>
179 * Transition to the move tab widget to allow/request the end user to move
180 * the robot (either automatically or manually) to a desired target position
181 * specified by a pose.
182 * </p>
183 *
184 * <p>
185 * The Automove function will move the robot TCP to the target position
186 * linearly in Cartesian space. If this it not possible, the robot will move
187 * to the target linearly in joint space.
188 * </p>
189 *
190 * The current joint positions of the robot will be used as starting point
191 * for inverse kinematics to calculate a target joint vector corresponding
192 * to desired pose, taking the currently active TCP offset into account.
193 *
194 * @param pose The target pose the robot TCP will move to.
195 * @param tcpOffset
196 * @param callback The instance which callbacks will be made to.
197 * @throws IllegalStateException If the plugin screen is not active
198 * (visible).
199 */
200 int requestUserToMoveLine(const std::vector<double> &pose,
201 const std::vector<double> &tcpOffset,
202 RobotMovementCallback callback);
203
204 /**
205 * @ingroup UserInteraction
206 * 获取机器人缩略图
207 */
208 QPixmap *getRobotThumb(const std::vector<double> &q,
209 const std::vector<double> &pose);
210
211 /// 界面按钮是否启用操作记录
212 /**
213 * @ingroup UserInteraction
214 * @brief setOperationLogDisplayName
215 * @param pbn
216 * @param name
217 */
218 void setOperationLogDisplayName(QWidget *pbn, const std::string &name);
219
220 /**
221 * @ingroup UserInteraction
222 * @return This method provides robot model drawing objects.
223 */
224 RenderInterfacePtr getRenderInterface();
225
226private:
227 friend class DataSwitch;
229 void *d_{ nullptr };
230};
231
232} // namespace aubo_scope
233} // namespace arcs
234
235#endif // USERINTERACTION_H
#define ARCS_ABI_EXPORT
#define ARCS_CLASS_FORWARD(C)
Macro that forward declares a class and defines the respective smartpointers through ARCS_DECLARE_PTR...
This interface represents a TCP in AuboScope.
定义 tcp.h:18
This interface provides functionality for requesting input or actions from end users
int requestUserToMoveJoint(const std::vector< double > &q, RobotMovementCallback callback)
int requestUserToMoveJoint(const std::vector< double > &pose, const std::vector< double > &q, RobotMovementCallback callback)
int requestUserToMoveJoint(const std::string &q, RobotMovementCallback callback)
requestUserToMoveJoint
void getUserDefinedRobotPosition(const std::vector< double > &tcpOffset, RobotPositionCallback callback)
指定 tcpOfffset
RenderInterfacePtr getRenderInterface()
void getUserDefinedRobotPosition(RobotPositionCallback callback)
UserInteraction(UserInteraction &&f)
void setOperationLogDisplayName(QWidget *pbn, const std::string &name)
界面按钮是否启用操作记录
QPixmap * getRobotThumb(const std::vector< double > &q, const std::vector< double > &pose)
获取机器人缩略图
QT_DEPRECATED int requestUserToMoveLine(const std::vector< double > &pose, RobotMovementCallback callback)
UserInteraction(UserInteraction &f)
void getUserDefinedRobotPosition(const TCPPtr tcpOffset, RobotPositionCallback callback)
指定 tcpOfffset
void getUserDefinedRobotPosition(const std::string &tcpOffset, RobotPositionCallback callback)
指定 tcpOfffset
int requestUserToMoveLine(const std::vector< double > &pose, const std::vector< double > &tcpOffset, RobotMovementCallback callback)
KeyboardManagerPtr getKeyboardManager()
std::function< void( bool accepted, const std::vector< double > &pose, const std::vector< double > &q, const std::vector< double > &offset)> RobotPositionCallback
std::function< void(bool accepted, int error)> RobotMovementCallback