<commit_before>#ifndef __ARM_CONTROLLER_H__
#define __ARM_CONTROLLER_H__

#include "robot_interface/ros_thread.h"
#include "robot_interface/gripper.h"

#include "baxter_collaboration/DoAction.h"

class ArmCtrl : public ROSThread, public Gripper
{
private:
    std::string name;
    std::string action;
    int         marker_id;

    ros::ServiceServer service;

protected:
    virtual void InternalThreadEntry() = 0;

    void recoverFromError();

    bool hoverAboveTable(double height);

    bool goHome();

public:
    ArmCtrl(std::string _name, std::string _limb);

    ~ArmCtrl();

    bool serviceCb(baxter_collaboration::DoAction::Request  &req,
                   baxter_collaboration::DoAction::Response &res);

    void setName  (std::string _name)   { name      =   _name; };
    void setAction(std::string _action) { action    = _action; };
    void setMarkerID(int _id)           { marker_id =     _id; };

    std::string getName()     { return      name; };
    std::string getAction()   { return    action; };
    int         getMarkerID() { return marker_id; };
};

#endif<commit_msg>[doxy] documented arm_ctrl a bit<commit_after>#ifndef __ARM_CONTROLLER_H__
#define __ARM_CONTROLLER_H__

#include "robot_interface/ros_thread.h"
#include "robot_interface/gripper.h"

#include "baxter_collaboration/DoAction.h"

class ArmCtrl : public ROSThread, public Gripper
{
private:
    std::string      name;
    
    std::string    action;
    int         marker_id;

    ros::ServiceServer service;

protected:
    /*
     * This function is still virtual in this class because it will be
     * implemented in its children
     */
    virtual void InternalThreadEntry() = 0;

    /**
     * Recovers from errors during execution. It provides a basic interface,
     * but it is advised to specialize this function in the ArmCtrl's children.
     */
    void recoverFromError();

    /**
     * Hovers above table at a specific x-y position. 
     * @param  height the z-axis value of the end-effector position
     * @return        true/false if success/failure
     */
    bool hoverAboveTable(double height);

    /**
     * Goes to the home position
     * @return        true/false if success/failure
     */
    bool goHome();

public:
    // CONSTRUCTOR
    ArmCtrl(std::string _name, std::string _limb);

    // DESTRUCTOR
    ~ArmCtrl();

    /**
     * Callback for the service that requests actions
     * @param  req the action request
     * @param  res the action response (res.success either true or false)
     * @return     true always :)
     */
    bool serviceCb(baxter_collaboration::DoAction::Request  &req,
                   baxter_collaboration::DoAction::Response &res);

    /* Self-explaining "setters" */
    void setName  (std::string _name)   { name      =   _name; };
    void setAction(std::string _action) { action    = _action; };
    void setMarkerID(int _id)           { marker_id =     _id; };

    /* Self-explaining "getters" */
    std::string getName()     { return      name; };
    std::string getAction()   { return    action; };
    int         getMarkerID() { return marker_id; };
};

#endif
{'fraction_non_alphanumeric': 0.10486177311725453, 'fraction_numerical': 0.0006355258976803305, 'mean_word_length': 2.7210401891252953, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2350496', 'n_tokens_mistral': 992, 'n_tokens_neox': 957, 'n_words': 256}