Basic_Frame_TypeC_2023_Omni
Loading...
Searching...
No Matches
subsystems_defines.h
1#ifndef __SUBSYSTEMS_DEFINES_H
2#define __SUBSYSTEMS_DEFINES_H
3
4/* =========================================================================
5 * MOTOR DEFINES
6 * ====================================================================== */
7#define MOTOR_COUNT 8 // RM motor 0-7,
8#define LK_MOTOR_COUNT 4
9#define MAX_MOTOR_COUNT 8
10
11#define CAN_RX_ID_START 0x201
12#define MOTOR_3508_STDID 0x200
13#define MOTOR_6020_STDID 0x1FF
14#define MOTOR_2006_STDID 0x1FF
15
16#define CHASSIS_MOTOR_MAX_DELTA 1000
17#define GIMBAL_MOTOR_MAX_DELTA 1000
18#define CHASSIS_MOTOR_PID_MAX_OUT 3500
19#define GIMBAL_MOTOR_PID_MAX_OUT 2000
20#define FRIC_MOTOR_PID_MAX_VALUE 2000
21#define MAG_MOTOR_PID_MAX_VALUE 10000
22
23// These are used for indexing the motor feedback array from MOTOR_READ topic.
24// Formula: (CAN ID) = (Chassis Motor CAN Std. IDs) - CAN_RX_ID_START.
25#define CHASSIS_WHEEL1_CAN_ID 0
26#define CHASSIS_WHEEL2_CAN_ID 1
27#define CHASSIS_WHEEL3_CAN_ID 2
28#define CHASSIS_WHEEL4_CAN_ID 3
29
30// These are used for indexing the motor feedback array from MOTOR_READ topic.
31// Formula: (CAN ID) = (Gimbal Motor CAN Std. IDs) - CAN_RX_ID_START.
32#define SHOOT_LEFT_FRIC_CAN_ID 0
33#define SHOOT_RIGHT_FRIC_CAN_ID 1
34#define SHOOT_LOADER_CAN_ID 6
35#define GIMBAL_YAW_CAN_ID 4
36#define GIMBAL_PITCH_CAN_ID 5
37
38/* =========================================================================
39 * IMU DEFINES
40 * ====================================================================== */
41
42/* =========================================================================
43 * EVENT CENTER DEFINES
44 * ====================================================================== */
45// Number of sync events that can occur at the same time.
46// A sync event group has one event group that can allows up to 24 different tasks
47// (listed in Task_Sync_t) to "sync" to one particular event (Sync_Event_t).
48#define NUM_SYNC_GROUPS 5
49
50/* =========================================================================
51 * CAN COMM DEFINES
52 * ====================================================================== */
53#define CAN_COMM_QUEUE_SIZE 5
54
55/* =========================================================================
56 * REFEREE UI DEFINES
57 * ====================================================================== */
58#define SOF_ID 0xA5 //fixed sof value
59#define HEADER_LEN sizeof(frame_header_t) // 5
60#define CMD_LEN 2 //cmd_id bytes
61#define CRC_LEN 2 //crc16 bytes
62#define MAX_REF_BUFFER_SIZE 256
63#define MAX_REF_TX_DATA_LEN 128
64#define MAX_REF_RX_DATA_LEN 41
65
66#define UI_HEADER_LEN 6
67#define UI_SEVEN_DRAWS_LEN 105 // 7 * sizeof(interaction_figure_t)=15
68#define UI_HERO_MARK_LEN UI_HEADER_LEN + UI_SEVEN_DRAWS_LEN
69#define UI_INFANTRY_MARK_LEN UI_HEADER_LEN + UI_SEVEN_DRAWS_LEN
70#define UI_STRING_DRAWS_LEN 45 // 15 + 30
71#define UI_ACT_MODE_LEN UI_HEADER_LEN + UI_STRING_DRAWS_LEN
72#define UI_ROBOT_VAILD_INFO_LEN UI_HEADER_LEN + UI_SEVEN_DRAWS_LEN
73
74/* =========================================================================
75 * PC COMM DEFINES
76 * ====================================================================== */
77// PACK HEADERS
78#define UC_AUTO_AIM_HEADER 0x01
79#define UC_BOARD_DATA_HEADER 0x02
80#define UC_FLOW_CONTROL_HEADER 0x04
81
82// PACK DEFINITIONS
83#define MAX_PACK_BUFFER_SIZE 64 // Measured in bytes.
84#define PACK_HEADER_SIZE 4
85#define PACK_TRAILER_SIZE 4
86
87#endif