Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitmodules
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
[submodule "rmcs_ws/src/rmcs_core/librmcs"]
path = rmcs_ws/src/rmcs_core/librmcs
url = https://github.com/Alliance-Algorithm/librmcs.git
[submodule "rmcs_ws/src/fast_tf"]
path = rmcs_ws/src/fast_tf
url = https://github.com/qzhhhi/FastTF.git
Expand Down
47 changes: 3 additions & 44 deletions rmcs_ws/src/rmcs_bringup/config/mecanum-hero.yaml
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ rmcs_executor:
ros__parameters:
update_rate: 1000.0
components:
- rmcs_core::hardware::Hero -> hero_hardware
- rmcs_core::hardware::MecanumHero -> hero_hardware

- rmcs_core::referee::Status -> referee_status
- rmcs_core::referee::Command -> referee_command
Expand All@@ -27,13 +27,10 @@ rmcs_executor:
- rmcs_core::controller::chassis::ChassisPowerController -> chassis_power_controller
- rmcs_core::controller::chassis::OmniWheelController -> omni_wheel_controller

# - rmcs_auto_aim::AutoAimInitializer -> auto_aim_initializer
# - rmcs_auto_aim::AutoAimController -> auto_aim_controller

hero_hardware:
ros__parameters:
usb_pid_top_board: 0xeb37
usb_pid_bottom_board: 0xc1d3
board_serial_top_board: "(TODO)"
board_serial_bottom_board: "(TODO)"
yaw_motor_zero_point: 61054
pitch_motor_zero_point: 54062
external_imu_port: /dev/ttyUSB0
Comment thread
qzhhhi marked this conversation as resolved.
Expand DownExpand Up@@ -162,41 +159,3 @@ right_front_wheel_velocity_pid_controller:
kp: 0.185
ki: 0.00
kd: 0.00

auto_aim_controller:
ros__parameters:
# capture
use_video: false # If true, use video stream instead of camera.
video_path: "/workspaces/RMCS/rmcs_ws/resources/1.avi"
exposure_time: 3
invert_image: false
# identifier
armor_model_path: "/models/mlp.onnx"
# pnp
fx: 1.722231837421459e+03
fy: 1.724876404292754e+03
cx: 7.013056440882832e+02
cy: 5.645821718351237e+02
k1: -0.064232403853946
k2: -0.087667493884102
k3: 0.792381808294582
# tracker
armor_predict_duration: 500
# controller
gimbal_predict_duration: 100
yaw_error: 0.02
pitch_error: 0.06
shoot_velocity: 28.0
predict_sec: 0.095
# etc
buff_predict_duration: 200
buff_model_path: "/models/buff_nocolor_v6.onnx"
omni_exposure: 1000.0
record_fps: 120
debug: false # Setup in actual using.Debug mode is used when referee is not ready
debug_color: 0 # 0 For blue while 1 for red. mine
debug_robot_id: 4
debug_buff_mode: false
record: false
raw_img_pub: false # Set false in actual use
image_viewer_type: 0
119 changes: 119 additions & 0 deletions rmcs_ws/src/rmcs_bringup/config/omni-infantry.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
rmcs_executor:
ros__parameters:
update_rate: 1000.0
components:
- rmcs_core::hardware::OmniInfantry -> infantry_hardware

- rmcs_core::referee::Status -> referee_status
- rmcs_core::referee::Command -> referee_command

- rmcs_core::referee::command::Interaction -> referee_interaction
- rmcs_core::referee::command::interaction::Ui -> referee_ui
- rmcs_core::referee::app::ui::Infantry -> referee_ui_infantry

- rmcs_core::controller::gimbal::SimpleGimbalController -> gimbal_controller
- rmcs_core::controller::pid::ErrorPidController -> yaw_angle_pid_controller
- rmcs_core::controller::pid::PidController -> yaw_velocity_pid_controller
- rmcs_core::controller::pid::ErrorPidController -> pitch_angle_pid_controller

