Viam C++ SDK current
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
viam::sdk::Navigation Class Referenceabstract
+ Inheritance diagram for viam::sdk::Navigation:

Classes

struct  LocationResponse
 Location and direction. More...
 
struct  Path
 A user-provided destination and a set of geopoints to get there. More...
 
struct  Properties
 A set of attributes for this nav service. More...
 
struct  Waypoint
 A location with an id handle that can be used to uniquely identify and remove it. More...
 

Public Types

enum class  Mode : uint8_t { k_unspecified , k_manual , k_waypoint , k_explore }
 Enum affecting this nav service's goal.
 
enum class  MapType : uint8_t { k_unspecified , k_none , k_gps }
 Is the map navigating in GPS or a custom map.
 

Public Member Functions

API api () const override
 Returns the API associated with a particular resource.
 
virtual Mode get_mode (const ProtoStruct &extra)=0
 Get the current mode.
 
virtual void set_mode (const Mode mode, const ProtoStruct &extra)=0
 Set the current mode.
 
virtual LocationResponse get_location (const ProtoStruct &extra)=0
 Get the current location.
 
virtual std::vector< Waypointget_waypoints (const ProtoStruct &extra)=0
 Get the waypoints this nav service knows about.
 
virtual void add_waypoint (const geo_point &location, const ProtoStruct &extra)=0
 Add a waypoint.
 
virtual void remove_waypoint (const std::string id, const ProtoStruct &extra)=0
 Remove a waypoint by ID.
 
virtual std::vector< geo_geometryget_obstacles (const ProtoStruct &extra)=0
 Get the obstacles this nav service knows about.
 
virtual std::vector< Pathget_paths (const ProtoStruct &extra)=0
 Get the paths this nav service knows about.
 
virtual Properties get_properties ()=0
 Get this nav service's properties.
 
virtual ProtoStruct do_command (const ProtoStruct &command)=0
 Do an arbitrary command.
 
Mode get_mode ()
 
void set_mode (const Mode mode)
 
LocationResponse get_location ()
 
std::vector< Waypointget_waypoints ()
 
void add_waypoint (const geo_point &location)
 
void remove_waypoint (const std::string id)
 
std::vector< geo_geometryget_obstacles ()
 
std::vector< Pathget_paths ()
 
- Public Member Functions inherited from viam::sdk::Service
Name get_resource_name () const override
 Returns the Name for a particular resource.
 
- Public Member Functions inherited from viam::sdk::Resource
 Resource (std::string name)
 
virtual std::string name () const
 Return the resource's name.
 

Protected Member Functions

 Navigation (std::string name)
 
- Protected Member Functions inherited from viam::sdk::Service
 Service (std::string name)
 
- Protected Member Functions inherited from viam::sdk::Resource
Name get_resource_name (const std::string &type) const
 

Member Function Documentation

◆ add_waypoint()

virtual void viam::sdk::Navigation::add_waypoint ( const geo_point & location,
const ProtoStruct & extra )
pure virtual

Add a waypoint.

Parameters
locationCoordinate of the new waypoint.

Implemented in viam::sdk::impl::NavigationClient.

◆ api()

API viam::sdk::Navigation::api ( ) const
overridevirtual

Returns the API associated with a particular resource.

Implements viam::sdk::Resource.

◆ do_command()

virtual ProtoStruct viam::sdk::Navigation::do_command ( const ProtoStruct & command)
pure virtual

Do an arbitrary command.

Parameters
commandFreeform fields that are service-specific.
Returns
Freeform result of the command.

Implemented in viam::sdk::impl::NavigationClient.

◆ get_location()

virtual LocationResponse viam::sdk::Navigation::get_location ( const ProtoStruct & extra)
pure virtual

Get the current location.

Parameters
extraAny additional arguments to the method.
Returns
Current location.

Implemented in viam::sdk::impl::NavigationClient.

◆ get_mode()

virtual Mode viam::sdk::Navigation::get_mode ( const ProtoStruct & extra)
pure virtual

Get the current mode.

Parameters
extraAny additional arguments to the method.
Returns
Current mode.

Implemented in viam::sdk::impl::NavigationClient.

◆ get_obstacles()

virtual std::vector< geo_geometry > viam::sdk::Navigation::get_obstacles ( const ProtoStruct & extra)
pure virtual

Get the obstacles this nav service knows about.

Parameters
extraAny additional arguments to the method.
Returns
List of shapes.

Implemented in viam::sdk::impl::NavigationClient.

◆ get_paths()

virtual std::vector< Path > viam::sdk::Navigation::get_paths ( const ProtoStruct & extra)
pure virtual

Get the paths this nav service knows about.

Parameters
extraAny additional arguments to the method.
Returns
List of paths.

Implemented in viam::sdk::impl::NavigationClient.

◆ get_properties()

virtual Properties viam::sdk::Navigation::get_properties ( )
pure virtual

Get this nav service's properties.

Returns
Properties.

Implemented in viam::sdk::impl::NavigationClient.

◆ get_waypoints()

virtual std::vector< Waypoint > viam::sdk::Navigation::get_waypoints ( const ProtoStruct & extra)
pure virtual

Get the waypoints this nav service knows about.

Parameters
extraAny additional arguments to the method.
Returns
List of waypoints.

Implemented in viam::sdk::impl::NavigationClient.

◆ remove_waypoint()

virtual void viam::sdk::Navigation::remove_waypoint ( const std::string id,
const ProtoStruct & extra )
pure virtual

Remove a waypoint by ID.

Parameters
idThe string ID of the waypoint to remove.
extraAny additional arguments to the method.

Implemented in viam::sdk::impl::NavigationClient.

◆ set_mode()

virtual void viam::sdk::Navigation::set_mode ( const Mode mode,
const ProtoStruct & extra )
pure virtual

Set the current mode.

Parameters
modeDesired mode.
extraAny additional arguments to the method.

Implemented in viam::sdk::impl::NavigationClient.


The documentation for this class was generated from the following file: