Skip to content

Commit

Permalink
Merge pull request #64 from xrobot-org/dev
Browse files Browse the repository at this point in the history
添加无人机云台和舵步代码
  • Loading branch information
Jiu-xiao authored Mar 31, 2024
2 parents 73f563b + 879aac6 commit cf1bd57
Show file tree
Hide file tree
Showing 25 changed files with 2,110 additions and 188 deletions.
155 changes: 155 additions & 0 deletions hw/bsp/rm-c/config/drone_gimbal.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
# CONFIG_auto_generated_config_prefix_board-c-mini is not set
# CONFIG_auto_generated_config_prefix_board-dual_canfd is not set
# CONFIG_auto_generated_config_prefix_board-esp32-c3-arduino is not set
# CONFIG_auto_generated_config_prefix_board-esp32-c3-idf is not set
# CONFIG_auto_generated_config_prefix_board-f103_can is not set
# CONFIG_auto_generated_config_prefix_board-mangopi_r818 is not set
# CONFIG_auto_generated_config_prefix_board-microswitch is not set
# CONFIG_auto_generated_config_prefix_board-MiniPC is not set
# CONFIG_auto_generated_config_prefix_board-MiniPC_with_canfd is not set
# CONFIG_auto_generated_config_prefix_board-node_imu is not set
CONFIG_auto_generated_config_prefix_board-rm-c=y
# CONFIG_auto_generated_config_prefix_board-Webots is not set
# CONFIG_auto_generated_config_prefix_system-Bootloader is not set
CONFIG_auto_generated_config_prefix_system-FreeRTOS=y
# CONFIG_auto_generated_config_prefix_system-Linux is not set
# CONFIG_auto_generated_config_prefix_system-Linux_Webots is not set
# CONFIG_auto_generated_config_prefix_system-None is not set

#
# FreeRTOS
#
CONFIG_INIT_TASK_STACK_DEPTH=2048
CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=512
CONFIG_FREERTOS_USB_TASK_STACK_DEPTH=256
CONFIG_FREERTOS_TERM_TASK_STACK_DEPTH=512
# end of FreeRTOS

# CONFIG_auto_generated_config_prefix_robot-balance_infantry is not set
# CONFIG_auto_generated_config_prefix_robot-ble_net_config is not set
# CONFIG_auto_generated_config_prefix_robot-blink is not set
# CONFIG_auto_generated_config_prefix_robot-bootloader is not set
# CONFIG_auto_generated_config_prefix_robot-canfd_to_uart is not set
# CONFIG_auto_generated_config_prefix_robot-can_to_uart is not set
# CONFIG_auto_generated_config_prefix_robot-custom_controller is not set
# CONFIG_auto_generated_config_prefix_robot-dart is not set
CONFIG_auto_generated_config_prefix_robot-drone_gimbal=y
# CONFIG_auto_generated_config_prefix_robot-engineer is not set
# CONFIG_auto_generated_config_prefix_robot-helm_infantry is not set
# CONFIG_auto_generated_config_prefix_robot-hero is not set
# CONFIG_auto_generated_config_prefix_robot-infantry is not set
# CONFIG_auto_generated_config_prefix_robot-microswitch is not set
# CONFIG_auto_generated_config_prefix_robot-sentry is not set
# CONFIG_auto_generated_config_prefix_robot-sim_balance is not set
# CONFIG_auto_generated_config_prefix_robot-sim_mecanum is not set
# CONFIG_auto_generated_config_prefix_robot-uart_net_config is not set
# CONFIG_auto_generated_config_prefix_robot-udp_to_uart is not set
# CONFIG_auto_generated_config_prefix_robot-wearlab_imu is not set

#
# 组件
#

#
# 设备
#
CONFIG_auto_generated_config_prefix_device-ahrs=y
CONFIG_DEVICE_AHRS_TASK_STACK_DEPTH=256
# CONFIG_auto_generated_config_prefix_device-ahrs-9 is not set
CONFIG_auto_generated_config_prefix_device-ai=y
CONFIG_DEVICE_AI_TASK_STACK_DEPTH=384

#
# 上位机
#
# CONFIG_HOST_CTRL_PRIORITY is not set
# end of 上位机

