AuboCaps  0.6.0
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  * @param joint The joint of the Waypoint with respect to the robot base
49  * @param offset The tcp of the Waypoint with respect to the robot base
50  * @return The Waypoint created and registered in AuboScope.
51  * @throws WaypointAlreadyAddedException If a Waypoint has previously been
52  * added the same <code>idKey</code> identifier. Use {@link
53  * #getWaypoint(String)} to check if the Waypoint has already been added to
54  * the current installation. Use {@link #updateWaypoint(String, Pose)} to
55  * update the Waypoint.
56  * @throws IllegalWaypointNameException If the suggested name does not match
57  * required regex.
58  */
59  WaypointPtr addWaypoint(const std::string &suggestedName,
60  const std::vector<double> &pose);
61 
62  WaypointPtr addWaypoint(const std::string &suggestedName,
63  const std::vector<double> &pose,
64  const std::vector<double> &joint,
65  const std::vector<double> &offset);
66  /**
67  * Remove a Waypoint added by this AuboCap from AuboScope. Program nodes
68  * using the Waypoint will be become undefined because the Waypoint is no
69  * longer resolvable.
70  *
71  * @param idKey The key used to add the Waypoint with.
72  * @throws WaypointNotFoundException If no Waypoint exists with the provided
73  * <code>idKey</code>.
74  */
75  void removeWaypoint(const std::string &name);
76 
77  /**
78  * Rename the waypoint in the model by the name
79  * @param name
80  * @param newName
81  */
82  void renameWaypoint(const std::string &name, const std::string &newName);
83 
84 private:
85  friend class DataSwitch;
86  WaypointModel();
87  void *d_{ nullptr };
88 };
89 
90 } // namespace aubo_scope
91 } // namespace arcs
92 
93 #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