Atlas Behavior Library
1.0
|
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.0.8" 00013 #define ATLAS_SIM_SOFTWARE_VERSION_MAJOR 1 00014 #define ATLAS_SIM_SOFTWARE_VERSION_MINOR 0 00015 #define ATLAS_SIM_SOFTWARE_VERSION_POINT 8 00016 00017 using namespace Atlas; 00018 00019 #ifndef NOT_IN_DOXYGEN 00020 namespace AtlasSim { 00021 #endif 00022 00023 00030 00031 00038 struct AtlasJointDesired 00039 { 00040 float q_d; 00041 float qd_d; 00042 float f_d; 00043 00045 AtlasJointDesired() : 00046 q_d(0.0f), 00047 qd_d(0.0f), 00048 f_d(0.0f) 00049 {} 00050 }; 00051 00052 00070 struct AtlasJointControlParams 00071 { 00072 float k_q_p; 00073 float k_q_i; 00074 float k_qd_p; 00075 00077 AtlasJointControlParams() : 00078 k_q_p(0.0f), 00079 k_q_i(0.0f), 00080 k_qd_p(0.0f) 00081 {} 00082 }; 00083 00084 00095 struct AtlasControlOutput 00096 { 00100 double f_out[Atlas::NUM_JOINTS]; 00101 00105 AtlasPositionData pos_est; 00106 00110 AtlasVec3f foot_pos_est[Atlas::NUM_FEET]; 00111 00115 AtlasBehaviorFeedback behavior_feedback; 00116 00120 AtlasControlOutput() 00121 {} 00122 }; 00123 00124 00131 00132 00139 struct AtlasJointState 00140 { 00141 float q; 00142 float qd; 00143 float f; 00144 00146 AtlasJointState() : 00147 q(0.0f), 00148 qd(0.0f), 00149 f(0.0f) 00150 {} 00151 }; 00152 00153 00160 struct AtlasRobotState 00161 { 00162 double t; 00163 00164 AtlasJointState j[Atlas::NUM_JOINTS]; 00165 00166 AtlasIMUData imu; 00167 AtlasFootSensor foot_sensors[Atlas::NUM_FOOT_SENSORS]; 00168 AtlasWristSensor wrist_sensors[Atlas::NUM_WRIST_SENSORS]; 00169 00170 AtlasRobotState() : 00171 t(0.0) 00172 {} 00173 }; 00174 00175 00182 struct AtlasControlInput 00183 { 00184 AtlasJointDesired j[Atlas::NUM_JOINTS]; 00185 AtlasJointControlParams jparams[Atlas::NUM_JOINTS]; 00186 00187 /* 00188 * Behavior params. 00189 */ 00190 AtlasBehaviorStandParams stand_params; 00191 AtlasBehaviorStepParams step_params; 00192 AtlasBehaviorWalkParams walk_params; 00193 AtlasBehaviorManipulateParams manipulate_params; 00194 }; 00195 00196 00203 00210 #ifdef ERROR_INVALID_INDEX 00211 #undef ERROR_INVALID_INDEX 00212 #endif 00213 00214 typedef enum 00215 { 00216 NO_ERRORS = 0, 00217 ERROR_UNSPECIFIED = -1, 00218 ERROR_VALUE_OUT_OF_RANGE = -2, 00219 ERROR_INVALID_INDEX = -3, 00220 ERROR_FAILED_TO_START_BEHAVIOR = -4, 00221 ERROR_NO_ACTIVE_BEHAVIOR = -5, 00222 ERROR_NO_SUCH_BEHAVIOR = -6, 00223 ERROR_BEHAVIOR_NOT_IMPLEMENTED = -7, 00224 ERROR_TIME_RAN_BACKWARD = -8, 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