obot_constants.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #include <math.h>
00032
00033 #define OBOT_DEFAULT_PORT "/dev/usb/ttyUSB1"
00034
00035
00036 #define OBOT_DELAY_US 50000
00037
00038
00039 #define OBOT_PUBLISH_INTERVAL 0.1
00040
00041
00042
00043 #define OBOT_AXLE_LENGTH 0.317
00044 #define OBOT_WHEEL_DIAM 0.10795
00045 #define OBOT_WHEEL_CIRCUM (OBOT_WHEEL_DIAM * M_PI)
00046 #define OBOT_TICKS_PER_REV 11600.0
00047 #define OBOT_M_PER_TICK (OBOT_WHEEL_CIRCUM / OBOT_TICKS_PER_REV)
00048
00049 #define OBOT_PID_FREQUENCY (1/1.9375e-3)
00050 #define OBOT_MAGIC_TIMING_CONSTANT 1.0
00051 #define OBOT_MPS_PER_TICK (OBOT_M_PER_TICK * OBOT_PID_FREQUENCY / \
00052 OBOT_MAGIC_TIMING_CONSTANT)
00053 #define OBOT_WIDTH 0.45
00054 #define OBOT_LENGTH 0.45
00055 #define OBOT_POSE_X 0.0
00056 #define OBOT_POSE_Y 0.0
00057 #define OBOT_POSE_A 0.0
00058 #define OBOT_NOMINAL_VOLTAGE 48.0
00059
00060
00061 #define OBOT_MAX_TICS 2147483648U
00062
00063
00064
00065 #define OBOT_MAX_WHEELSPEED 5.0
00066
00067
00068 #define OBOT_MIN_WHEELSPEED_TICKS 5
00069
00070
00071
00072 #define OBOT_ACK 6 // if command acknowledged
00073 #define OBOT_NACK 21 // if garbled message
00074
00075 #define OBOT_INIT1 253 // The init commands are used in sequence(1,2,3)
00076 #define OBOT_INIT2 252 // to initialize a link to a cerebellum.
00077 #define OBOT_INIT3 251 // It will then blink green and start accepting other
00078
00079
00080 #define OBOT_DEINIT 250
00081
00082 #define OBOT_SET_VELOCITIES 118 // 'v'(left_vel, right_vel) as 16-bit signed ints
00083 #define OBOT_SET_ACCELERATIONS 97 // 'a'(left_accel, right_accel) as 16-bit unsigned ints
00084 #define OBOT_ENABLE_VEL_CONTROL 101 // 'e'()
00085 #define OBOT_DISABLE_VEL_CONTROL 100 // 'd'()
00086 #define OBOT_GET_ODOM 111 // 'o'()->(left_count, right_count, left_vel, right_vel)
00087 #define OBOT_GET_VOLTAGE 98 // 'b'()->(batt_voltage)
00088 #define OBOT_STOP 115 // 's'() [shortcut for set_velocities(0,0)]
00089 #define OBOT_KILL 107 // 'k'() [shortcut for disable_velocity_control]
00090 #define OBOT_HEARTBEAT 104 // 'h'() sends keepalive
00091
00092
00093
Last updated 12 September 2005 21:38:45
|