Skip to content

Commit 115bf6d

Browse files
committed
条件改善
1 parent 4db66bc commit 115bf6d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crane_robot_skills/src/attacker.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ Attacker::Attacker(RobotCommandWrapperBase::SharedPtr & base)
181181
world_model()->getLargestGoalAngleRangeFromPoint(world_model()->ball.pos);
182182
// ボールが近い条件はいらないかも?
183183
return robot()->getDistance(world_model()->ball.pos) < 2.0 &&
184-
goal_angle_width * 180.0 / M_PI > 5.;
184+
goal_angle_width * 180.0 / M_PI > 5. && not world_model()->ball.isMoving(1.0);
185185
});
186186

187187
addTransition(AttackerState::GOAL_KICK, AttackerState::ENTRY_POINT, [this]() -> bool {
@@ -304,7 +304,7 @@ Attacker::Attacker(RobotCommandWrapperBase::SharedPtr & base)
304304
world_model()->getLargestGoalAngleRangeFromPoint(world_model()->ball.pos);
305305
return robot()->getDistance(world_model()->ball.pos) < 1.0 &&
306306
x_diff_with_their_goal < world_model()->field_size.x() * 0.5 &&
307-
goal_angle_width * 180.0 / M_PI > 1.;
307+
goal_angle_width * 180.0 / M_PI > 1. && not world_model()->ball.isMoving(1.0);
308308
});
309309

310310
addTransition(AttackerState::LOW_CHANCE_GOAL_KICK, AttackerState::ENTRY_POINT, [this]() -> bool {
@@ -321,7 +321,7 @@ Attacker::Attacker(RobotCommandWrapperBase::SharedPtr & base)
321321
double x_diff_with_their_goal =
322322
std::abs(world_model()->getTheirGoalCenter().x() - world_model()->ball.pos.x());
323323
return robot()->getDistance(world_model()->ball.pos) < 1.0 &&
324-
x_diff_with_their_goal >= world_model()->field_size.x() * 0.5;
324+
x_diff_with_their_goal >= world_model()->field_size.x() * 0.5 && not world_model()->ball.isMoving(1.0);
325325
});
326326

327327
addTransition(
@@ -363,7 +363,7 @@ Attacker::Attacker(RobotCommandWrapperBase::SharedPtr & base)
363363

364364
addStateFunction(AttackerState::RECEIVE_BALL, [this]() -> Status {
365365
receive_skill.setParameter("enable_redirect", false);
366-
receive_skill.setParameter("policy", std::string("closest"));
366+
receive_skill.setParameter("policy", std::string("max_slack"));
367367
receive_skill.setParameter("dribble_power", 0.0);
368368
receive_skill.setParameter("enable_software_bumper", false);
369369
return receive_skill.run();

0 commit comments

Comments
 (0)