Low-Level Motion Service Interfaces
Overview
The low-level motion service interfaces are primarily used for motor control of the DaystarBot.
Function | C++ | ROS |
---|---|---|
Clear driver errors | ✔ | |
Recalibrate all drivers and save | ✔ | |
Zero joint torque sensors | ✔ |
Clear Driver Errors
C++ Interface
Function:rcClientInterfaceClearDriverError
cpp
/**
* @brief Clear driver errors.
*
* This function is used to clear the driver error of the specified joint(s).
*
* @param mask Bitmask specifying which joints to clear.
* @return bool Returns `true` on success, `false` on failure.
*/
bool rcClientInterfaceClearDriverError(unsigned int mask);
Usage Example:
cpp
unsigned int joints_mask = 0x0F; // Example bitmask selecting joints
bool success = rcClientInterfaceClearDriverError(joints_mask);
if (success) {
std::cout << "Driver Error Cleared Successfully." << std::endl;
} else {
std::cout << "Failed to Clear Driver Error." << std::endl;
}
WARNING
Notes:
- Ensure that the provided joint bitmask is valid.
Recalibrate All Drivers and Save
C++ Interface
Function:rcClientInterfaceReCalibrateAllDriverAndSave
cpp
/**
* @brief Recalibrate all drivers and save the calibration data.
*
* This function performs a recalibration on all drivers and saves the results.
*
* @param is_rough Indicates whether to perform rough calibration (`true`) or fine calibration (`false`).
* @return bool Returns `true` on success, `false` on failure.
*/
bool rcClientInterfaceReCalibrateAllDriverAndSave(bool is_rough);
Usage Example:
cpp
bool rough_calibration = true; // Example: perform rough calibration
bool success = rcClientInterfaceReCalibrateAllDriverAndSave(rough_calibration);
if (success) {
std::cout << "Recalibrated All Drivers and Saved Successfully." << std::endl;
} else {
std::cout << "Failed to Recalibrate All Drivers and Save." << std::endl;
}
WARNING
Notes:
- Ensure the correct calibration mode is selected (rough or fine).
Zero Joint Torque Sensors
C++ Interface
Function:rcClientInterfaceZeroTorqueSensor
cpp
/**
* @brief Zero the torque sensors on robot joints.
*
* This function zeroes the torque sensors of the robot's joints.
*
* @param from Specifies the operation mode (navigation or joystick).
* @return bool Returns `true` on success, `false` on failure.
*/
bool rcClientInterfaceZeroTorqueSensor(robot_control::common::NAV_OR_JOY_MODE from);
Usage Example:
cpp
robot_control::common::NAV_OR_JOY_MODE mode = robot_control::common::NAV_OR_JOY_MODE::joy_control;
bool success = rcClientInterfaceZeroTorqueSensor(mode);
if (success) {
std::cout << "Torque Sensor Zeroing Successful." << std::endl;
} else {
std::cout << "Failed to Zero Torque Sensor." << std::endl;
}