AuboCaps  0.4.1
waypoint_model.h
Go to the documentation of this file.
1 #ifndef AUBO_SCOPE_WAYPOINT_MODEL_H
2 #define AUBO_SCOPE_WAYPOINT_MODEL_H
3 
4 #include <vector>
6 
7 namespace arcs {
8 namespace aubo_scope {
9 ARCS_CLASS_FORWARD(WaypointModel);
10 
11 /**
12  * Provides methods that returns Waypoints from the current robot installation.
13  */
15 {
16 public:
19  ~WaypointModel();
20 
21  /**
22  * @return the geometric Waypoints of the current installation
23  */
24  /**
25  * @param clazz the sort of geometric Waypoint of interest, e.g.
26  * <code>WaypointPoint.class</code>,
27  * <code>WaypointLine.class</code>,
28  * <code>WaypointPlane.class</code>
29  * @param <T> The Waypoint type
30  * @return the collection of the corresponding Waypoints
31  */
32  std::vector<WaypointPtr> getWaypoints();
33 
34  WaypointPtr getByName(const std::string &name);
35 
36  /**
37  * Add a Waypoint to the current AuboScope installation. This makes it
38  * selectable by the end user. The Waypoint is not modifiable by the end
39  * user.
40  *
41  * @param idKey The key to identify this Waypoint by. The key is for this
42  * AuboCap only, i.e. it only has to be unique for this AuboCap and not
43  * "globally" for other AuboCaps.
44  * @param suggestedName Suggested name for the Waypoint. Valid names must
45  * match regex [a-zA-Z][a-zA-Z0-9_]{0,14} for a total of 15 characters. The
46  * final name can be retrieved from the returned Waypoint instance.
47  * @param pose The pose of the Waypoint with respect to the robot base
48  * @return The Waypoint created and registered in AuboScope.
49  * @throws WaypointAlreadyAddedException If a Waypoint has previously been
50  * added the same <code>idKey</code> identifier. Use {@link
51  * #getWaypoint(String)} to check if the Waypoint has already been added to
52  * the current installation. Use {@link #updateWaypoint(String, Pose)} to
53  * update the Waypoint.
54  * @throws IllegalWaypointNameException If the suggested name does not match
55  * required regex.
56  */
57  WaypointPtr addWaypoint(const std::string &suggestedName,
58  const std::vector<double> &pose);
59 
60  /**
61  * Remove a Waypoint added by this AuboCap from AuboScope. Program nodes
62  * using the Waypoint will be become undefined because the Waypoint is no
63  * longer resolvable.
64  *
65  * @param idKey The key used to add the Waypoint with.
66  * @throws WaypointNotFoundException If no Waypoint exists with the provided
67  * <code>idKey</code>.
68  */
69  void removeWaypoint(const std::string &name);
70 
71  /**
72  * Rename the waypoint in the model by the name
73  * @param name
74  * @param newName
75  */
76  void renameWaypoint(const std::string &name, const std::string &newName);
77 
78 private:
79  friend class DataSwitch;
80  WaypointModel();
81  void *d_{ nullptr };
82 };
83 
84 } // namespace aubo_scope
85 } // namespace arcs
86 
87 #endif // AUBO_SCOPE_WAYPOINT_MODEL_H
ARCS_CLASS_FORWARD(GripForceCapability)
Provides methods that returns Waypoints from the current robot installation.
#define ARCS_ABI_EXPORT
Definition: class_forward.h:16