Skip to content
Open
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
110 changes: 78 additions & 32 deletions config/rm_controllers/drone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,54 +32,100 @@ controllers:

gimbal_controller:
type: rm_gimbal_controllers/Controller
yaw:
joint: "yaw_joint"
pid: { p: 5.1, i: 1.0, d: 0.27, i_clamp_max: 0.3, i_clamp_min: -0.3, antiwindup: true, publish_state: true }
pitch:
joint: "pitch_joint"
pid: { p: 22.0, i: 68.0, d: 0.6, i_clamp_max: -0.2, i_clamp_min: 0.2, antiwindup: true, publish_state: true }
controllers:
yaw:
joint: "yaw_joint"
pid: { p: 0.5, i: 15.0, d: 0.0, i_clamp_max: 0.2, i_clamp_min: -0.2, antiwindup: true, publish_state: true }
pid_pos: { p: 18, i: 0, d: 0.01, i_max: 0.0, i_min: 0.0, antiwindup: true, publish_state: true }
k_v: 1.0
accel: 28.0

pitch:
joint: "pitch_joint"
pid: { p: 0.5, i: 10, d: 0.0, i_clamp_max: 0.30, i_clamp_min: -0.3, antiwindup: true, publish_state: true }
pid_pos: { p: 25., i: 0, d: 0.0, i_max: 0.0, i_min: 0.0, antiwindup: true, publish_state: true }
k_v: 1.0
accel: 40.0
imu_name: "gimbal_imu"
feedforward:
gravity: 0.0
gravity: 5.0
enable_gravity_compensation: false
mass_origin: [ 0.0, 0.0, 0.0 ]
mass_origin: [ 0.055,-0.000093,-0.1416159 ]
bullet_solver:
resistance_coff_qd_10: 0.0
resistance_coff_qd_15: 0.0
resistance_coff_qd_16: 0.0
resistance_coff_qd_18: 0.0
resistance_coff_qd_30: 0.3
resistance_coff_qd_10: 0.001
resistance_coff_qd_15: 0.001
resistance_coff_qd_16: 0.001
resistance_coff_qd_18: 0.001
resistance_coff_qd_30: 0.001
g: 9.81
delay: 0.3
delay: 0.028
dt: 0.001
timeout: 0.001
publish_rate: 50
max_track_target_vel: 1.0
max_switch_angle: 50
min_switch_angle: 2
ban_shoot_duration: 0.032
gimbal_switch_duration: 0.076
max_track_target_vel: 10.
max_chassis_angular_vel: 12.0
track_rotate_target_delay: 0.075
track_move_target_delay: 0.0
wait_next_armor_delay: 0.02
wait_diagonal_armor_delay: 0.02
switch_angle_offset: 0.7
traject_ahead_: 1.45

shooter_controller:
type: rm_shooter_controllers/Controller
publish_rate: 50
friction_left:
left_friction_wheel:
joint: "left_friction_wheel_joint"
pid: { p: 0.001, i: 0.01, d: 0.0, i_clamp_max: 0.01, i_clamp_min: -0.01, antiwindup: true, publish_state: true }
friction_right:
right_friction_wheel:
joint: "right_friction_wheel_joint"
pid: { p: 0.001, i: 0.01, d: 0.0, i_clamp_max: 0.01, i_clamp_min: -0.01, antiwindup: true, publish_state: true }
friction:
friction_left:
left_friction_wheel:
joint: "left_friction_wheel_joint"
pid: { p: 0.0014, i: 0.01, d: 0.0, i_clamp_max: 0.01, i_clamp_min: -0.01, antiwindup: true, publish_state: true }
friction_right:
right_friction_wheel:
joint: "right_friction_wheel_joint"
pid: { p: 0.0014, i: 0.01, d: 0.0, i_clamp_max: 0.01, i_clamp_min: -0.01, antiwindup: true, publish_state: true }
# type: rm_dshot_shooter_controllers/Controller
# publish_rate: 50
# friction:
# friction_left:
# left_friction_wheel:
# joint: "left_friction_wheel_joint"
# pid: { p: 0.5, i: 1.5, d: 0.0, i_clamp_max: 40, i_clamp_min: -40, antiwindup: true, publish_state: true }
# friction_right:
# right_friction_wheel:
# joint: "right_friction_wheel_joint"
# pid: { p: 0.5, i: 1.5, d: 0.0, i_clamp_max: 40, i_clamp_min: -40, antiwindup: true, publish_state: true }
# friction_mid:
# mid_friction_wheel:
# joint: "mid_friction_wheel_joint"
# pid: { p: 0.5, i: 1.5, d: 0.0, i_clamp_max: 40, i_clamp_min: -40, antiwindup: true, publish_state: true }
trigger:
joint: "trigger_joint"
pid: { p: 66.0, i: 0.0, d: 2.8, i_clamp_max: 0.0, i_clamp_min: 0.0, antiwindup: true, publish_state: true }
pid: { p: 20, i: 0.0, d: 0.8, i_clamp_max: 0.0, i_clamp_min: 0.0, antiwindup: true, publish_state: true }
push_per_rotation: 9
push_qd_threshold: 0.90
block_effort: 1.00
block_speed: 0.1
# block_effort: 1.70
# block_speed: 0.05
# block_duration: 0.05
# block_overtime: 0.8
# anti_block_angle: 0.23
# anti_block_threshold: 0.05
# forward_push_threshold: 0.3
# exit_push_threshold: 0.3
# qd_15: 400.0
# qd_18: 700.0
# qd_30: 690.0
block_effort: 1.7
block_speed: 0.05
block_duration: 0.05
block_overtime: 0.5
anti_block_angle: 0.46
anti_block_threshold: 0.1
block_overtime: 0.8
anti_block_angle: 0.23
anti_block_threshold: 0.05
forward_push_threshold: 0.3
exit_push_threshold: 0.3
qd_15: 400.0
qd_18: 700.0
qd_30: 690.0
wheel_speed_drop_threshold: 13.0
wheel_speed_raise_threshold: 3.0
freq_threshold: 15.0
45 changes: 45 additions & 0 deletions config/rm_ecat_hw/device_configurations/drone.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
can_motors:
- can_id: 3
can_bus: 0
name: "left_friction_wheel_joint_motor"
type: "M3508"
need_calibration: false
- can_id: 2
can_bus: 1
name: "right_friction_wheel_joint_motor"
type: "M3508"
need_calibration: false
- can_id: 1
can_bus: 0
name: "trigger_joint_motor"
type: "M2006"
need_calibration: true
- can_id: 7
can_bus: 0
name: "pitch_joint_motor"
type: "M3508"
need_calibration: true
- can_id: 5
can_bus: 0
name: "yaw_joint_motor"
type: "GM6020"

