Viam C++ SDK current
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
viam::sdk::impl::BaseClient Class Reference

gRPC client implementation of a Base component. More...

#include <base_client.hpp>

+ Inheritance diagram for viam::sdk::impl::BaseClient:

Public Types

using interface_type = Base
 

Public Member Functions

 BaseClient (std::string name, std::shared_ptr< grpc::Channel > channel)
 
void move_straight (int64_t distance_mm, double mm_per_sec, const AttributeMap &extra) override
 Move a robot's base in a straight line by a given distance. This method blocks until completed or cancelled.
 
void spin (double angle_deg, double degs_per_sec, const AttributeMap &extra) override
 Spins a robot's base by an given angle, expressed in degrees. This method blocks until completed or cancelled.
 
void set_power (const Vector3 &linear, const Vector3 &angular, const AttributeMap &extra) override
 Sets the linear and angular power of a base -1 -> 1 in terms of power for each direction.
 
void set_velocity (const Vector3 &linear, const Vector3 &angular, const AttributeMap &extra) override
 Set the linear and angular velocity of a base.
 
void stop (const AttributeMap &extra) override
 Stops a resource from running.
 
std::vector< GeometryConfigget_geometries (const AttributeMap &extra) override
 Returns GeometryConfigs associated with the calling base.
 
properties get_properties (const AttributeMap &extra) override
 Returns physical properties of the base (width, turning radius, wheel circumference)
 
bool is_moving () override
 Reports if the base is in motion.
 
AttributeMap do_command (const AttributeMap &command) override
 Send/receive arbitrary commands to the resource.
 
std::vector< GeometryConfigget_geometries ()
 Returns GeometryConfigs associated with the calling base.
 
virtual std::vector< GeometryConfigget_geometries (const AttributeMap &extra)=0
 Returns GeometryConfigs associated with the calling base.
 
properties get_properties ()
 Returns physical properties of the base (width, turning radius, wheel circumference)
 
virtual properties get_properties (const AttributeMap &extra)=0
 Returns physical properties of the base (width, turning radius, wheel circumference)
 
void move_straight (int64_t distance_mm, double mm_per_sec)
 Move a robot's base in a straight line by a given distance. This method blocks until completed or cancelled.
 
virtual void move_straight (int64_t distance_mm, double mm_per_sec, const AttributeMap &extra)=0
 Move a robot's base in a straight line by a given distance. This method blocks until completed or cancelled.
 
void set_power (const Vector3 &linear, const Vector3 &angular)
 Sets the linear and angular power of a base -1 -> 1 in terms of power for each direction.
 
virtual void set_power (const Vector3 &linear, const Vector3 &angular, const AttributeMap &extra)=0
 Sets the linear and angular power of a base -1 -> 1 in terms of power for each direction.
 
void set_velocity (const Vector3 &linear, const Vector3 &angular)
 Set the linear and angular velocity of a base.
 
virtual void set_velocity (const Vector3 &linear, const Vector3 &angular, const AttributeMap &extra)=0
 Set the linear and angular velocity of a base.
 
void spin (double angle_deg, double degs_per_sec)
 Spins a robot's base by an given angle, expressed in degrees. This method blocks until completed or cancelled.
 
virtual void spin (double angle_deg, double degs_per_sec, const AttributeMap &extra)=0
 Spins a robot's base by an given angle, expressed in degrees. This method blocks until completed or cancelled.
 
- Public Member Functions inherited from viam::sdk::Base
void move_straight (int64_t distance_mm, double mm_per_sec)
 Move a robot's base in a straight line by a given distance. This method blocks until completed or cancelled.
 
void spin (double angle_deg, double degs_per_sec)
 Spins a robot's base by an given angle, expressed in degrees. This method blocks until completed or cancelled.
 
void set_power (const Vector3 &linear, const Vector3 &angular)
 Sets the linear and angular power of a base -1 -> 1 in terms of power for each direction.
 
void set_velocity (const Vector3 &linear, const Vector3 &angular)
 Set the linear and angular velocity of a base.
 
properties get_properties ()
 Returns physical properties of the base (width, turning radius, wheel circumference)
 