# CONFIG_auto_generated_config_prefix_device-blink_led is not set
CONFIG_auto_generated_config_prefix_device-bmi088=y
CONFIG_DEVICE_BMI088_TASK_STACK_DEPTH=256
# CONFIG_auto_generated_config_prefix_device-bq27220 is not set
# CONFIG_auto_generated_config_prefix_device-buzzer is not set
CONFIG_auto_generated_config_prefix_device-can=y
# CONFIG_auto_generated_config_prefix_device-canfd is not set
CONFIG_auto_generated_config_prefix_device-cap=y
CONFIG_DEVICE_CAP_TASK_STACK_DEPTH=256

#
# 超级电容
#
CONFIG_CAP_PERCENT_NO_LIM=80
CONFIG_CAP_PERCENT_WORK=30
CONFIG_CAP_MAX_LOAD=100
# end of 超级电容

# CONFIG_auto_generated_config_prefix_device-custom_controller is not set
CONFIG_auto_generated_config_prefix_device-dr16=y
CONFIG_DEVICE_DR16_TASK_STACK_DEPTH=384
# CONFIG_auto_generated_config_prefix_device-icm42688 is not set
CONFIG_auto_generated_config_prefix_device-imu=y
CONFIG_DEVICE_CAN_IMU_TASK_STACK_DEPTH=256
# CONFIG_auto_generated_config_prefix_device-ina226 is not set
# CONFIG_auto_generated_config_prefix_device-laser is not set
CONFIG_auto_generated_config_prefix_device-led_rgb=y
CONFIG_DEVICE_LED_RGB_TASK_STACK_DEPTH=128
# CONFIG_auto_generated_config_prefix_device-mech is not set
# CONFIG_auto_generated_config_prefix_device-microswitch is not set
# CONFIG_auto_generated_config_prefix_device-mmc5603 is not set
CONFIG_auto_generated_config_prefix_device-motor=y
# CONFIG_auto_generated_config_prefix_device-net_config is not set
CONFIG_auto_generated_config_prefix_device-referee=y
CONFIG_DEVICE_REF_TRANS_TASK_STACK_DEPTH=256
CONFIG_DEVICE_REF_RECV_TASK_STACK_DEPTH=256

#
# 裁判系统
#
# CONFIG_REF_VIRTUAL is not set
CONFIG_REF_LAUNCH_SPEED=30
CONFIG_REF_HEAT_LIMIT_17=100
CONFIG_REF_HEAT_LIMIT_42=100
CONFIG_REF_POWER_LIMIT=200
CONFIG_REF_POWER_BUFF=100
# end of 裁判系统

#
# 操作手UI
#
CONFIG_UI_DYNAMIC_CYCLE=20
CONFIG_UI_STATIC_CYCLE=1000
# end of 操作手UI

CONFIG_auto_generated_config_prefix_device-servo=y
# CONFIG_auto_generated_config_prefix_device-simulator is not set
# CONFIG_auto_generated_config_prefix_device-spl06_001 is not set
# CONFIG_auto_generated_config_prefix_device-tof is not set
# end of 设备