# dshot_motors:
# - channel: 4
# name: "left_friction_wheel_joint_motor"
# type: "A2212KV980"
# need_change_direction: true
# - channel: 1
# name: "right_friction_wheel_joint_motor"
# type: "A2212KV980"
# need_change_direction: false
# - channel: 3
# name: "mid_friction_wheel_joint_motor"
# type: "A2212KV980"
# need_change_direction: false
can_imus:
- can_bus: 0
name: "gimbal_imu"
bias: [ 0.0005827, 0.000203466, -0.00362083 ]
dbus:
- name: "dbus"
9 changes: 9 additions & 0 deletions config/rm_ecat_hw/drone.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ethercat_master:
time_step: 0.001

ethercat_devices:
- type: Rm
name: RmSlave1
configuration_file: device_configurations/drone.yaml
ethercat_bus: enp89s0
ethercat_address: 1
81 changes: 48 additions & 33 deletions config/rm_manual/drone.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
rm_manual:
robot_type: "drone"
chassis_calibrate_motor: [ ]
gimbal_calibrate_motor: [ "pitch_joint_motor" ]
shooter_calibrate_motor: [ "trigger_joint_motor" ]
chassis_calibrate_motor: []
gimbal_calibrate_motor: ["pitch_joint_motor"]
shooter_calibrate_motor: ["trigger_joint_motor"]
chassis:
topic: "/cmd_chassis"
accel_x:
- [ 50.0,99.0 ]
- [50.0, 99.0]
accel_y:
- [ 50.0,99.0 ]
- [50.0, 99.0]
accel_z:
- [ 50.0,99.0 ]
- [50.0, 99.0]
safety_power: 50
capacitor_threshold: 0.2
charge_power: 20
Expand All @@ -22,20 +22,20 @@ rm_manual:
topic: "/cmd_vel"
power_limit_topic: "/cmd_chassis"
max_linear_x:
- [ 50.0,2.1 ]
- [ 80.0,2.8 ]
- [ 100.0,3.2 ]
- [ 220.0, 5.0 ]
- [50.0, 2.1]
- [80.0, 2.8]
- [100.0, 3.2]
- [220.0, 5.0]
max_linear_y:
- [ 50.0,2.1 ]
- [ 80.0,2.8 ]
- [ 100.0,3.2 ]
- [ 220.0,5.0 ]
- [50.0, 2.1]
- [80.0, 2.8]
- [100.0, 3.2]
- [220.0, 5.0]
max_angular_z:
- [ 50.0,10.5 ]
- [ 80.0,15.0 ]
- [ 100.0,18.0 ]
- [ 220.0,20.0 ]
- [50.0, 10.5]
- [80.0, 15.0]
- [100.0, 18.0]
- [220.0, 20.0]
gyro_move_reduction: 0.4
gyro_rotate_reduction: 0.4
gimbal:
Expand All @@ -53,28 +53,42 @@ rm_manual:
timeout: 0.05
shooter:
topic: "/controllers/shooter_controller/command"
track_armor_error_tolerance: 1
track_armor_error_tolerance: 0.07
track_buff_error_tolerance: 0.07
target_acceleration_tolerance: 99.
speed_10m_per_speed: 10.0
speed_15m_per_speed: 13.5
speed_16m_per_speed: 16.0
speed_18m_per_speed: 15.72
speed_30m_per_speed: 27.5
wheel_speed_15: 770.0
wheel_speed_18: 770.0
wheel_speed_30: 770.0
speed_10m_per_speed: 22.5
speed_15m_per_speed: 22.5
speed_16m_per_speed: 22.5
speed_18m_per_speed: 22.5
speed_30m_per_speed: 22.5
wheel_speed_15: 715
wheel_speed_18: 715
wheel_speed_30: 715
extra_wheel_speed_once: 5.0
heat_limit:
low_shoot_frequency: 20
high_shoot_frequency: 20
burst_shoot_frequency: 20
minimal_shoot_frequency: 20
safe_shoot_frequency: 20
low_shoot_frequency: 6
high_shoot_frequency: 6
burst_shoot_frequency: 6
minimal_shoot_frequency: 6
safe_shoot_frequency: 6
heat_coeff: 8.0
use_local_heat: true
local_heat_protect_threshold: 20
type: "ID1_17MM"
camera:
topic: "/camera_name"
camera_left_name: "hk_camera"
camera_right_name: "hk_camera"
# camera:
# topic: "/camera_name"
# camera_left_name: "camera_right"
# camera_right_name: "camera_left"
detection_switch:
fail_limit: 10
service_name: "/Processor/status_switch"
service_name: "/Processor_/status_change"
detection_switch_left:
fail_limit: 10
service_name: "/Processor_left/status_switch"

