33 #define OBOT_DEFAULT_PORT "/dev/usb/ttyUSB1" 36 #define OBOT_DELAY_US 50000 39 #define OBOT_PUBLISH_INTERVAL 0.1 43 #define OBOT_AXLE_LENGTH 0.317 44 #define OBOT_WHEEL_DIAM 0.10795 45 #define OBOT_WHEEL_CIRCUM (OBOT_WHEEL_DIAM * M_PI) 46 #define OBOT_TICKS_PER_REV 11600.0 47 #define OBOT_M_PER_TICK (OBOT_WHEEL_CIRCUM / OBOT_TICKS_PER_REV) 49 #define OBOT_PID_FREQUENCY (1/1.9375e-3) 50 #define OBOT_MAGIC_TIMING_CONSTANT 1.0 51 #define OBOT_MPS_PER_TICK (OBOT_M_PER_TICK * OBOT_PID_FREQUENCY / \ 52 OBOT_MAGIC_TIMING_CONSTANT) 53 #define OBOT_WIDTH 0.45 54 #define OBOT_LENGTH 0.45 55 #define OBOT_POSE_X 0.0 56 #define OBOT_POSE_Y 0.0 57 #define OBOT_POSE_A 0.0 58 #define OBOT_NOMINAL_VOLTAGE 48.0 61 #define OBOT_MAX_TICS 2147483648U 65 #define OBOT_MAX_WHEELSPEED 5.0 68 #define OBOT_MIN_WHEELSPEED_TICKS 5 72 #define OBOT_ACK 6 // if command acknowledged 73 #define OBOT_NACK 21 // if garbled message 75 #define OBOT_INIT1 253 // The init commands are used in sequence(1,2,3) 76 #define OBOT_INIT2 252 // to initialize a link to a cerebellum. 77 #define OBOT_INIT3 251 // It will then blink green and start accepting other 80 #define OBOT_DEINIT 250 82 #define OBOT_SET_VELOCITIES 118 // 'v'(left_vel, right_vel) as 16-bit signed ints 83 #define OBOT_SET_ACCELERATIONS 97 // 'a'(left_accel, right_accel) as 16-bit unsigned ints 84 #define OBOT_ENABLE_VEL_CONTROL 101 // 'e'() 85 #define OBOT_DISABLE_VEL_CONTROL 100 // 'd'() 86 #define OBOT_GET_ODOM 111 // 'o'()->(left_count, right_count, left_vel, right_vel) 87 #define OBOT_GET_VOLTAGE 98 // 'b'()->(batt_voltage) 88 #define OBOT_STOP 115 // 's'() [shortcut for set_velocities(0,0)] 89 #define OBOT_KILL 107 // 'k'() [shortcut for disable_velocity_control] 90 #define OBOT_HEARTBEAT 104 // 'h'() sends keepalive