Low Level Motion Service Interface
Introduction
Low Level Motion Service Interface: Mainly used for motor control of Daystar Robot.
Function | C++ | ROS |
---|---|---|
clear drive error | ✔ | |
Recalibrate all drives and save | ✔ | |
On-Joint Torque Sensor Clearing | ✔ |
Clear Drive Error
C++ Interface
rcClientInterfaceClearDriverError
Introduction
cpp
/**
* @brief Clearing driver errors.
*
* This function is used to clear driver errors for the specified joint.
*
* @param mask Specifies the joint selection mask.
* @return bool Returns `true` for successful clearing, `false` for failed clearing.
*/
bool rcClientInterfaceClearDriverError(unsigned int mask);
use Case
cpp
unsigned int joints_mask = 0x0F; // 示例值,表示选择的关节掩码
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;
}
precautions
- make sure the incoming joint selection mask is valid.
Recalibrate All Drives and Save
C++ Interface
rcClientInterfaceReCalibrateAllDriverAndSave
Introduction
cpp
/**
* @brief Recalibrate all drives and save.
*
* This function recalibrates all drives and saves the calibration results.
*
* @param is_rough Specifies whether to perform a rough calibration (true for rough calibration, false for fine calibration).
* @return bool Returns `true` for a successful calibration, `false` for a failed calibration.
*/
bool rcClientInterfaceReCalibrateAllDriverAndSave(bool is_rough);
use Case
cpp
bool rough_calibration = true; // 示例值,表示粗略校准
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;
}
Precautions
- make sure that the calibration mode (coarse or fine) is selected correctly.
Clear The Joint Torque Sensor
C++ Interface
rcClientInterfaceZeroTorqueSensor
Introduction
cpp
/**
* @brief Interface for zeroing the robot's on-joint torque sensors.
* @brief Interface to zero out the robot's torque sensors on its joints.
* This function is used to zero the robot's joint moment sensors.
*
* @param from Specifies the mode of operation (navigation or joystick).
* @return bool Returns `true` for a successful operation, `false` for a failed operation.
*/
bool rcClientInterfaceZeroTorqueSensor(robot_control::common::NAV_OR_JOY_MODE from);
Use Case
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;
}