2026rc_r2/User/module/config.c
2026-03-17 04:39:54 +08:00

83 lines
1.3 KiB
C

#include "config.h"
#include "string.h"
#define CONFIG_BASE_ADDRESS (ADDR_FLASH_SECTOR_11)
#ifdef DEBUG
Config_Param_t config = {
#else
static const Config_Param_t config = {
#endif
.chassis = {
/* DJI3508µç»ú*/
.motor_param = {
{
.can = BSP_CAN_1,
.id = 0x201,
.module = MOTOR_M3508,
.reverse = false,
.gear = true
},
{
.can = BSP_CAN_1,
.id = 0x202,
.module = MOTOR_M3508,
.reverse = false,
.gear = true
},
{
.can = BSP_CAN_1,
.id = 0x203,
.module = MOTOR_M3508,
.reverse = false,
.gear = true
},
{
.can = BSP_CAN_1,
.id = 0x204,
.module = MOTOR_M3508,
.reverse = false,
.gear = true
},
},
.type = CHASSIS_TYPE_MECANUM,
/* PID */
.pid = {
/* µ×Å̵ç»ú PID */
.motor_pid_param = {
.k = 0.0015f,
.p = 1.0f,
.i = 0.0f,
.d = 0.0f,
.i_limit = 1.0f,
.out_limit = 1.0f,
.d_cutoff_freq = -1.0f,
.range = -1.0f,
},
},
.low_pass_cutoff_freq = {
.in = 50.0f,
.out = 50.0f,
}
}
};
/**
* @brief 获取机器人配置参数
* @return 机器人配置参数指针
*/
Config_Param_t *Config_GetRobotParam(void)
{
return &config;
}