#
# 模块
#
# CONFIG_auto_generated_config_prefix_module-balance is not set
# CONFIG_auto_generated_config_prefix_module-ble_net_config is not set
# CONFIG_auto_generated_config_prefix_module-canfd_to_uart is not set
# CONFIG_auto_generated_config_prefix_module-can_imu is not set
# CONFIG_auto_generated_config_prefix_module-can_imu_wearlab is not set
# CONFIG_auto_generated_config_prefix_module-can_usart is not set
CONFIG_auto_generated_config_prefix_module-chassis=y
CONFIG_MODULE_CHASSIS_TASK_STACK_DEPTH=384
# CONFIG_auto_generated_config_prefix_module-custom_controller is not set
# CONFIG_auto_generated_config_prefix_module-dart_gimbal is not set
# CONFIG_auto_generated_config_prefix_module-dart_launcher is not set
# CONFIG_auto_generated_config_prefix_module-engineer_chassis is not set
CONFIG_auto_generated_config_prefix_module-gimbal=y
CONFIG_MODULE_GIMBAL_TASK_STACK_DEPTH=512
# CONFIG_auto_generated_config_prefix_module-helm_chassis is not set
# CONFIG_auto_generated_config_prefix_module-launcher is not set
CONFIG_auto_generated_config_prefix_module-launcher_drone=y
# CONFIG_auto_generated_config_prefix_module-microswitch is not set
# CONFIG_auto_generated_config_prefix_module-ore_collect is not set
# CONFIG_auto_generated_config_prefix_module-performance is not set
# CONFIG_auto_generated_config_prefix_module-topic_share_uart is not set
# CONFIG_auto_generated_config_prefix_module-uart_update is not set
# CONFIG_auto_generated_config_prefix_module-wheel_leg is not set
# end of 模块
155 changes: 155 additions & 0 deletions hw/bsp/rm-c/config/helm_infantry.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
# CONFIG_auto_generated_config_prefix_board-c-mini is not set
# CONFIG_auto_generated_config_prefix_board-dual_canfd is not set
# CONFIG_auto_generated_config_prefix_board-esp32-c3-arduino is not set
# CONFIG_auto_generated_config_prefix_board-esp32-c3-idf is not set
# CONFIG_auto_generated_config_prefix_board-f103_can is not set
# CONFIG_auto_generated_config_prefix_board-mangopi_r818 is not set
# CONFIG_auto_generated_config_prefix_board-microswitch is not set
# CONFIG_auto_generated_config_prefix_board-MiniPC is not set
# CONFIG_auto_generated_config_prefix_board-MiniPC_with_canfd is not set
# CONFIG_auto_generated_config_prefix_board-node_imu is not set
CONFIG_auto_generated_config_prefix_board-rm-c=y
# CONFIG_auto_generated_config_prefix_board-Webots is not set
# CONFIG_auto_generated_config_prefix_system-Bootloader is not set
CONFIG_auto_generated_config_prefix_system-FreeRTOS=y
# CONFIG_auto_generated_config_prefix_system-Linux is not set
# CONFIG_auto_generated_config_prefix_system-Linux_Webots is not set
# CONFIG_auto_generated_config_prefix_system-None is not set

#
# FreeRTOS
#
CONFIG_INIT_TASK_STACK_DEPTH=2048
CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=512
CONFIG_FREERTOS_USB_TASK_STACK_DEPTH=256
CONFIG_FREERTOS_TERM_TASK_STACK_DEPTH=512
# end of FreeRTOS

# CONFIG_auto_generated_config_prefix_robot-balance_infantry is not set
# CONFIG_auto_generated_config_prefix_robot-ble_net_config is not set
# CONFIG_auto_generated_config_prefix_robot-blink is not set
# CONFIG_auto_generated_config_prefix_robot-bootloader is not set
# CONFIG_auto_generated_config_prefix_robot-canfd_to_uart is not set
# CONFIG_auto_generated_config_prefix_robot-can_to_uart is not set
# CONFIG_auto_generated_config_prefix_robot-custom_controller is not set
# CONFIG_auto_generated_config_prefix_robot-dart is not set
# CONFIG_auto_generated_config_prefix_robot-drone_gimbal is not set
# CONFIG_auto_generated_config_prefix_robot-engineer is not set
CONFIG_auto_generated_config_prefix_robot-helm_infantry=y
# CONFIG_auto_generated_config_prefix_robot-hero is not set
# CONFIG_auto_generated_config_prefix_robot-infantry is not set
# CONFIG_auto_generated_config_prefix_robot-microswitch is not set
# CONFIG_auto_generated_config_prefix_robot-sentry is not set
# CONFIG_auto_generated_config_prefix_robot-sim_balance is not set
# CONFIG_auto_generated_config_prefix_robot-sim_mecanum is not set
# CONFIG_auto_generated_config_prefix_robot-uart_net_config is not set
# CONFIG_auto_generated_config_prefix_robot-udp_to_uart is not set
# CONFIG_auto_generated_config_prefix_robot-wearlab_imu is not set

#
# 组件
#

#
# 设备
#
CONFIG_auto_generated_config_prefix_device-ahrs=y
CONFIG_DEVICE_AHRS_TASK_STACK_DEPTH=256
# CONFIG_auto_generated_config_prefix_device-ahrs-9 is not set
CONFIG_auto_generated_config_prefix_device-ai=y
CONFIG_DEVICE_AI_TASK_STACK_DEPTH=384

#
# 上位机
#
# CONFIG_HOST_CTRL_PRIORITY is not set
# end of 上位机

# CONFIG_auto_generated_config_prefix_device-blink_led is not set
CONFIG_auto_generated_config_prefix_device-bmi088=y
CONFIG_DEVICE_BMI088_TASK_STACK_DEPTH=256
# CONFIG_auto_generated_config_prefix_device-bq27220 is not set
# CONFIG_auto_generated_config_prefix_device-buzzer is not set
CONFIG_auto_generated_config_prefix_device-can=y
# CONFIG_auto_generated_config_prefix_device-canfd is not set
CONFIG_auto_generated_config_prefix_device-cap=y
CONFIG_DEVICE_CAP_TASK_STACK_DEPTH=256

