AuboStudio SDK  0.6.3
gripper_contribution.h
浏览该文件的文档.
1#ifndef AUBO_SCOPE_GRIPPER_CONTRIBUTION_H
2#define AUBO_SCOPE_GRIPPER_CONTRIBUTION_H
3
8
11
12namespace arcs {
13namespace aubo_scope {
15
16/**
17 * \chinese
18 * 夹爪贡献
19 * 此接口定义了向 AuboScope 添加夹爪设备功能的 API。
20 *
21 * 实现此接口将创建程序节点贡献、安装贡献和工具栏贡献,向终端用户暴露夹爪功能。
22 * 请注意,工具栏贡献在 CB3 机器人上不受支持。
23 *
24 * 程序节点贡献允许终端用户编程夹取和释放操作。终端用户可用的配置选项基于夹爪
25 * 支持的属性和功能。至少,所有夹爪必须支持"默认"夹取和释放操作。所有其他功能
26 * 是可选的,可以在调用 {@link GripperContribution#configureGripper(GripperConfiguration,
27 * GripperAPIProvider)} 方法时注册。
28 *
29 * 安装节点贡献可在需要终端用户提供任何自定义输入来设置夹爪时使用(例如指定 IP 地址)。
30 * 相应的生成 UI 将在安装节点中可访问。此功能是可选的,因为此类配置属性是特定于
31 * 每个夹爪的。当调用
32 * {@link GripperContribution#configureInstallation(CustomUserInputConfiguration,
33 * SystemConfiguration, TCPConfiguration, GripperAPIProvider)} 方法时,提供创建
34 * 基于用户输入的自定义配置的访问权限。如果没有定义自定义用户输入、文本等,安装节点
35 * 将不会在 AuboScope 中可见。前言脚本代码(由
36 * {@link #generatePreambleScript(ScriptWriter)} 生成)仍将添加到机器人程序中。
37 *
38 * 工具栏贡献为终端用户提供快速访问,以使用"默认"夹爪操作参数执行夹取和释放操作。
39 * \endchinese
40 * \english
41 * GripperContribution
42 * This interface defines an API for adding functionality for gripping devices
43 * to AuboScope.
44 *
45 * Implementing this interface will create a program node contribution, an
46 * installation contribution and a toolbar contribution exposing gripper
47 * functionality to the end user. Note that the toolbar contribution is not
48 * supported on CB3 robots.
49 *
50 * The program node contribution allows the end user to program grip and release
51 * actions. The configuration options available to the end user are based on the
52 * properties and capabilities supported by the gripper. As a minimum, all
53 * grippers must support "default" grip and release actions. All other
54 * capabilities are optional to support and can be registered when the {@link
55 * GripperContribution#configureGripper(GripperConfiguration,
56 * GripperAPIProvider)} method is called.
57 *
58 * The installation node contribution can be used, if any custom input from the
59 * end user is required to setup the gripper, e.g. specifying an IP address. The
60 * corresponding generated UI will be accessible in the installation node. This
61 * functionality is optional, since such configuration properties are specific
62 * for each gripper. Access to create a custom configuration based on user
63 * inputs is provided when the method
64 * {@link
65 * GripperContribution#configureInstallation(CustomUserInputConfiguration,
66 * SystemConfiguration, TCPConfiguration, GripperAPIProvider)} is called. If no
67 * custom user inputs, texts, etc. are defined, the installation node will not
68 * be visible in AuboScope. Preamble script code (generated by {@link
69 * #generatePreambleScript(ScriptWriter)}) will still be added to the robot
70 * program.
71 *
72 * The toolbar contribution provides the end user quick access to perform grip
73 * and release actions using "default" gripper action parameters.
74 * \endenglish
75 */
77{
78public:
79 virtual ~GripperContribution() = default;
80
81 /**
82 * \chinese
83 * 此方法必须返回夹爪贡献的标题。标题显示在以下位置:
84 * <ul>
85 * <li>程序标签页的"结构"区域中此类夹爪程序节点的显示(可从此处插入夹爪程序节点)</li>
86 * <li>此夹爪贡献的程序节点画面</li>
87 * <li>程序树中此夹爪贡献程序节点的标题</li>
88 * <li>安装标签页左侧导航中此夹爪贡献的显示</li>
89 * <li>此夹爪贡献的安装节点画面</li>
90 * <li>此夹爪的工具栏贡献。注意:工具栏贡献在 CB3 机器人上不可用</li>
91 * </ul>
92 *
93 * <p>此方法的返回值不能为 <code>null</code>,也不能为空字符串。</p>
94 * 此方法在启动时调用一次。
95 *
96 * @param locale AuboScope 的当前语言环境,可用于支持多种语言的标题
97 * @return 此夹爪贡献的标题,不能为 <code>null</code> 也不能为空字符串
98 * \endchinese
99 * \english
100 * This method must return the title of the gripper contribution. The title
101 * is displayed in: <ul> <li>The Structure section of the Program Tab for
102 * this type of gripper program node (from which the Gripper program node
103 * can be inserted)</li> <li>The program node screen for this gripper
104 * contribution.</li> <li>The Program Tree as title for the program node for
105 * this gripper contribution</li> <li>The left-hand side navigation of the
106 * Installation Tab for this gripper contribution.</li> <li>The installation
107 * node screen for this gripper contribution.</li> <li>The toolbar
108 * contribution for this gripper. Note: The toolbar contribution is not
109 * available on CB3 robots.</li>
110 * </ul>
111 *
112 * <p>
113 * The return value of this method cannot be <code>null</code> nor an empty
114 * string.
115 * </p>
116 *
117 * This method is called once upon startup.
118 *
119 * @param locale The current locale of AuboScope. Can be used for supporting
120 * titles in several languages.
121 * @return The title of this gripper contribution, not <code>null</code> nor
122 * an empty string.
123 * \endenglish
124 */
125 virtual std::string getTitle(/*Locale locale*/) = 0;
126
127 /**
128 * \chinese
129 * <p>当调用此方法时,使用 configuration 参数注册或设置夹爪的可选属性和功能。</p>
130 * <p>此方法在夹爪配置阶段调用,在贡献注册后、新安装被加载或创建时调用。</p>
131 * <b>注意:</b>如果夹爪仅支持基本的"默认"夹取和释放操作,请将此方法的实现留空。
132 *
133 * @param gripperConfiguration 可用于注册或设置夹爪属性和功能的配置实例
134 * @param apiProvider 提供对 AuboScope 中可用于设置夹爪功能的相关功能和服务访问
135 * \endchinese
136 * \english
137 * <p>
138 * When this method is called, use the configuration parameter to register
139 * or setup optional properties and capabilities of the gripper.
140 * </p>
141 *
142 * <p>
143 * The method is called in the Gripper Configuration phase after this
144 * contribution has been registered when a new installation is loaded or
145 * created.
146 * </p>
147 *
148 * <b>Note:</b> If the gripper only supports basic "default" grip and
149 * release actions, leave the implementation of this method empty.
150 *
151 * @param gripperConfiguration A configuration instance that can be used for
152 * registering or setting up the properties and capabilities of the gripper.
153 * @param apiProvider Provides access to functionality and services
154 * available from within AuboScope which can be relevant for setting up the
155 * gripper capabilities (e.g. the {@link SystemAPI} interface with
156 * functionality for querying information about the robot).
157 * \endenglish
158 */
159 virtual void configureGripper(GripperConfigurationPtr gripperConfiguration,
160 GripperApiProviderPtr apiProvider) = 0;
161
162 /**
163 * \chinese
164 * <p>当调用此方法时,必须生成使用夹爪执行夹取动作的脚本代码。</p>
165 * <p>终端用户定义/配置的已注册可选夹爪功能参数将作为脚本生成的输入。</p>
166 * <p>此方法在以下场景中调用:</p>
167 * <ul>
168 * <li>当配置了夹取动作的夹爪程序节点应作为要执行的机器人程序的一部分生成脚本代码时</li>
169 * <li>当终端用户测试夹爪程序节点的夹取配置时</li>
170 * <li>当使用工具栏操作夹爪时</li>
171 * </ul>
172 *
173 * <b>注意:</b>
174 * <ul>
175 * <li>夹取物体后应用新的总负载<b>不是</b>夹爪的职责,因为这是 AuboScope 自动处理的。</li>
176 * <li>当终端用户指定了新的负载时,用户定义的负载值将在夹取动作的生成脚本代码完成
177 * 执行后立即由 AuboScope 应用。因此脚本代码不应在适当应用新负载值之前完成。
178 * </li>
179 * </ul>
180 *
181 * @param scriptWriter 使用此脚本编写器实例生成夹取脚本代码
182 * @param parameters 终端用户定义/配置的夹爪动作参数
183 * \endchinese
184 * \english
185 * <p>
186 * When this method is called, the script code for performing a grip action
187 * with the gripper must be generated.
188 * </p>
189 *
190 * ...
191 * @param scriptWriter Use this script writer instance to generate the
192 * script code for gripping
193 * @param parameters The parameters for the gripper action
194 * defined/configured by the end user
195 * \endenglish
196 */
198 ScriptWriterPtr scriptWriter, GripActionParametersPtr parameters) = 0;
199
200 /**
201 * \chinese
202 * <p>当调用此方法时,必须生成使用夹爪执行释放动作的脚本代码。</p>
203 * <p>终端用户定义/配置的已注册可选夹爪功能参数将作为脚本生成的输入。</p>
204 * <p>此方法在以下场景中调用:</p>
205 * <ul>
206 * <li>当配置了释放动作的夹爪程序节点应作为要执行的机器人程序的一部分生成脚本代码时</li>
207 * <li>当终端用户测试夹爪程序节点的释放配置时</li>
208 * <li>当使用工具栏操作夹爪时</li>
209 * </ul>
210 *
211 * <b>注意:</b>
212 * <ul>
213 * <li>释放物体后应用新的总负载<b>不是</b>夹爪的职责,因为这是 AuboScope 自动处理的。</li>
214 * <li>当终端用户指定了新的负载时,用户定义的负载值将在释放动作的生成脚本代码完成
215 * 执行后立即由 AuboScope 应用。因此脚本代码不应在适当应用新负载值之前完成。</li>
216 * </ul>
217 *
218 * @param scriptWriter 使用此脚本编写器实例生成释放夹爪的脚本代码
219 * @param parameters 终端用户定义/配置的夹爪动作参数
220 * \endchinese
221 * \english
222 * <p>
223 * When this method is called, the script code for performing a release
224 * action with the gripper must be generated.
225 * </p>
226 * ...
227 * @param scriptWriter Use this script writer instance to generate the
228 * script code for releasing the gripper
229 * @param parameters The parameters for the gripper action
230 * defined/configured by the end user
231 * \endenglish
232 */
234 ScriptWriterPtr scriptWriter,
235 ReleaseActionParametersPtr parameters) = 0;
236};
237} // namespace aubo_scope
238} // namespace arcs
239#endif
#define ARCS_CLASS_FORWARD(C)
Macro that forward declares a class and defines the respective smartpointers through ARCS_DECLARE_PTR...
\chinese 夹爪贡献 此接口定义了向 AuboScope 添加夹爪设备功能的 API。
virtual std::string getTitle()=0
\chinese 此方法必须返回夹爪贡献的标题。标题显示在以下位置:
virtual void generateReleaseActionScript(ScriptWriterPtr scriptWriter, ReleaseActionParametersPtr parameters)=0
\chinese
virtual void configureGripper(GripperConfigurationPtr gripperConfiguration, GripperApiProviderPtr apiProvider)=0
\chinese
virtual void generateGripActionScript(ScriptWriterPtr scriptWriter, GripActionParametersPtr parameters)=0
\chinese