PDF
AuboStudio SDK  0.6.3
program_node_factory.h
Go to the documentation of this file.
1#ifndef AUBO_SCOPE_PROGRAM_NODE_FACTORY_H
2#define AUBO_SCOPE_PROGRAM_NODE_FACTORY_H
3
48
49namespace arcs {
50namespace aubo_scope {
53
54/**
55 * \chinese
56 * 程序节点工厂
57 * 此接口提供创建不同类型程序节点的方法。
58 *
59 * 可以创建内置程序节点(由 AUBO Robots 提供)和 AuboCap 程序节点。大多数方法
60 * 将创建与终端用户手动添加节点时具有相同默认配置的节点。
61 *
62 * 请注意,此默认配置可能会因 AuboScope 版本而异。
63 * \endchinese
64 * \english
65 * ProgramNodeFactory
66 * This interfaces supplies methods to create different types of program nodes.
67 *
68 * Both built-in program nodes (provided by AUBO Robots) and AuboCap
69 * program nodes can be created. Most methods will create a node with the same
70 * default configuration as if the end user added the node manually.
71 *
72 * Note that this default configuration may change between AuboScope versions.
73 * \endenglish
74 */
76{
77public:
81
82 /**
83 * \chinese
84 * 创建一个 AuboCap 程序节点,该节点是 ProgramNodeContribution 的实例。
85 *
86 * @param typeid_service 创建程序节点贡献的服务
87 * @return 由 ProgramNodeService 创建的表示 ProgramNodeContribution 的
88 * ProgramNode。如果提供 ProgramNodeService 的 AuboCap 未安装,则返回
89 * <code>null</code>。
90 * @throws IllegalArgumentException 如果参数 ProgramNodeService 为
91 * <code>null</code> 或未实现 ProgramNodeService
92 * \endchinese
93 * \english
94 * This method creates a AuboCap program node which is an instance of a
95 * {@link contribution/ProgramNodeContribution}.
96 *
97 * @param typeid_service is the service creating the program node
98 * contribution
99 * @return the {@link ProgramNode} which represents the {@link
100 * contribution/ProgramNodeContribution} created by {@link
101 * ProgramNodeService}. Returns <code>null</code> if AuboCap providing
102 * ProgramNodeService is not installed.
103 * @throws IllegalArgumentException if the argument ProgramNodeService
104 * is <code>null</code> or ProgramNodeService does not implement {@link
105 * ProgramNodeService}.
106 * \endenglish
107 */
108 ProgramNodePtr createUserProgramNode(const char *typeid_service);
109
110 /**
111 * \chinese
112 * 创建一个默认的移动节点,其下包含一个默认路点节点。
113 * @return 新的移动节点
114 * \endchinese
115 * \english
116 * Creates a default Move node with one default Waypoint node under it.
117 * @return new Move Node.
118 * \endenglish
119 */
120 MoveNodePtr createMoveNode();
121
122 /**
123 * \chinese
124 * <p>创建一个默认的移动节点,其下不包含路点节点(例如用于插入命名路点)。</p>
125 * 注意:移动节点必须至少包含一个路点节点才有效。
126 * @return 新的移动节点
127 * \endchinese
128 * \english
129 * <p>Creates a default Move node without a Waypoint node under it (e.g. to
130 * be used for inserting named waypoints).</p> Note that at least one
131 * Waypoint node must be under it for a Move node to be valid.
132 * @return new Move Node.
133 * \endenglish
134 */
136
137 /**
138 * \chinese
139 * 创建具有默认路点名称的路点节点(对应终端用户手动添加新节点时生成的名称)。
140 * @return 新的路点节点
141 * \endchinese
142 * \english
143 * Creates a Waypoint node with default waypoint name (corresponds to the
144 * name generated if the end user added a new node manually).
145 * @return new Waypoint Node.
146 * \endenglish
147 */
148 WaypointNodePtr createWaypointNode();
149
150 /**
151 * \chinese
152 * <p>创建具有建议名称的路点节点。</p>
153 * <p>如果建议名称已被注册,最终名称可能会不同。路点名称在插入程序树时注册。</p>
154 * 变量路点将使用变量名称而不是建议名称。
155 *
156 * @param suggested_name 建议的路点名称。有效名称必须匹配正则表达式
157 * [a-zA-Z][a-zA-Z0-9_]{0,14}
158 * @return 新的路点节点
159 * @throws IllegalWaypointNameException 如果名称为非法格式
160 * \endchinese
161 * \english
162 * <p>Creates a Waypoint node with a suggested name.</p>
163 * <p>The final name can be different if the suggested name is already
164 * registered. The waypoint name is registered when it is inserted into the
165 * program tree.</p>
166 * Variable waypoints will use the name of the variable instead of the
167 * suggested name.
168 *
169 * @param suggested_name the suggested name of the waypoint. Valid names
170 * must match regex [a-zA-Z][a-zA-Z0-9_]{0,14} for a total of 15 characters.
171 * @return new Waypoint Node.
172 * @throws IllegalWaypointNameException In case of an illegal name.
173 * \endenglish
174 */
175 WaypointNodePtr createWaypointNode(const std::string &suggested_name);
176
177 /**
178 * \chinese
179 * 创建一个未指定 until 类型的 Until 节点。
180 * @return 新的 Until 节点
181 * \endchinese
182 * \english
183 * Creates an Until Node with no until type specified.
184 * @return a new Until Node.
185 * \endenglish
186 */
187 UntilNodePtr createUntilNode();
188 DirectionNodePtr createDirectionNode();
189 WaitNodePtr createWaitNode();
190 SetNodePtr createSetNode();
191 SetPayloadNodePtr createSetPayloadNode();
192 PopupNodePtr createPopupNode();
193 HaltNodePtr createHaltNode();
194 CommentNodePtr createCommentNode();
195 FolderNodePtr createFolderNode();
196 LoopNodePtr createLoopNode();
197 AssignmentNodePtr createAssignmentNode();
198 IfNodePtr createIfNode();
199 ElseIfNodePtr createElseIfNode();
200 ElseNodePtr createElseNode();
201 CircleMoveNodePtr createCircleMoveNode();
202 PalletNodePtr createPalletNode();
203 SeekNodePtr createSeekNode();
204 ForceNodePtr createForceNode();
205 ForceOptionNodePtr createForceOptionNode();
206 ToolForceZeroingNodePtr createToolForceZeroingNode();
207 ForceAlignNodePtr createForceAlignNode();
208 ForceCompliantGraspNodePtr createForceCompliantGraspNode();
209 ForceEntranceSearchNodePtr createForceEntranceSearchNode();
210 ForceContactNodePtr createForceContactNode();
211 AssemblyNodePtr createAssemblyNode();
212 ScrewdrivingNodePtr createScrewdrivingNode();
213 ScriptNodePtr createScriptNode();
214 TimerNodePtr createTimerNode();
215 SwitchNodePtr createSwitchNode();
216 CaseNodePtr createCaseNode();
217 DefaultCaseNodePtr createDefaultCaseNode();
218 BreakNodePtr createBreakNode();
219 SubProgNodePtr createSubProgNode();
220 CallNodePtr createCallNode();
221 OfflineTrackNodePtr createOfflineTrackNode();
222 RecordTrackNodePtr createRecordTrackNode();
223 ThreadNodePtr createThreadNode();
224 ProgramHomeNodePtr createProgramHomeNode();
225 VisualLocalizationProgramNodePtr createVisualLocalizationProgramNode();
226 ConveyorTrackingNodePtr createConveyorTrackingNode();
227
228 /**
229 * \chinese
230 * <p>创建新的夹爪程序节点。此节点类型可用于编程所选夹爪设备的夹取和释放动作。</p>
231 * 程序节点将使用与终端用户在 AuboScope 中手动添加节点时相同的默认配置创建,
232 * 即未选择夹爪动作的未定义配置。
233 *
234 * @param gripperDevice 要为其创建夹爪节点的夹爪设备,不能为
235 * <code>null</code>。 创建的夹爪节点将为此设备编程夹爪动作。
236 * @return 新的夹爪程序节点(可使用 TreeNode 接口插入到程序树中)
237 * @throws UnresolvedDeviceException 当指定的 gripperDevice 设备不可解析时
238 * \endchinese
239 * \english
240 * <p>
241 * This method creates a new Gripper program node. This node type can be
242 * used for programming grip and release actions with a selected gripper
243 * device.
244 * </p>
245 * The program node will be created with the same default configuration as
246 * if the end user added the node manually in AuboScope, i.e. an undefined
247 * configuration where the gripper action is unselected.
248 *
249 * @param gripperDevice the gripper device to create a Gripper node for, not
250 * <code>null</code>. The created Gripper node will program gripper actions
251 * for this device.
252 * @return a new Gripper program node (which can be inserted into the
253 * program tree using the {@link TreeNode} interface).
254 * @throws UnresolvedDeviceException when the specified
255 * <code>gripperDevice</code> device is unresolved. See
256 * {@link GripperDevice#isResolvable()}.
257 * \endenglish
258 */
259 GripperNodePtr createGripperNode(GripperDevicePtr gripperDevice);
260
261private:
262 friend class DataSwitch;
264 void *d_{ nullptr };
265};
266
267} // namespace aubo_scope
268} // namespace arcs
269
270#endif
#define ARCS_ABI_EXPORT
#define ARCS_CLASS_FORWARD(C)
Macro that forward declares a class and defines the respective smartpointers through ARCS_DECLARE_PTR...
ProgramNodeFactory This interfaces supplies methods to create different types of program nodes.
ForceContactNodePtr createForceContactNode()
WaypointNodePtr createWaypointNode(const std::string &suggested_name)
SetPayloadNodePtr createSetPayloadNode()
VisualLocalizationProgramNodePtr createVisualLocalizationProgramNode()
MoveNodePtr createMoveNode()
Creates a default Move node with one default Waypoint node under it.
ConveyorTrackingNodePtr createConveyorTrackingNode()
RecordTrackNodePtr createRecordTrackNode()
OfflineTrackNodePtr createOfflineTrackNode()
ProgramNodePtr createUserProgramNode(const char *typeid_service)
This method creates a AuboCap program node which is an instance of a contribution/ProgramNodeContribu...
ForceEntranceSearchNodePtr createForceEntranceSearchNode()
CircleMoveNodePtr createCircleMoveNode()
ToolForceZeroingNodePtr createToolForceZeroingNode()
ProgramHomeNodePtr createProgramHomeNode()
ForceAlignNodePtr createForceAlignNode()
GripperNodePtr createGripperNode(GripperDevicePtr gripperDevice)
ProgramNodeFactory(ProgramNodeFactory &&f)
ForceOptionNodePtr createForceOptionNode()
ForceCompliantGraspNodePtr createForceCompliantGraspNode()
DefaultCaseNodePtr createDefaultCaseNode()
ProgramNodeFactory(ProgramNodeFactory &f)
DirectionNodePtr createDirectionNode()
ScrewdrivingNodePtr createScrewdrivingNode()
WaypointNodePtr createWaypointNode()
Creates a Waypoint node with default waypoint name (corresponds to the name generated if the end user...
AssignmentNodePtr createAssignmentNode()
UntilNodePtr createUntilNode()
Creates an Until Node with no until type specified.
ProgramNodeService Defines an API required for adding a new type of program node to AuboScope.