#
# 超级电容
#
CONFIG_CAP_PERCENT_NO_LIM=80
CONFIG_CAP_PERCENT_WORK=30
CONFIG_CAP_MAX_LOAD=100
# end of 超级电容

# CONFIG_auto_generated_config_prefix_device-custom_controller is not set
CONFIG_auto_generated_config_prefix_device-dr16=y
CONFIG_DEVICE_DR16_TASK_STACK_DEPTH=384
# CONFIG_auto_generated_config_prefix_device-icm42688 is not set
CONFIG_auto_generated_config_prefix_device-imu=y
CONFIG_DEVICE_CAN_IMU_TASK_STACK_DEPTH=256
# CONFIG_auto_generated_config_prefix_device-ina226 is not set
# CONFIG_auto_generated_config_prefix_device-laser is not set
CONFIG_auto_generated_config_prefix_device-led_rgb=y
CONFIG_DEVICE_LED_RGB_TASK_STACK_DEPTH=128
# CONFIG_auto_generated_config_prefix_device-mech is not set
# CONFIG_auto_generated_config_prefix_device-microswitch is not set
# CONFIG_auto_generated_config_prefix_device-mmc5603 is not set
CONFIG_auto_generated_config_prefix_device-motor=y
# CONFIG_auto_generated_config_prefix_device-net_config is not set
CONFIG_auto_generated_config_prefix_device-referee=y
CONFIG_DEVICE_REF_TRANS_TASK_STACK_DEPTH=256
CONFIG_DEVICE_REF_RECV_TASK_STACK_DEPTH=256

#
# 裁判系统
#
# CONFIG_REF_VIRTUAL is not set
CONFIG_REF_LAUNCH_SPEED=30
CONFIG_REF_HEAT_LIMIT_17=100
CONFIG_REF_HEAT_LIMIT_42=100
CONFIG_REF_POWER_LIMIT=200
CONFIG_REF_POWER_BUFF=100
# end of 裁判系统

#
# 操作手UI
#
CONFIG_UI_DYNAMIC_CYCLE=20
CONFIG_UI_STATIC_CYCLE=1000
# end of 操作手UI

CONFIG_auto_generated_config_prefix_device-servo=y
# CONFIG_auto_generated_config_prefix_device-simulator is not set
# CONFIG_auto_generated_config_prefix_device-spl06_001 is not set
# CONFIG_auto_generated_config_prefix_device-tof is not set
# end of 设备

#
# 模块
#
# CONFIG_auto_generated_config_prefix_module-balance is not set
# CONFIG_auto_generated_config_prefix_module-ble_net_config is not set
# CONFIG_auto_generated_config_prefix_module-canfd_to_uart is not set
# CONFIG_auto_generated_config_prefix_module-can_imu is not set
# CONFIG_auto_generated_config_prefix_module-can_imu_wearlab is not set
# CONFIG_auto_generated_config_prefix_module-can_usart is not set
# CONFIG_auto_generated_config_prefix_module-chassis is not set
# CONFIG_auto_generated_config_prefix_module-custom_controller is not set
# CONFIG_auto_generated_config_prefix_module-dart_gimbal is not set
# CONFIG_auto_generated_config_prefix_module-dart_launcher is not set
# CONFIG_auto_generated_config_prefix_module-engineer_chassis is not set
CONFIG_auto_generated_config_prefix_module-gimbal=y
CONFIG_MODULE_GIMBAL_TASK_STACK_DEPTH=512
CONFIG_auto_generated_config_prefix_module-helm_chassis=y
CONFIG_MODULE_LAUNCHER_TASK_STACK_DEPTH=384
CONFIG_auto_generated_config_prefix_module-launcher=y
# CONFIG_auto_generated_config_prefix_module-launcher_drone is not set
# CONFIG_auto_generated_config_prefix_module-microswitch is not set
# CONFIG_auto_generated_config_prefix_module-ore_collect is not set
# CONFIG_auto_generated_config_prefix_module-performance is not set
# CONFIG_auto_generated_config_prefix_module-topic_share_uart is not set
# CONFIG_auto_generated_config_prefix_module-uart_update is not set
# CONFIG_auto_generated_config_prefix_module-wheel_leg is not set
# end of 模块
8 changes: 4 additions & 4 deletions hw/bsp/rm-c/drivers/hal/Core/Inc/stm32f4xx_hal_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
/* Section 2: PHY configuration section */

