48 .block_speed =
getParam(controller_nh,
"block_speed", 0.),
49 .block_duration =
getParam(controller_nh,
"block_duration", 0.),
50 .block_overtime =
getParam(controller_nh,
"block_overtime", 0.),
51 .anti_block_angle =
getParam(controller_nh,
"anti_block_angle", 0.),
52 .anti_block_threshold =
getParam(controller_nh,
"anti_block_threshold", 0.),
53 .forward_push_threshold =
getParam(controller_nh,
"forward_push_threshold", 0.1),
54 .exit_push_threshold =
getParam(controller_nh,
"exit_push_threshold", 0.1),
55 .extra_wheel_speed =
getParam(controller_nh,
"extra_wheel_speed", 0.),
56 .wheel_speed_drop_threshold =
getParam(controller_nh,
"wheel_speed_drop_threshold", 10.),
57 .wheel_speed_raise_threshold =
getParam(controller_nh,
"wheel_speed_raise_threshold", 3.1) };
69 controller_nh,
"/local_heat_state/shooter_state", 10));
72 d_srv_ =
new dynamic_reconfigure::Server<rm_shooter_controllers::ShooterConfig>(controller_nh);
73 dynamic_reconfigure::Server<rm_shooter_controllers::ShooterConfig>::CallbackType cb = [
this](
auto&& PH1,
auto&& PH2) {
74 reconfigCB(std::forward<decltype(PH1)>(PH1), std::forward<decltype(PH2)>(PH2));
79 double wheel_speed_offset;
80 double wheel_speed_direction;
82 controller_nh.
getParam(
"friction", friction);
83 for (
const auto& its : friction)
85 std::vector<double> wheel_speed_offset_temp;
86 std::vector<double> wheel_speed_direction_temp;
87 std::vector<effort_controllers::JointVelocityController*> ctrl_frictions;
88 for (
const auto& it : its.second)
91 wheel_speed_offset_temp.push_back(nh.
getParam(
"wheel_speed_offset", wheel_speed_offset) ? wheel_speed_offset : 0.);
92 wheel_speed_direction_temp.push_back(
93 nh.
getParam(
"wheel_speed_direction", wheel_speed_direction) ? wheel_speed_direction : 1.);
96 ctrl_frictions.push_back(ctrl_friction);
160 for (
auto& ctrl_friction : ctrl_frictions)
162 ctrl_friction->update(time, period);
176 for (
auto& ctrl_friction : ctrl_frictions)
178 ctrl_friction->setCommand(0.);
203 bool wheel_speed_ready =
true;
211 wheel_speed_ready =
false;
252 ROS_DEBUG(
"[Shooter] Wait for friction wheel");
260 ROS_INFO(
"[Shooter] Trigger Enter BLOCK");
271 ROS_INFO(
"[Shooter] Trigger Exit BLOCK");
292 ROS_INFO(
"[Shooter] Frictions Exit BLOCK");
383 ROS_INFO(
"[Shooter] Dynamic params change");
387 config.block_effort = init_config.block_effort;
388 config.block_speed = init_config.block_speed;
389 config.block_duration = init_config.block_duration;
390 config.block_overtime = init_config.block_overtime;
391 config.anti_block_angle = init_config.anti_block_angle;
392 config.anti_block_threshold = init_config.anti_block_threshold;
393 config.forward_push_threshold = init_config.forward_push_threshold;
394 config.exit_push_threshold = init_config.exit_push_threshold;
395 config.extra_wheel_speed = init_config.extra_wheel_speed;
396 config.wheel_speed_drop_threshold = init_config.wheel_speed_drop_threshold;
397 config.wheel_speed_raise_threshold = init_config.wheel_speed_raise_threshold;
400 Config config_non_rt{ .block_effort = config.block_effort,
401 .block_speed = config.block_speed,
402 .block_duration = config.block_duration,
403 .block_overtime = config.block_overtime,
404 .anti_block_angle = config.anti_block_angle,
405 .anti_block_threshold = config.anti_block_threshold,
406 .forward_push_threshold = config.forward_push_threshold,
407 .exit_push_threshold = config.exit_push_threshold,
408 .extra_wheel_speed = config.extra_wheel_speed,
409 .wheel_speed_drop_threshold = config.wheel_speed_drop_threshold,
410 .wheel_speed_raise_threshold = config.wheel_speed_raise_threshold };