Viam C++ SDK current
|
#include "components/servo.hpp"
Public Types | |
typedef uint32_t | position |
Public Member Functions | |
API | api () const override |
Returns the API associated with a particular resource. | |
void | move (uint32_t angle_deg) |
Move the servo to the provided angle. | |
virtual void | move (uint32_t angle_deg, const ProtoStruct &extra)=0 |
Move the servo to the provided angle. | |
position | get_position () |
Get the current angle (degrees) of the servo. | |
virtual position | get_position (const ProtoStruct &extra)=0 |
Reports the position of the robot's servo relative to its zero position. | |
virtual bool | is_moving ()=0 |
Reports if a component is in motion. | |
virtual ProtoStruct | do_command (const ProtoStruct &command)=0 |
Send/receive arbitrary commands to the resource. | |
std::vector< GeometryConfig > | get_geometries () |
Returns GeometryConfig s associated with the calling servo. | |
virtual std::vector< GeometryConfig > | get_geometries (const ProtoStruct &extra)=0 |
Returns GeometryConfig s associated with the calling servo. | |
Public Member Functions inherited from viam::sdk::Component | |
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. | |
Public Member Functions inherited from viam::sdk::Stoppable | |
virtual void | stop (const ProtoStruct &extra)=0 |
Stops a resource from running. | |
void | stop () |
Stops a resource from running. | |
Protected Member Functions | |
Servo (std::string name) | |
Protected Member Functions inherited from viam::sdk::Component | |
Component (std::string name) | |
Protected Member Functions inherited from viam::sdk::Resource | |
Name | get_resource_name (const std::string &type) const |
Additional Inherited Members | |
Static Public Member Functions inherited from viam::sdk::Stoppable | |
static void | stop_if_stoppable (const std::shared_ptr< Resource > &resource, const ProtoStruct &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. | |
This acts as an abstract base class to be inherited form by any drivers representing specific servo implementations. This class cannot be used on its own.
|
overridevirtual |
Returns the API
associated with a particular resource.
Implements viam::sdk::Resource.
|
pure virtual |
Send/receive arbitrary commands to the resource.
Command | the command to execute. |
Implemented in viam::sdk::impl::ServoClient.
|
inline |
Returns GeometryConfig
s associated with the calling servo.
GeometryConfig
s associated with the component.
|
pure virtual |
Returns GeometryConfig
s associated with the calling servo.
extra | Any additional arguments to the method. |
GeometryConfig
s associated with the component. Implemented in viam::sdk::impl::ServoClient, and viam::sdk::impl::ServoClient.
|
inline |
Get the current angle (degrees) of the servo.
`Exception` | if position reporting is not supported |
|
pure virtual |
Reports the position of the robot's servo relative to its zero position.
extra | Any additional arguments to the method |
`Exception` | if position reporting is not supported |
Implemented in viam::sdk::impl::ServoClient, and viam::sdk::impl::ServoClient.
|
pure virtual |
Reports if a component is in motion.
Implemented in viam::sdk::impl::ServoClient.
|
inline |
Move the servo to the provided angle.
angle_deg | The desired angle of the servo in degrees. |
|
pure virtual |
Move the servo to the provided angle.
angle_deg | The desired angle of the servo in degrees. |
extra | Any additional arguments to the method. |
Implemented in viam::sdk::impl::ServoClient, and viam::sdk::impl::ServoClient.