|
Viam C++ SDK current
|
#include "components/servo.hpp"
Inheritance diagram for viam::sdk::Servo: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 GeometryConfigs associated with the calling servo. | |
| virtual std::vector< GeometryConfig > | get_geometries (const ProtoStruct &extra)=0 |
Returns GeometryConfigs 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. | |
| void | set_log_level (log_level) const |
| Set the log level for log messages originating from this Resource. | |
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 | |
Protected Attributes inherited from viam::sdk::Resource | |
| LogSource | logger_ |
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 GeometryConfigs associated with the calling servo.
GeometryConfigs associated with the component.
|
pure virtual |
Returns GeometryConfigs associated with the calling servo.
| extra | Any additional arguments to the method. |
GeometryConfigs 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.