/* DP83848_PHY_ADDRESS Address*/
#define DP83848_PHY_ADDRESS 0x01U
#define DP83848_PHY_ADDRESS
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
#define PHY_RESET_DELAY 0x000000FFU
/* PHY Configuration delay */
Expand Down Expand Up @@ -252,10 +252,10 @@
#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */

/* Section 4: Extended PHY Registers */
#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */
#define PHY_SR ((uint16_t)) /*!< PHY status register Offset */

#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */
#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */
#define PHY_SPEED_STATUS ((uint16_t)) /*!< PHY Speed mask */
#define PHY_DUPLEX_STATUS ((uint16_t)) /*!< PHY Duplex mask */

/* ################## SPI peripheral configuration ########################## */

Expand Down
4 changes: 2 additions & 2 deletions hw/bsp/rm-c/drivers/hal/Core/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ void MX_CAN1_Init(void)
hcan1.Init.TimeTriggeredMode = DISABLE;
hcan1.Init.AutoBusOff = ENABLE;
hcan1.Init.AutoWakeUp = ENABLE;
hcan1.Init.AutoRetransmission = DISABLE;
hcan1.Init.AutoRetransmission = ENABLE;
hcan1.Init.ReceiveFifoLocked = DISABLE;
hcan1.Init.TransmitFifoPriority = DISABLE;
if (HAL_CAN_Init(&hcan1) != HAL_OK)
Expand Down Expand Up @@ -309,7 +309,7 @@ void MX_CAN2_Init(void)
hcan2.Init.TimeTriggeredMode = DISABLE;
hcan2.Init.AutoBusOff = ENABLE;
hcan2.Init.AutoWakeUp = ENABLE;
hcan2.Init.AutoRetransmission = DISABLE;
hcan2.Init.AutoRetransmission = ENABLE;
hcan2.Init.ReceiveFifoLocked = DISABLE;
hcan2.Init.TransmitFifoPriority = DISABLE;
if (HAL_CAN_Init(&hcan2) != HAL_OK)
Expand Down
1 change: 1 addition & 0 deletions hw/bsp/rm-c/drivers/hal/Core/Src/stm32f4xx_hal_msp.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

/* Includes ------------------------------------------------------------------*/
#include "main.h"

/* USER CODE BEGIN Includes */

/* USER CODE END Includes */
Expand Down
8 changes: 4 additions & 4 deletions hw/bsp/rm-c/drivers/hal/DevC.ioc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CAN1.CalculateBaudRate=1000000
CAN1.CalculateTimeBit=1000
CAN1.CalculateTimeQuantum=71.42857142857143
CAN1.IPParameters=CalculateTimeQuantum,BS1,BS2,Prescaler,TXFP,ABOM,CalculateTimeBit,CalculateBaudRate,NART,AWUM
CAN1.NART=DISABLE
CAN1.NART=ENABLE
CAN1.Prescaler=3
CAN1.TXFP=DISABLE
CAN2.ABOM=ENABLE
Expand All @@ -34,7 +34,7 @@ CAN2.CalculateBaudRate=1000000
CAN2.CalculateTimeBit=1000
CAN2.CalculateTimeQuantum=71.42857142857143
CAN2.IPParameters=CalculateTimeQuantum,BS1,BS2,Prescaler,TXFP,CalculateTimeBit,CalculateBaudRate,ABOM,AWUM,NART
CAN2.NART=DISABLE
CAN2.NART=ENABLE
CAN2.Prescaler=3
CAN2.TXFP=DISABLE
Dma.I2C2_TX.2.Direction=DMA_MEMORY_TO_PERIPH
Expand Down Expand Up @@ -246,8 +246,8 @@ Mcu.PinsNb=64
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32F407IGHx
MxCube.Version=6.8.1
MxDb.Version=DB.6.0.81
MxCube.Version=6.10.0
MxDb.Version=DB.6.0.100
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.CAN1_RX0_IRQn=true\:5\:0\:true\:false\:true\:true\:true\:true
NVIC.CAN1_RX1_IRQn=true\:5\:0\:true\:false\:true\:true\:true\:true
Expand Down
Loading

0 comments on commit cf1bd57

Please sign in to comment.