std::vector< GeometryConfigget_geometries ()
 Returns GeometryConfigs associated with the calling base.
 
API api () const override
 Returns the API associated with a particular resource.
 
- Public Member Functions inherited from viam::sdk::Component
viam::common::v1::ResourceName get_resource_name (std::string name) const override
 Returns a ResourceName for a particular resource name.
 
- Public Member Functions inherited from viam::sdk::Resource
 Resource (std::string name)
 
virtual std::string name () const
 Return the resource's name.
 
- Public Member Functions inherited from viam::sdk::Stoppable
void stop ()
 Stops a resource from running.
 

Additional Inherited Members

- Static Public Member Functions inherited from viam::sdk::Stoppable
static void stop_if_stoppable (const std::shared_ptr< Resource > &resource, const AttributeMap &extra)
 Stops a Resource if it is Stoppable.
 
static void stop_if_stoppable (const std::shared_ptr< Resource > &resource)
 Stops a Resource if it is Stoppable.
 
- Protected Member Functions inherited from viam::sdk::Base
 Base (std::string name)
 
- Protected Member Functions inherited from viam::sdk::Component
 Component (std::string name)
 

Detailed Description

gRPC client implementation of a Base component.

Member Function Documentation

◆ do_command()

AttributeMap viam::sdk::impl::BaseClient::do_command ( const AttributeMap & command)
overridevirtual

Send/receive arbitrary commands to the resource.

Parameters
Commandthe command to execute.
Returns
The result of the executed command.

Implements viam::sdk::Base.

◆ get_geometries() [1/3]

std::vector< GeometryConfig > viam::sdk::Base::get_geometries ( )
inline

Returns GeometryConfigs associated with the calling base.

Returns
The requested GeometryConfigs associated with the component.

◆ get_geometries() [2/3]

std::vector< GeometryConfig > viam::sdk::impl::BaseClient::get_geometries ( const AttributeMap & extra)
overridevirtual

Returns GeometryConfigs associated with the calling base.

Parameters
extraAny additional arguments to the method.
Returns
The requested GeometryConfigs associated with the component.

Implements viam::sdk::Base.

◆ get_geometries() [3/3]

virtual std::vector< GeometryConfig > viam::sdk::Base::get_geometries ( const AttributeMap & extra)
virtual

Returns GeometryConfigs associated with the calling base.

Parameters
extraAny additional arguments to the method.
Returns
The requested GeometryConfigs associated with the component.

Implements viam::sdk::Base.

◆ get_properties() [1/2]

properties viam::sdk::impl::BaseClient::get_properties ( const AttributeMap & extra)
overridevirtual

Returns physical properties of the base (width, turning radius, wheel circumference)

Parameters
extraAny additional arguments to the method

Implements viam::sdk::Base.

◆ get_properties() [2/2]

virtual properties viam::sdk::Base::get_properties ( const AttributeMap & extra)
virtual

Returns physical properties of the base (width, turning radius, wheel circumference)

Parameters
extraAny additional arguments to the method

Implements viam::sdk::Base.

◆ is_moving()

bool viam::sdk::impl::BaseClient::is_moving ( )
overridevirtual

Reports if the base is in motion.

Implements viam::sdk::Base.

◆ move_straight() [1/3]

void viam::sdk::Base::move_straight ( int64_t distance_mm,
double mm_per_sec )
inline

Move a robot's base in a straight line by a given distance. This method blocks until completed or cancelled.

Parameters
distance_mmDesired travel distance in millimeters
mm_per_secDesired travel velocity in millimeters/second

◆ move_straight() [2/3]

void viam::sdk::impl::BaseClient::move_straight ( int64_t distance_mm,
double mm_per_sec,
const AttributeMap & extra )
overridevirtual

Move a robot's base in a straight line by a given distance. This method blocks until completed or cancelled.

Parameters
distance_mmDesired travel distance in millimeters
mm_per_secDesired travel velocity in millimeters/second
extraAny additional arguments to the method

Implements viam::sdk::Base.

◆ move_straight() [3/3]

virtual void viam::sdk::Base::move_straight ( int64_t distance_mm,
double mm_per_sec,
const AttributeMap & extra )
virtual

