Joint Angle Error Detection
Listen for Invalid Joint Angles
During the runtime, it is possible that you will receive invalid values from the joint angle sensors. To get notified about this unwanted behavior, you can subscribe to this error pattern.
- Method:
void listenForInvalidRelativeJointAngle(ObjectID jointId, angle minAngle, angle maxAngle, NotificationLevel logLevel = WARNING_LEVEL)
-
Arguments
Name Type Default Required? Description jointId ObjectID- truejointIdis the joint id, which identifies the joint you want to observeminAngle angle- trueminimum relative angle maxAngle angle- truemaximum relative angle logLevel DEBUG_LEVEL, INFO_LEVEL, WARNING_LEVEL, ERROR_LEVEL, DANGER_LEVEL WARNING_LEVEL falseDefines the system notification level, which also determines over which topic the health check message is published (see all log levels) -
Output Topics:
General format depending on the log level:
Modified parameters:
name condition Description msg - message string list code Angle is not in interval JOINT_INVALID_REL_ANGLE_NOTIFICATION object - same as input parameter jointId- ID of to be observed object: same asjointIdparameter -
Example:
#include "roboy_error_detection/roboyErrorDetection.hpp"
// [...]
int main(int argc, char* argv[])
{
// [...]
ros::NodeHandlePtr nh = ros::NodeHandlePtr(new ros::NodeHandle);
RoboyErrorDetection handler(nh);
int JOINT_ID = 0;
int minJointAngle = 0, maxJointAngle = 100;
handler.listenForInvalidRelativeJointAngle(JOINT_ID, minJointAngle, maxJointAngle);
// [...]
return 0;
}
Example taken from the main_joint_rel_angle_check.cpp file
Listen for Too Close Joint Sensor Magnet
Joint sensors have internal magnets, which help them to discover the joint angles. But it can happen that they are too close or too far away, so that they can not calculate the angles. Therefore, this error pattern was introduced. [DEPRECATED]: In the new joint sensors, this problem won't happen any more.
- Method:
void listenForJointMagnetStatus(ObjectID jointId, NotificationInterval durationOfValidity = 2000, NotificationLevel logLevel = WARNING_LEVEL)
-
Arguments
Name Type Default Required? Description jointId ObjectID- truejointIdis the joint id, which identifies the joint you want to observedurationOfValidity NotificationInterval2000 falseMinimum time in milliseconds from one health check to the next health check of this motor logLevel DEBUG_LEVEL, INFO_LEVEL, WARNING_LEVEL, ERROR_LEVEL, DANGER_LEVEL WARNING_LEVEL falseDefines the system notification level, which also determines over which topic the health check message is published (see all log levels) -
Output Topics:
General format depending on the log level:
Modified parameters:
name condition Description msg - message string list code Magnet too far away JOINT_TOO_FAR_NOTIFICATION code Magnet too close JOINT_TOO_CLOSE_NOTIFICATION object - same as input parameter jointId- ID of to be observed object: same asjointIdparameter -
Example:
#include "roboy_error_detection/roboyErrorDetection.hpp"
// [...]
int main(int argc, char* argv[])
{
// [...]
ros::NodeHandlePtr nh = ros::NodeHandlePtr(new ros::NodeHandle);
RoboyErrorDetection handler(nh);
int JOINT_ID = 0;
handler.listenForJointMagnetStatus(JOINT_ID);
// [...]
return 0;
}
Example taken from the main_joint_magnet_check.cpp file