controllers_list:
state_controllers:
Expand All @@ -84,6 +98,7 @@ rm_manual:
- controllers/orientation_controller
- controllers/gimbal_controller
- controllers/shooter_controller

calibration_controllers:
- controllers/trigger_calibration_controller
- controllers/gimbal_calibration_controller
Expand Down
28 changes: 18 additions & 10 deletions config/rm_referee/drone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,37 @@ rm_referee:
send_ui_queue_delay: 0.05
add_ui_frequency: 5
add_ui_max_times: 10
dbus_topic: "/dbus_data"
dbus_topic: "/rm_ecat_hw/dbus"
interactive_data:
ui:
trigger_change:
- name: "gimbal"
config: { start_position: [ 400, 800 ], size: 15, width: 2, title: "gimbal: " }
config: { start_position: [ 400, 850 ], size: 15, width: 2, title: "gimbal: " }
- name: "shooter"
config: { start_position: [ 400, 750 ], size: 15, width: 2, title: "shooter: " }
config: { start_position: [ 400, 800 ], size: 15, width: 2, title: "shooter: " }
- name: "target"
config: { start_position: [ 400, 700 ], size: 15, width: 2, title: "target: " }
config: { start_position: [ 400, 750 ], size: 15, width: 2, title: "target: " }
- name: "camera"
config: { start_position: [ 400, 700 ], size: 15, width: 2, title: "camera: " }
- name: "target_view_angle"
config: { type: "rectangle", start_position: [ 862, 476 ], end_position: [ 1012, 597 ], width: 3 }
config: { type: "rectangle", start_position: [ 840, 440 ], end_position: [ 1060, 620 ], width: 3 }
own_camera_name: "camera_left"
- name: "far_target_view_angle"
config: { type: "rectangle", start_position: [ 840, 440 ], end_position: [ 1050, 620], width: 3 }
own_camera_name: "camera_right"
time_change:
- name: "drone_towards"
config: { type: "line", width: 10 ,color: "pink", delay: 0.2 }
data: { ori_x: 1500, ori_y: 800 }
- name: "target_distance"
config: { type: "float_num", start_position: [ 190, 650 ], size: 25, width: 3 ,color: "yellow", delay: 0.2 }

config: { type: "float_num", start_position: [ 850, 750 ], size: 25, width: 3 ,color: "yellow", delay: 0.2 }
- name: "target_hp"
config: { type: "int_num", start_position: [ 850, 700 ], width: 3, size: 25, color: "yellow", delay: 0.3 }
enemy_id: [ 1, 2, 3, 4, 5, 7 ]
flash:
- name: "exceed_bullet_speed"
config: { start_position: [ 850, 850 ], size: 20, width: 2,
color: "yellow", content: "Exceed Speed!!", delay: 1.0 }
- name: "rune_remind"
config: { start_position: [ 880, 700 ], size: 35, width: 3,
color: "purple", content: "REMIND", delay: 0.5 }
fixed:
- name: "9m"
config: { type: "line", width: 3, color: "yellow",
Expand Down