8#include <viam/sdk/common/pose.hpp>
9#include <viam/sdk/common/utils.hpp>
10#include <viam/sdk/services/service.hpp>
11#include <viam/sdk/spatialmath/geometry.hpp>
21 enum class Mode : uint8_t {
42 double compass_heading;
45 return compass_heading == rhs.compass_heading && location == rhs.location;
68 std::string destination_waypoint_id;
69 std::vector<geo_point> geopoints;
71 bool operator==(
const Path& rhs)
const {
72 return destination_waypoint_id == rhs.destination_waypoint_id &&
73 geopoints == rhs.geopoints;
87 virtual void set_mode(
const Mode mode,
const ProtoStruct& extra) = 0;
97 virtual std::vector<Waypoint>
get_waypoints(
const ProtoStruct& extra) = 0;
111 virtual std::vector<geo_geometry>
get_obstacles(
const ProtoStruct& extra) = 0;
116 virtual std::vector<Path>
get_paths(
const ProtoStruct& extra) = 0;
125 virtual ProtoStruct
do_command(
const ProtoStruct& command) = 0;
137 inline LocationResponse get_location() {
138 return get_location({});
162 explicit Navigation(std::string
name);
Extends APIType to additionally define a resource's subtype (e.g., camera).
Definition resource_api.hpp:33
Definition navigation.hpp:16
virtual void set_mode(const Mode mode, const ProtoStruct &extra)=0
Set the current mode.
virtual Properties get_properties()=0
Get this nav service's properties.
MapType
Is the map navigating in GPS or a custom map.
Definition navigation.hpp:31
API api() const override
Returns the API associated with a particular resource.
virtual void remove_waypoint(const std::string id, const ProtoStruct &extra)=0
Remove a waypoint by ID.
virtual std::vector< Path > get_paths(const ProtoStruct &extra)=0
Get the paths this nav service knows about.
virtual void add_waypoint(const geo_point &location, const ProtoStruct &extra)=0
Add a waypoint.
virtual std::vector< Waypoint > get_waypoints(const ProtoStruct &extra)=0
Get the waypoints this nav service knows about.
virtual Mode get_mode(const ProtoStruct &extra)=0
Get the current mode.
virtual LocationResponse get_location(const ProtoStruct &extra)=0
Get the current location.
virtual std::vector< geo_geometry > get_obstacles(const ProtoStruct &extra)=0
Get the obstacles this nav service knows about.
Mode
Enum affecting this nav service's goal.
Definition navigation.hpp:21
virtual ProtoStruct do_command(const ProtoStruct &command)=0
Do an arbitrary command.
virtual std::string name() const
Return the resource's name.
Definition service.hpp:10
Definition resource_api.hpp:50
Location and direction.
Definition navigation.hpp:40
A user-provided destination and a set of geopoints to get there.
Definition navigation.hpp:67
A set of attributes for this nav service.
Definition navigation.hpp:52
A location with an id handle that can be used to uniquely identify and remove it.
Definition navigation.hpp:59
Definition geometry.hpp:80