LWA3ArmUASHH.h
Go to the documentation of this file.
00001 /*
00002  * LWA3ArmUASHH.h
00003  *
00004  * Hardware specific code for the LWA3 arm at the Robot Vision Lab, UAS Hamburg.
00005  */
00006 
00007 #ifndef LWA3ARMUASHH_H_
00008 #define LWA3ARMUASHH_H_
00009 
00010 #include "AmtecProtocolArm.h"
00011 
00012 
00013 class LWA3ArmUASHH: public AmtecProtocolArm {
00014 
00015 #define GRIPPER_ID      (modules_count_-1)
00016 
00017 public:
00018         virtual void init() {
00019                 AmtecProtocolArm::init();
00020 
00021                 // ref the gripper
00022                 ackJoint(GRIPPER_ID);
00023         }
00024 
00025         virtual int ackJoint(IDType id) {
00026                 // the gripper has to be reset nicely
00027                 const AmtecManipulator::ModuleConfig *moduleConfig;
00028                 manipulator_.getModuleConfig(id + id_offset_, moduleConfig);
00029 
00030                 if(id == GRIPPER_ID && moduleConfig->linear) {
00031                         int retval = 0;
00032                         if(!moduleConfig->status_flags.flags.home_ok) { // if not referenced, do so
00033                                 retval += refJoint(id); // start reference
00034                                 ros::Duration(4).sleep(); // wait to finish reference
00035                         }
00036                         if(id == GRIPPER_ID) { // set movable speeds in case too low ones were set
00037                                 retval += setAcceleration(id, 0.04);    // set gripper acceleration
00038                                 retval += setVelocity(id, 0.04);                // and velocity to a nice value
00039                         }
00040                         return retval;
00041                 } else {
00042                         return AmtecProtocolArm::ackJoint(id);
00043                 }
00044         }
00045 
00046         virtual int refJoint(IDType id) {
00047                 if(id == GRIPPER_ID) {
00048                         setAcceleration(id, 0.04); // set gripper acceleration
00049                         setVelocity(id, 0.04);  // and velocity to a nice value
00050                 }
00051 
00052                 return AmtecProtocolArm::refJoint(id);
00053         }
00054 
00055 };
00056 
00057 #endif /* LWA3ARMUASHH_H_ */


metralabs_ros
Author(s): Yianni Gatsoulis and Chris Burbridge and Lorenzo Riano and Felix Kolbe
autogenerated on Mon Oct 6 2014 07:27:58