mb_defs.h 2.6 KB
Newer Older
pgaskell's avatar
pgaskell committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*******************************************************************************
* mb_defs.h
*
*   defines for your bot
*   You will need to fill this in based on the data sheets, schematics, etc. 
*      and your specific configuration...
* 
*******************************************************************************/
#ifndef MB_DEFS_H
#define MB_DEFS_H

//#define EXT_CAPE  //for use with the MOBILE ROB CAPE VERSIONS BELOW
//#define MRC_VERSION_1v3
//#define MRC_VERSION_2v1
#define BEAGLEBONE_BLUE
#define DEFAULT_PWM_FREQ        25000 // period of motor drive pwm
#define LEFT_MOTOR              1     // id of left motor
#define RIGHT_MOTOR             2     // id of right motor

// TODO: Add convienient defines to define things like motor and encoder polarity here
gxiang's avatar
gxiang committed
21
#define LEFT_MOTOR_POL 1
jxchenlu's avatar
jxchenlu committed
22
#define RIGHT_MOTOR_POL 1
gxiang's avatar
gxiang committed
23
24
#define LEFT_ENC_POL -1
#define RIGHT_ENC_POL 1
pgaskell's avatar
pgaskell committed
25
// TODO: Fill in physical propeties of robot
26
27
28
29
#define GEAR_RATIO              78.0  // gear ratio of motor
#define ENCODER_RES             20.0  // encoder counts per motor shaft revolution
#define WHEEL_DIAMETER          0.084 // diameter of wheel in meters
#define WHEEL_BASE              0.158  // wheel separation distance in meters
pgaskell's avatar
pgaskell committed
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#define MAX_FWD_VEL             0.8   // maximum forwad speed (m/s)
#define MAX_TURN_VEL            2.5   // maximum turning speed (rad/s)

// These rates are set to defaults - can be changed
#define SAMPLE_RATE_HZ          50   // main filter and control loop speed
#define DT                      0.02  // 1/sample_rate
#define PRINTF_HZ               10    // rate of print loop
#define RC_CTL_HZ               25   // main filter and control loop speed
#define LCM_HZ                  100    // rate of LCM subscribe
#define LCM_PRIORITY            60    // priority of LCM thread (lower is less critical)
#define SETPOINT_PRIORITY       30    // priority of setpoint thread (lower is less critical)
#define CONTROLLER_PRIORITY     90    // priority of controller (lower is less critical)

// LCM Channel Names - should not be changed
#define TRUE_POSE_CHANNEL           "TRUE_POSE"
#define ODOMETRY_CHANNEL            "ODOMETRY"
#define RESET_ODOMETRY_CHANNEL      "RESET_ODOMETRY"
#define CONTROLLER_PATH_CHANNEL     "CONTROLLER_PATH"
#define MBOT_IMU_CHANNEL            "MBOT_IMU"
#define MBOT_ENCODER_CHANNEL        "MBOT_ENCODERS"
#define MBOT_MOTOR_COMMAND_CHANNEL  "MBOT_MOTOR_COMMAND"
#define MBOT_TIMESYNC_CHANNEL       "MBOT_TIMESYNC"
gxiang's avatar
gxiang committed
52
#define MBOT_WHEEL_CTRL_CHANNEL     "MBOT_CTRL_COMMAND"
pgaskell's avatar
pgaskell committed
53
54
55
56
57
58
#define LCM_ADDRESS                 "udpm://239.255.76.67:7667?ttl=1"

#define LED_OFF                 1
#define LED_ON                  0

#endif