Atlas Sim Interface  1.0
AtlasSimInterfaceTypes.h
Go to the documentation of this file.
00001 
00002 #ifndef __AtlasSimInterfaceTypes_H
00003 #define __AtlasSimInterfaceTypes_H
00004 
00005 #include "AtlasControlTypes.h"
00006 #include "AtlasVectorTypes.h"
00007 
00008 #if __GNUC__ >= 4
00009 #pragma GCC visibility push(default)
00010 #endif
00011 
00012 #define ATLAS_SIM_SOFTWARE_VERSION_STRING "1.1.1"
00013 #define ATLAS_SIM_SOFTWARE_VERSION_MAJOR 1
00014 #define ATLAS_SIM_SOFTWARE_VERSION_MINOR 1
00015 #define ATLAS_SIM_SOFTWARE_VERSION_POINT 1
00016 
00017 using namespace Atlas;
00018 
00019 #ifndef NOT_IN_DOXYGEN
00020 namespace AtlasSim {
00021 #endif
00022 
00023 
00030 
00031 
00038 struct AtlasJointState
00039 {
00040     float q;       
00041     float qd;      
00042     float f;       
00043 
00045     AtlasJointState() :
00046         q(0.0f),
00047         qd(0.0f),
00048         f(0.0f)
00049     {}
00050 };
00051 
00052 
00059 struct AtlasRobotState
00060 {
00061     double t;               
00062 
00063     AtlasJointState j[Atlas::NUM_JOINTS];
00064 
00065     AtlasIMUData     imu;                                     
00066     AtlasFootSensor  foot_sensors[Atlas::NUM_FOOT_SENSORS];   
00067     AtlasWristSensor wrist_sensors[Atlas::NUM_WRIST_SENSORS]; 
00068 
00069     AtlasRobotState() :
00070         t(0.0)
00071         {}
00072 };
00073 
00074 
00081 struct AtlasJointDesired
00082 {
00083     float q_d;            
00084     float qd_d;           
00085     float f_d;            
00086 
00088     AtlasJointDesired() :
00089         q_d(0.0f),
00090         qd_d(0.0f),
00091         f_d(0.0f)
00092     {}
00093 };
00094 
00095 
00102 
00103 
00121 struct AtlasJointControlParams
00122 {
00123     float k_q_p;      
00124     float k_q_i;      
00125     float k_qd_p;     
00126 
00128     AtlasJointControlParams() :
00129         k_q_p(0.0f),
00130         k_q_i(0.0f),
00131         k_qd_p(0.0f)
00132     {}
00133 };
00134 
00135 
00142 struct AtlasControlInput
00143 {
00144     AtlasJointDesired j[Atlas::NUM_JOINTS];             
00145     AtlasJointControlParams jparams[Atlas::NUM_JOINTS]; 
00146 
00147     AtlasBehaviorStandParams      stand_params;         
00148     AtlasBehaviorStepParams       step_params;          
00149     AtlasBehaviorWalkParams       walk_params;          
00150     AtlasBehaviorManipulateParams manipulate_params;    
00151 };
00152 
00153 
00160 
00161 
00172 struct AtlasControlOutput
00173 {
00177     double f_out[Atlas::NUM_JOINTS];
00178 
00182     AtlasPositionData pos_est;
00183 
00187     AtlasVec3f foot_pos_est[Atlas::NUM_FEET];
00188 
00189     AtlasBehaviorFeedback           behavior_feedback;        
00190     AtlasBehaviorStandFeedback      stand_feedback;           
00191     AtlasBehaviorStepFeedback       step_feedback;            
00192     AtlasBehaviorWalkFeedback       walk_feedback;            
00193     AtlasBehaviorManipulateFeedback manipulate_feedback;      
00194 
00198     AtlasControlOutput()
00199     {}
00200 };
00201 
00202 
00209 #ifdef ERROR_INVALID_INDEX
00210 #undef ERROR_INVALID_INDEX
00211 #endif
00212 
00213 typedef enum
00214 {
00215     NO_ERRORS                        =  0,   
00216     ERROR_UNSPECIFIED                = -1,   
00217     ERROR_VALUE_OUT_OF_RANGE         = -2,   
00218     ERROR_INVALID_INDEX              = -3,   
00219     ERROR_FAILED_TO_START_BEHAVIOR   = -4,   
00220     ERROR_NO_ACTIVE_BEHAVIOR         = -5,   
00221     ERROR_NO_SUCH_BEHAVIOR           = -6,   
00222     ERROR_BEHAVIOR_NOT_IMPLEMENTED   = -7,   
00223     ERROR_TIME_RAN_BACKWARD          = -8,   
00224     ERROR_INVALID_RESULTS            = -9,   
00225     NUM_ERROR_CODES
00226 
00227 } AtlasErrorCode;
00228 
00230 
00231 #ifndef NOT_IN_DOXYGEN
00232 } // end namespace AtlasSim
00233 #endif
00234 
00235 #if __GNUC__ >= 4
00236 #pragma GCC visibility pop
00237 #endif
00238 
00239 #endif // __AtlasSimInterfaceTypes_H
00240