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)
#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)
#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