|
A.R.G.U.S 2.1.0
Adaptive Real-Time Guardian for Unsafe Situations
|
Low-level motion output driver for the PCA9685 servo board. More...
#include <MotionController.hpp>
Public Member Functions | |
| MotionController () noexcept | |
| Construct motion controller in uninitialised state. | |
| ~MotionController () noexcept | |
| Destroy motion controller and release resources. | |
| MotionController (const MotionController &)=delete | |
| MotionController & | operator= (const MotionController &)=delete |
| MotionController (MotionController &&)=delete | |
| MotionController & | operator= (MotionController &&)=delete |
| bool | initialise (const char *i2c_device_path="/dev/i2c-1", std::uint8_t device_address=0x40, float pwm_frequency_hz=50.0f, MotionChannelMap channel_map={}) noexcept |
| Initialise PCA9685 output path. | |
| bool | setTargets (const MeArmJointTargets &targets) noexcept |
| Write joint targets to hardware when motion is enabled. | |
| void | freeze () noexcept |
| Freeze/disable motion output immediately. | |
| bool | enable () noexcept |
| Enable motion output after successful initialisation. | |
| void | shutdown () noexcept |
| Disable outputs and close hardware resources. | |
| bool | isInitialised () const noexcept |
| Check whether controller was successfully initialised. | |
| bool | isEnabled () const noexcept |
| Check whether motion output is currently enabled. | |
| bool | isFrozen () const noexcept |
| Check whether output is currently frozen. | |
| MotionOutputState | outputState () const noexcept |
| Get current output state. | |
| MotionControllerError | lastError () const noexcept |
| Get last controller error code. | |
| const char * | lastErrorString () const noexcept |
| Get human-readable last error string. | |
Static Public Attributes | |
| static constexpr std::uint8_t | kServoCount = 4 |
| Number of logical servos controlled. | |
| static constexpr std::uint8_t | kPca9685ChannelCount = 16 |
| PCA9685 total channels. | |
| static constexpr std::uint16_t | kMaxPulseTicks = 4095 |
| Maximum 12-bit pulse value. | |
Definition at line 55 of file MotionController.hpp.
|
noexcept |
Definition at line 68 of file MotionController.cpp.
|
noexcept |
Definition at line 76 of file MotionController.cpp.
References shutdown().
|
delete |
|
delete |
|
noexcept |
true when enable succeeds, otherwise false. Definition at line 190 of file MotionController.cpp.
References DEVICE_IO_FAILED, ENABLED, FAULT, NONE, NOT_INITIALISED, and UNINITIALISED.
Referenced by AppController::runInteractiveServoConsole(), AppController::runMotionHomePose(), AppController::runMotionSmokeTest(), and AppController::runServoCalibration().
|
noexcept |
Definition at line 172 of file MotionController.cpp.
References DEVICE_IO_FAILED, DISABLED, FAULT, and NONE.
|
noexcept |
| i2c_device_path | I2C device path (for example /dev/i2c-1). |
| device_address | I2C slave address of the PCA9685. |
| pwm_frequency_hz | PWM frequency in Hz. |
| channel_map | Logical joint-to-channel mapping. |
true on success, otherwise false and lastError() set. Definition at line 80 of file MotionController.cpp.
References DEVICE_IO_FAILED, DEVICE_OPEN_FAILED, DEVICE_SELECT_FAILED, DISABLED, FAULT, INVALID_ARGUMENT, and NONE.
Referenced by AppController::runInteractiveServoConsole(), AppController::runLiveMarkerTest(), AppController::runMotionHomePose(), AppController::runMotionSmokeTest(), and AppController::runServoCalibration().
|
noexcept |
true if enabled, otherwise false. Definition at line 229 of file MotionController.cpp.
References ENABLED.
|
noexcept |
true if frozen, otherwise false. Definition at line 233 of file MotionController.cpp.
|
noexcept |
true if initialised, otherwise false. Definition at line 224 of file MotionController.cpp.
References FAULT, and UNINITIALISED.
|
noexcept |
Definition at line 241 of file MotionController.cpp.
|
noexcept |
Definition at line 245 of file MotionController.cpp.
References DEVICE_IO_FAILED, DEVICE_OPEN_FAILED, DEVICE_SELECT_FAILED, INVALID_ARGUMENT, NONE, and NOT_INITIALISED.
Referenced by AppController::runInteractiveServoConsole(), AppController::runLiveMarkerTest(), AppController::runMotionHomePose(), AppController::runMotionSmokeTest(), and AppController::runServoCalibration().
|
delete |
|
delete |
|
noexcept |
Definition at line 237 of file MotionController.cpp.
|
noexcept |
| targets | Joint pulse-tick targets. |
true on success, otherwise false. Definition at line 138 of file MotionController.cpp.
References DEVICE_IO_FAILED, ENABLED, FAULT, INVALID_ARGUMENT, NONE, NOT_INITIALISED, and UNINITIALISED.
Referenced by AppController::runInteractiveServoConsole(), AppController::runLiveMarkerTest(), AppController::runMotionHomePose(), AppController::runMotionSmokeTest(), and AppController::runServoCalibration().
|
noexcept |
Definition at line 211 of file MotionController.cpp.
References NONE, and UNINITIALISED.
Referenced by AppController::runInteractiveServoConsole(), AppController::runMotionHomePose(), AppController::runMotionSmokeTest(), AppController::runServoCalibration(), and ~MotionController().
|
staticconstexpr |
Definition at line 59 of file MotionController.hpp.
|
staticconstexpr |
Definition at line 58 of file MotionController.hpp.
|
staticconstexpr |
Definition at line 57 of file MotionController.hpp.