Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 42
refactor(hardware)!: Migrate Hardware Stack to librmcs v3#54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff 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 | ||
coderabbitai[bot] marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| 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 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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)" | ||
coderabbitai[bot] marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| yaw_motor_zero_point: 32285 | ||
| pitch_motor_zero_point: 6321 | ||
| left_front_zero_point: 7848 | ||
| @@ -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 | ||
| Original file line number | Diff line number | Diff 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) | ||
qzhhhi marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| 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) | ||
coderabbitai[bot] marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| 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) | ||
qzhhhi marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| 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() | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.