- rmcs_core::controller::shooting::FrictionWheelController -> friction_wheel_controller
- rmcs_core::controller::shooting::HeatController -> heat_controller
- rmcs_core::controller::shooting::BulletFeederController17mm -> bullet_feeder_controller
- rmcs_core::controller::pid::PidController -> left_friction_velocity_pid_controller
- rmcs_core::controller::pid::PidController -> right_friction_velocity_pid_controller
- rmcs_core::controller::pid::PidController -> bullet_feeder_velocity_pid_controller

- rmcs_core::controller::chassis::ChassisController -> chassis_controller
- rmcs_core::controller::chassis::ChassisPowerController -> chassis_power_controller
- rmcs_core::controller::chassis::OmniWheelController -> omni_wheel_controller

Comment thread
coderabbitai[bot] marked this conversation as resolved.
infantry_hardware:
ros__parameters:
board_serial: ""
yaw_motor_zero_point: 40186
pitch_motor_zero_point: 53650

gimbal_controller:
ros__parameters:
upper_limit: -0.5098
lower_limit: 0.2262

yaw_angle_pid_controller:
ros__parameters:
output_max: 10.0
output_min: -10.0
measurement: /gimbal/yaw/control_angle_error
control: /gimbal/yaw/control_velocity
kp: 15.0
ki: 0.0
kd: 0.0

yaw_velocity_pid_controller:
ros__parameters:
measurement: /gimbal/yaw/velocity_imu
setpoint: /gimbal/yaw/control_velocity
control: /gimbal/yaw/control_torque
kp: 40.0
ki: 0.001
kd: 0.01

pitch_angle_pid_controller:
ros__parameters:
measurement: /gimbal/pitch/control_angle_error
control: /gimbal/pitch/control_velocity
kp: 20.0
ki: 0.0
kd: 0.1

friction_wheel_controller:
ros__parameters:
friction_wheels:
- /gimbal/left_friction
- /gimbal/right_friction
friction_velocities:
- 660.0
- 660.0
friction_soft_start_stop_time: 1.0

heat_controller:
ros__parameters:
heat_per_shot: 10000
reserved_heat: 10000

bullet_feeder_controller:
ros__parameters:
bullets_per_feeder_turn: 8.0
shot_frequency: 20.0
safe_shot_frequency: 10.0
eject_frequency: 10.0
eject_time: 0.05
deep_eject_frequency: 5.0
deep_eject_time: 0.20
single_shot_max_stop_delay: 2.0

left_friction_velocity_pid_controller:
ros__parameters:
measurement: /gimbal/left_friction/velocity
setpoint: /gimbal/left_friction/control_velocity
control: /gimbal/left_friction/control_torque
kp: 0.003436926
ki: 0.0
kd: 0.009373434

right_friction_velocity_pid_controller:
ros__parameters:
measurement: /gimbal/right_friction/velocity
setpoint: /gimbal/right_friction/control_velocity
control: /gimbal/right_friction/control_torque
kp: 0.003436926
ki: 0.0
kd: 0.009373434

bullet_feeder_velocity_pid_controller:
ros__parameters:
measurement: /gimbal/bullet_feeder/velocity
setpoint: /gimbal/bullet_feeder/control_velocity
control: /gimbal/bullet_feeder/control_torque
kp: 1.583
ki: 0.0
kd: 0.0
45 changes: 2 additions & 43 deletions rmcs_ws/src/rmcs_bringup/config/steering-infantry.yaml
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,13 +26,10 @@ rmcs_executor:
- rmcs_core::controller::chassis::ChassisPowerController -> chassis_power_controller
- rmcs_core::controller::chassis::SteeringWheelController -> steering_wheel_controller

# - rmcs_auto_aim::AutoAimInitializer -> auto_aim_initializer
# - rmcs_auto_aim::AutoAimController -> auto_aim_controller

