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 * <p>
13 * This interface provides functionality for adding, updating and removing
14 * features in AuboScope.
15 * </p>
16 *
17 * <b>Note:</b> This interface must only be used in an installation
18 * contribution/
19 */
21{
22public:
26
27 /**
28 * Add a feature to the current AuboScope installation. This makes it
29 * selectable by the end user. The feature is not modifiable by the end
30 * user.
31 *
32 * @param idKey The key to identify this feature by. The key is for this
33 * AuboCap only, i.e. it only has to be unique for this AuboCap and not
34 * "globally" for other aubo_studio plugins.
35 * @param suggestedName Suggested name for the feature. Valid names must
36 * match regex [a-zA-Z][a-zA-Z0-9_]{0,14} for a total of 15 characters. The
37 * final name can be retrieved from the returned feature instance.
38 * @param pose The pose of the feature with respect to the robot base
39 * @return The feature created and registered in AuboScope.
40 * @throws FeatureAlreadyAddedException If a feature has previously been
41 * added the same <code>idKey</code> identifier. Use {@link
42 * #getFeature(String)} to check if the feature has already been added to
43 * the current installation. Use {@link #updateFeature(String, Pose)} to
44 * update the feature.
45 * @throws IllegalFeatureNameException If the suggested name does not match
46 * required regex.
47 */
48 FeaturePtr addFeature(const std::string &idKey,
49 const std::string &suggestedName,
50 const std::vector<double> &pose);
51 /**
52 * Returns the feature previously added by this AuboCap using the same
53 * <code>idKey</code> identifier. Use this to verify if the feature is
54 * present in the current installation.
55 *
56 * @param idKey The key to identify this feature by.
57 * @return The feature previously added by this AuboCap.
58 * Returns <code>null</code> if no feature exists in the current
59 * installation.
60 */
61 FeaturePtr getFeature(const std::string &idKey);
62
63 /**
64 * Update the pose of an existing feature added by this AuboCap.
65 *
66 * @param idKey The key to identify the feature. A feature must have been
67 * added prior to this method call using the same key.
68 * @param newPose The new pose to set for the feature.
69 * @throws FeatureNotFoundException If no feature exists with the provided
70 * <code>idKey</code>.
71 */
72 void updateFeature(const std::string &idKey,
73 const std::vector<double> &newPose);
74 void renameFeature(const std::string &idKey, const std::string &newName);
75
76 /**
77 * Remove a feature added by this AuboCap from AuboScope. Program nodes
78 * using the feature will be become undefined because the feature is no
79 * longer resolvable.
80 *
81 * @param idKey The key used to add the feature with.
82 * @throws FeatureNotFoundException If no feature exists with the provided
83 * <code>idKey</code>.
84 */
85 void removeFeature(const std::string &idKey);
86
87private:
88 friend class DataSwitch;
90 void *d_{ nullptr };
91};
92
93} // namespace aubo_scope
94} // namespace arcs
95
96#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...
FeaturePtr addFeature(const std::string &idKey, const std::string &suggestedName, const std::vector< double > &pose)
Add a feature to the current AuboScope installation.
void removeFeature(const std::string &idKey)
Remove a feature added by this AuboCap from AuboScope.
FeatureContributionModel(FeatureContributionModel &&f)
void renameFeature(const std::string &idKey, const std::string &newName)
void updateFeature(const std::string &idKey, const std::vector< double > &newPose)
Update the pose of an existing feature added by this AuboCap.
FeatureContributionModel(FeatureContributionModel &f)
FeaturePtr getFeature(const std::string &idKey)
Returns the feature previously added by this AuboCap using the same idKey identifier.