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