steeringInfantry_hardware:
ros__parameters:
usb_pid_top_board: 0x93ac
usb_pid_bottom_board: 0x488d
board_serial_top_board: "(TODO)"
board_serial_bottom_board: "(TODO)"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
yaw_motor_zero_point: 32285
pitch_motor_zero_point: 6321
left_front_zero_point: 7848
Expand DownExpand Up@@ -129,41 +126,3 @@ steering_wheel_controller:
k1: 2.958580e+00
k2: 3.082190e-03
no_load_power: 11.37

auto_aim_controller:
ros__parameters:
# capture
use_video: false # If true, use video stream instead of camera.
video_path: "/workspaces/RMCS/rmcs_ws/resources/1.avi"
exposure_time: 3
invert_image: false
# identifier
armor_model_path: "/models/mlp.onnx"
# pnp
fx: 1.722231837421459e+03
fy: 1.724876404292754e+03
cx: 7.013056440882832e+02
cy: 5.645821718351237e+02
k1: -0.064232403853946
k2: -0.087667493884102
k3: 0.792381808294582
# tracker
armor_predict_duration: 500
# controller
gimbal_predict_duration: 100
yaw_error: -0.02
pitch_error: 0.01
shoot_velocity: 21.0
predict_sec: 0.050
# etc
buff_predict_duration: 200
buff_model_path: "/models/buff_nocolor_v6.onnx"
omni_exposure: 1000.0
record_fps: 120
debug: false # Setup in actual using.Debug mode is used when referee is not ready
debug_color: 0 # 0 For blue while 1 for red. mine
debug_robot_id: 4
debug_buff_mode: false
record: true
raw_img_pub: false # Set false in actual use
image_viewer_type: 0
30 changes: 18 additions & 12 deletions rmcs_ws/src/rmcs_core/CMakeLists.txt
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,42 @@
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.24)
project(rmcs_core)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20")
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Comment thread
qzhhhi marked this conversation as resolved.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-packed-bitfield-compat")

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-O2 -Wall -Wextra -Wpedantic)
endif()

find_package (ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies ()
find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()
include(FetchContent)
set(BUILD_STATIC_LIBRMCS ON CACHE BOOL "Build static librmcs SDK" FORCE)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
FetchContent_Declare(
librmcs
URL https://github.com/Alliance-Algorithm/librmcs/releases/download/v3.0.0/librmcs-sdk-src-3.0.0.zip
URL_HASH SHA256=b39f51c21baacdcbf3f0176119b8850137a108b88a67e12395d37d89e5ef53e8
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
)
FetchContent_MakeAvailable(librmcs)
Comment thread
qzhhhi marked this conversation as resolved.

file(GLOB_RECURSE PROJECT_SOURCE CONFIGURE_DEPENDS
file(GLOB_RECURSE PROJECT_SOURCE CONFIGURE_DEPENDS
${PROJECT_SOURCE_DIR}/src/*.cpp
${PROJECT_SOURCE_DIR}/src/*.c
)

ament_auto_add_library(
ament_auto_add_library(
${PROJECT_NAME} SHARED
${PROJECT_SOURCE}
)

include_directories(${PROJECT_SOURCE_DIR}/include)
include_directories(${PROJECT_SOURCE_DIR}/src)
include_directories(${PROJECT_SOURCE_DIR}/librmcs)

include_directories(SYSTEM "/usr/include/libusb-1.0")

target_link_libraries(${PROJECT_NAME} -lusb-1.0)
target_link_libraries(${PROJECT_NAME} PRIVATE librmcs-sdk)

pluginlib_export_plugin_description_file(rmcs_executor plugins.xml)

ament_auto_package()
ament_auto_package()
1 change: 0 additions & 1 deletion rmcs_ws/src/rmcs_core/librmcs
Submodule librmcs deleted from b82f2e
Loading