Move a robot's base in a straight line by a given distance. This method blocks until completed or cancelled.

Parameters
distance_mmDesired travel distance in millimeters
mm_per_secDesired travel velocity in millimeters/second
extraAny additional arguments to the method

Implements viam::sdk::Base.

◆ set_power() [1/3]

void viam::sdk::Base::set_power ( const Vector3 & linear,
const Vector3 & angular )
inline

Sets the linear and angular power of a base -1 -> 1 in terms of power for each direction.

Parameters
linearDesired linear power percentage (-1 <= % <= 1) for each direction
angularDesired angular power percentage (-1 <= % <= 1) for each direction

◆ set_power() [2/3]

void viam::sdk::impl::BaseClient::set_power ( const Vector3 & linear,
const Vector3 & angular,
const AttributeMap & extra )
overridevirtual

Sets the linear and angular power of a base -1 -> 1 in terms of power for each direction.

Parameters
linearDesired linear power percentage (-1 <= % <= 1) for each direction
angularDesired angular power percentage (-1 <= % <= 1) for each direction
extraAny additional arguments to the method

Implements viam::sdk::Base.

◆ set_power() [3/3]

virtual void viam::sdk::Base::set_power ( const Vector3 & linear,
const Vector3 & angular,
const AttributeMap & extra )
virtual

Sets the linear and angular power of a base -1 -> 1 in terms of power for each direction.

Parameters
linearDesired linear power percentage (-1 <= % <= 1) for each direction
angularDesired angular power percentage (-1 <= % <= 1) for each direction
extraAny additional arguments to the method

Implements viam::sdk::Base.

◆ set_velocity() [1/3]

void viam::sdk::Base::set_velocity ( const Vector3 & linear,
const Vector3 & angular )
inline

Set the linear and angular velocity of a base.

Parameters
linearDesired linear velocity in mm per second for each direction
angularDesired angular velocity in degrees per second for each direction

◆ set_velocity() [2/3]

void viam::sdk::impl::BaseClient::set_velocity ( const Vector3 & linear,
const Vector3 & angular,
const AttributeMap & extra )
overridevirtual

Set the linear and angular velocity of a base.

Parameters
linearDesired linear velocity in mm per second for each direction
angularDesired angular velocity in degrees per second for each direction
extraAny additional arguments to the method

Implements viam::sdk::Base.

◆ set_velocity() [3/3]

virtual void viam::sdk::Base::set_velocity ( const Vector3 & linear,
const Vector3 & angular,
const AttributeMap & extra )
virtual

Set the linear and angular velocity of a base.

Parameters
linearDesired linear velocity in mm per second for each direction
angularDesired angular velocity in degrees per second for each direction
extraAny additional arguments to the method

Implements viam::sdk::Base.

◆ spin() [1/3]

void viam::sdk::Base::spin ( double angle_deg,
double degs_per_sec )
inline

Spins a robot's base by an given angle, expressed in degrees. This method blocks until completed or cancelled.

Parameters
angle_degDesired angle
degs_per_secDesired angular velocity

◆ spin() [2/3]

void viam::sdk::impl::BaseClient::spin ( double angle_deg,
double degs_per_sec,
const AttributeMap & extra )
overridevirtual

Spins a robot's base by an given angle, expressed in degrees. This method blocks until completed or cancelled.

Parameters
angle_degDesired angle
degs_per_secDesired angular velocity
extraAny additional arguments to the method

Implements viam::sdk::Base.

◆ spin() [3/3]

virtual void viam::sdk::Base::spin ( double angle_deg,
double degs_per_sec,
const AttributeMap & extra )
virtual

Spins a robot's base by an given angle, expressed in degrees. This method blocks until completed or cancelled.

Parameters
angle_degDesired angle
degs_per_secDesired angular velocity
extraAny additional arguments to the method

Implements viam::sdk::Base.

◆ stop()

void viam::sdk::impl::BaseClient::stop ( const AttributeMap & extra)
overridevirtual

Stops a resource from running.

Parameters
extraExtra arguments to pass to the resource's stop method.

Implements viam::sdk::Stoppable.


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