AuboStudio SDK  0.6.3
feature_contribution_model.h
浏览该文件的文档.
1#ifndef AUBO_SCOPE_FEATURE_CONTRIBUTION_MODEL_H
2#define AUBO_SCOPE_FEATURE_CONTRIBUTION_MODEL_H
3
5
6namespace arcs {
7namespace aubo_scope {
8
10
11/**
12 * @ingroup InstallationApi
13 * \chinese
14 * 特征贡献模型
15 * 此接口提供在 AuboScope 中添加、更新和删除特征的功能。
16 *
17 * <b>注意:</b>此接口只能在安装贡献中使用。
18 * \endchinese
19 * \english
20 * FeatureContributionModel
21 * This interface provides functionality for adding, updating and removing
22 * features in AuboScope.
23 *
24 * <b>Note:</b> This interface must only be used in an installation
25 * contribution.
26 * \endenglish
27 */
29{
30public:
34
35 /**
36 * \chinese
37 * 向当前AuboScope安装中添加一个特征。添加后终端用户可选择该特征,但不可修改。
38 *
39 * @param idKey 用于标识此特征的键。该键仅对此AuboCap有效。
40 * @param suggestedName 建议的特征名称。有效名称必须匹配正则表达式
41 * [a-zA-Z][a-zA-Z0-9_]{0,14}。
42 * @param pose 特征相对于机器人基座的位姿。
43 * @return 在AuboScope中创建并注册的特征。
44 * @throws FeatureAlreadyAddedException 如果之前已用相同idKey添加过特征。
45 * @throws IllegalFeatureNameException 如果建议的名称不匹配所需正则表达式。
46 * \endchinese
47 * \english
48 * Add a feature to the current AuboScope installation. This makes it
49 * selectable by the end user. The feature is not modifiable by the end
50 * user.
51 *
52 * @param idKey The key to identify this feature by.
53 * @param suggestedName Suggested name for the feature.
54 * @param pose The pose of the feature with respect to the robot base.
55 * @return The feature created and registered in AuboScope.
56 * @throws FeatureAlreadyAddedException If a feature has previously been
57 * added the same <code>idKey</code> identifier.
58 * @throws IllegalFeatureNameException If the suggested name does not match
59 * required regex.
60 * \endenglish
61 */
62 FeaturePtr addFeature(const std::string &idKey,
63 const std::string &suggestedName,
64 const std::vector<double> &pose);
65 /**
66 * \chinese
67 * 返回此前由此AuboCap使用相同idKey标识符添加的特征。用于验证特征是否存在。
68 * @param idKey 用于标识特征的键。
69 * @return 此前添加的特征,如果不存在则返回<code>null</code>。
70 * \endchinese
71 * \english
72 * Returns the feature previously added by this AuboCap using the same
73 * <code>idKey</code> identifier. Use this to verify if the feature is
74 * present in the current installation.
75 *
76 * @param idKey The key to identify this feature by.
77 * @return The feature previously added by this AuboCap.
78 * Returns <code>null</code> if no feature exists in the current
79 * installation.
80 * \endenglish
81 */
82 FeaturePtr getFeature(const std::string &idKey);
83
84 /**
85 * \chinese
86 * 更新此AuboCap已添加特征的位姿。
87 * @param idKey 用于标识特征的键。
88 * @param newPose 特征的新位姿。
89 * @throws FeatureNotFoundException 如果不存在对应idKey的特征。
90 * \endchinese
91 * \english
92 * Update the pose of an existing feature added by this AuboCap.
93 *
94 * @param idKey The key to identify the feature.
95 * @param newPose The new pose to set for the feature.
96 * @throws FeatureNotFoundException If no feature exists with the provided
97 * <code>idKey</code>.
98 * \endenglish
99 */
100 void updateFeature(const std::string &idKey,
101 const std::vector<double> &newPose);
102 void renameFeature(const std::string &idKey, const std::string &newName);
103
104 /**
105 * \chinese
106 * 从此AuboCap中移除已添加的特征。使用该特征的程序节点将变为未定义。
107 * @param idKey 添加特征时使用的键。
108 * @throws FeatureNotFoundException 如果不存在对应idKey的特征。
109 * \endchinese
110 * \english
111 * Remove a feature added by this AuboCap from AuboScope. Program nodes
112 * using the feature will be become undefined because the feature is no
113 * longer resolvable.
114 *
115 * @param idKey The key used to add the feature with.
116 * @throws FeatureNotFoundException If no feature exists with the provided
117 * <code>idKey</code>.
118 * \endenglish
119 */
120 void removeFeature(const std::string &idKey);
121
122private:
123 friend class DataSwitch;
125 void *d_{ nullptr };
126};
127
128} // namespace aubo_scope
129} // namespace arcs
130
131#endif // AUBO_SCOPE_FEATURE_CONTRIBUTION_MODEL_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...
\chinese 特征贡献模型 此接口提供在 AuboScope 中添加、更新和删除特征的功能。
FeaturePtr addFeature(const std::string &idKey, const std::string &suggestedName, const std::vector< double > &pose)
\chinese 向当前AuboScope安装中添加一个特征。添加后终端用户可选择该特征,但不可修改。
void removeFeature(const std::string &idKey)
\chinese 从此AuboCap中移除已添加的特征。使用该特征的程序节点将变为未定义。
FeatureContributionModel(FeatureContributionModel &&f)
void renameFeature(const std::string &idKey, const std::string &newName)
void updateFeature(const std::string &idKey, const std::vector< double > &newPose)
\chinese 更新此AuboCap已添加特征的位姿。
FeatureContributionModel(FeatureContributionModel &f)
FeaturePtr getFeature(const std::string &idKey)
\chinese 返回此前由此AuboCap使用相同idKey标识符添加的特征。用于验证特征是否存在。