Skip to content
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

米子練習会の変更の差分監視 #535

Draft
wants to merge 68 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 63 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
9dccfa8
RealSenderのデバッグ出力をOFF
HansRobo Aug 13, 2024
a071711
セットプレイの姑息なプレイを一旦OFF
HansRobo Aug 13, 2024
099e94a
AttackerStateをデバッグ出力
HansRobo Aug 13, 2024
3fc36a6
位置モードのときはstopHereで停止モードを使わない
HansRobo Aug 13, 2024
7bbbad6
BallPlacementのときのオフセットを大きくする
HansRobo Aug 13, 2024
36e3dfa
Teleopスキルの角度調整方法を変更
HansRobo Aug 13, 2024
ad4bd0b
SubAttackerがボールの後ろに回り込んでしまうのを修正
HansRobo Aug 13, 2024
4ceafc5
フリーキックはAttackerを使って実装
HansRobo Aug 13, 2024
a847142
SimSenderのダブリ実装を削除
HansRobo Aug 13, 2024
0fbd483
うるさい「send!!!!!!」を削除
HansRobo Aug 13, 2024
6ab397d
SimSenderのParameterWithEventクラスをファイル分割
HansRobo Aug 13, 2024
5476451
フォーマット
HansRobo Aug 13, 2024
b76513b
実機向け全速度制御のSenderを追加
HansRobo Aug 13, 2024
b70e2e9
Attackerの最終防壁としてGO_TO_BALL状態を追加
HansRobo Aug 13, 2024
24b12d3
MarkerPlannerで相手ロボットの数が少ない場合に例外を吐くバグを修正
HansRobo Aug 13, 2024
5eebcdc
マルチキャスト関連のメモ
HansRobo Aug 13, 2024
5e54003
AttackerスキルのENTRY_POINTの不要な処理を削除
HansRobo Aug 13, 2024
ec1d20c
空のロボット列を与えられると例外を出す処理の対策
HansRobo Aug 13, 2024
6342db9
ボールプレイスメント微調整
HansRobo Aug 13, 2024
a541bb2
ペナルティーエリアのマージン
HansRobo Aug 13, 2024
f83db5b
stopHereで角度も固定
HansRobo Aug 13, 2024
03301b4
ibis senderのキックパワー制限が機能していなかったバグを修正
HansRobo Aug 14, 2024
95c00d5
デフェンスのロボット間隔を広げる
HansRobo Aug 14, 2024
1ca42b0
セットプレイのキック先を調整
HansRobo Aug 14, 2024
ce92aff
空のロボット列を与えられると例外を出す処理の対策
HansRobo Aug 14, 2024
5aefc37
目標位置の修正
HansRobo Aug 14, 2024
eca8eaa
IbisSenderの修正
HansRobo Aug 14, 2024
8a7bf9c
エラーのコメントアウト
HansRobo Aug 14, 2024
89d7edd
Kickスキルで無駄なドリブルをやめる
HansRobo Aug 14, 2024
5e58f7d
プレイスメントの速度アップ
HansRobo Aug 14, 2024
577e242
StealBallの圧を強める
HansRobo Aug 14, 2024
89021b6
STOPにSubAttackerを追加
HansRobo Aug 14, 2024
3340cea
ボール所持判定の調整
HansRobo Aug 14, 2024
c4dd5c5
Rootsさん追加
HansRobo Aug 14, 2024
14cc831
調整
HansRobo Aug 14, 2024
9fba442
RobotCommandWrapperSimpleVelocityにsetTargetPositionを実装
HansRobo Aug 14, 2024
bfc1d5d
フォーマット
HansRobo Aug 14, 2024
29cab48
Skillのデフォルトで表示するコンテクストを増やした
HansRobo Aug 14, 2024
d8fdcef
StealBallVelスキルを実装
HansRobo Aug 14, 2024
3bf0347
RobotCommandWrapperSimpleVelocityの整理
HansRobo Aug 14, 2024
6e6cf2c
フォーマット
HansRobo Aug 14, 2024
473554d
KickVelスキル追加
HansRobo Aug 14, 2024
ff3dcb8
ボールマップを縮小
HansRobo Aug 14, 2024
b37f023
Attacker内部で使うStealBallを交換
HansRobo Aug 14, 2024
c19dbd8
Attacker調整
HansRobo Aug 14, 2024
0be5f60
フォーマット
HansRobo Aug 14, 2024
e9e081f
Attacker調整
HansRobo Aug 14, 2024
ee6bcac
初回起動時にsenderが落ちるのを対策
HansRobo Aug 15, 2024
d122096
StealBallVelスキル用のPlanner
HansRobo Aug 15, 2024
22bbe92
StealBallVelスキル用のsession
HansRobo Aug 15, 2024
562319d
GoalKickのチャタリング対策
HansRobo Aug 15, 2024
df7806f
よくわからんけどキックしないのでキックをONにしまくったやつ(結局うまく行かなかった)
HansRobo Aug 15, 2024
059546e
StealBallVelスキル用のPlannerの登録
HansRobo Aug 15, 2024
f904aff
ダイアグラムの修正
HansRobo Aug 16, 2024
9f7338a
議事録の追加
HansRobo Aug 16, 2024
39ba347
Merge branch 'develop' into 0813
HansRobo Aug 18, 2024
be1b4e0
style(pre-commit): autofix
pre-commit-ci[bot] Aug 18, 2024
62cd366
ログのリセット
HansRobo Aug 17, 2024
423face
Merge branch 'develop' into 0813
HansRobo Aug 18, 2024
0d5d923
Revert "よくわからんけどキックしないのでキックをONにしまくったやつ(結局うまく行かなかった)"
HansRobo Aug 18, 2024
24a36ea
Merge branch 'develop' into 0813
HansRobo Aug 31, 2024
9ab4c84
Merge branch 'develop' into 0813
HansRobo Oct 3, 2024
395aad9
Merge branch 'develop' into 0813
HansRobo Oct 3, 2024
f43bc73
Update crane_local_planner/src/gridmap_planner.cpp
HansRobo Oct 26, 2024
d3f3306
Merge branch 'develop' into 0813
HansRobo Dec 1, 2024
457dff7
style(pre-commit): autofix
pre-commit-ci[bot] Dec 1, 2024
cf74242
Discard changes to docker/config/state-store.json.stream
HansRobo Dec 15, 2024
5202d20
Merge branch 'develop' into 0813
HansRobo Dec 15, 2024
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
2 changes: 1 addition & 1 deletion crane_local_planner/src/gridmap_planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ crane_msgs::msg::RobotCommands GridMapPlanner::calculateRobotCommand(

if (nearest_robot) {
Velocity relative_velocity = (robot->vel.linear - nearest_robot->vel.linear);
// 2m以内のロボットに対してx,y ともに近づいていて
// 2m以内のロボットに対してx,y ともに近づいていて
// 速度が1.0m以上の場合、速度を1.0にする
if (
nearest_robot_distance < 2.0 && relative_velocity.x() > 0.0 &&
Expand Down
1 change: 1 addition & 0 deletions crane_robot_skills/include/crane_robot_skills/attacker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ enum class AttackerState {
LOW_CHANCE_GOAL_KICK,
MOVE_BALL_TO_OPPONENT_HALF,
RECEIVE_BALL,
GO_TO_BALL,
THROUGH,
STOP,
};
Expand Down
46 changes: 37 additions & 9 deletions crane_robot_skills/src/attacker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,18 @@ Attacker::Attacker(RobotCommandWrapperBase::SharedPtr & base)
break;
}
case 1: {
// パス
kick_skill.setParameter("target", receiver->pose.pos);
// 敵陣側に味方ロボットがいればパス
if (
(receiver->pose.pos - world_model()->getOurGoalCenter()).norm() >
(world_model()->ball.pos - world_model()->getOurGoalCenter()).norm()) {
kick_skill.setParameter("target", receiver->pose.pos);
} else {
kick_skill.setParameter("target", world_model()->getTheirGoalCenter());
}

kick_skill.setParameter("dot_threshold", 0.95);
kick_skill.setParameter("kick_power", 0.8);
kick_skill.setParameter("kick_power", 0.5);
kick_skill.setParameter("around_interval", 0.3);
Segment kick_line{world_model()->ball.pos, receiver->pose.pos};
// 近くに敵ロボットがいればチップキック
if (const auto enemy_robots = world_model()->theirs.getAvailableRobots();
Expand All @@ -74,6 +82,8 @@ Attacker::Attacker(RobotCommandWrapperBase::SharedPtr & base)
world_model()->getNearestRobotWithDistanceFromSegment(kick_line, enemy_robots);
if (enemy_distance < 0.4 && nearest_enemy->getDistance(world_model()->ball.pos) < 2.0) {
kick_skill.setParameter("kick_with_chip", true);
} else {
kick_skill.setParameter("kick_with_chip", false);
}
}
kick_skill.run(visualizer);
Expand Down Expand Up @@ -189,7 +199,7 @@ Attacker::Attacker(RobotCommandWrapperBase::SharedPtr & base)

addTransition(AttackerState::GOAL_KICK, AttackerState::ENTRY_POINT, [this]() -> bool {
// ボールが早い
return world_model()->ball.isMoving(1.0);
return world_model()->ball.isMoving(3.0);
});

addStateFunction(
Expand Down Expand Up @@ -325,7 +335,8 @@ Attacker::Attacker(RobotCommandWrapperBase::SharedPtr & base)
}
}
kick_skill.setParameter("kick_power", 0.5);
kick_skill.setParameter("dot_threshold", 0.97);
kick_skill.setParameter("dot_threshold", 0.95);
kick_skill.setParameter("around_interval", 0.2);
return kick_skill.run(visualizer);
});

Expand Down Expand Up @@ -371,15 +382,14 @@ Attacker::Attacker(RobotCommandWrapperBase::SharedPtr & base)
[this]([[maybe_unused]] const ConsaiVisualizerWrapper::SharedPtr & visualizer) -> Status {
kick_skill.setParameter("target", world_model()->getTheirGoalCenter());
kick_skill.setParameter("kick_power", 0.8);
kick_skill.setParameter("dot_threshold", 0.95);
kick_skill.setParameter("dot_threshold", 0.9);
kick_skill.setParameter("kick_with_chip", true);
return kick_skill.run(visualizer);
});

addTransition(AttackerState::ENTRY_POINT, AttackerState::RECEIVE_BALL, [this]() -> bool {
// TODO(HansRobo): もうちょっと条件を考える
// 当てはまらないときは受け取りに行く
return true;
return world_model()->ball.isMoving(0.2) &&
world_model()->ball.isMovingTowards(robot()->pose.pos);
});

addTransition(AttackerState::RECEIVE_BALL, AttackerState::ENTRY_POINT, [this]() -> bool {
Expand Down Expand Up @@ -407,6 +417,24 @@ Attacker::Attacker(RobotCommandWrapperBase::SharedPtr & base)
using std::chrono_literals::operator""s;
return robot()->ball_contact.getContactDuration() > 0.2s;
});

addTransition(AttackerState::ENTRY_POINT, AttackerState::GO_TO_BALL, [this]() -> bool {
// 最終防壁
return true;
});

addTransition(AttackerState::GO_TO_BALL, AttackerState::ENTRY_POINT, [this]() -> bool {
// 最終防壁なので毎回戻す
return true;
});

addStateFunction(
AttackerState::GO_TO_BALL,
[this]([[maybe_unused]] const ConsaiVisualizerWrapper::SharedPtr & visualizer) -> Status {
// ボールに向かって移動
command.setTargetPosition(world_model()->ball.pos);
return Status::RUNNING;
});
}

std::shared_ptr<RobotInfo> Attacker::selectPassReceiver()
Expand Down
11 changes: 6 additions & 5 deletions crane_robot_skills/src/steal_ball.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,19 @@ StealBall::StealBall(RobotCommandWrapperBase::SharedPtr & base)
auto their_frontier = world_model()->getNearestRobotWithDistanceFromPoint(
world_model()->ball.pos, world_model()->theirs.getAvailableRobots());
if (method == "front") {
command.setDribblerTargetPosition(
command.setTargetPosition(
world_model()->ball.pos, getAngle(world_model()->ball.pos - robot()->pose.pos));
command.dribble(0.5);
} else if (method == "side") {
command.setTargetPosition(
world_model()->ball.pos, getAngle(world_model()->ball.pos - robot()->pose.pos));
command.setTargetTheta(getAngle(world_model()->ball.pos - robot()->pose.pos));
if (robot()->getDistance(world_model()->ball.pos) < (0.085 - 0.030)) {
if (robot()->getDistance(world_model()->ball.pos) < (0.085 - 0.040)) {
command.setDribblerTargetPosition(
world_model()->ball.pos +
getVerticalVec(world_model()->ball.pos - robot()->pose.pos) * 0.3);
getVerticalVec(world_model()->ball.pos - robot()->pose.pos) * 0.7);
// ロボット半径より近くに来れば急回転して刈り取れる
// command.setTargetTheta(
// getAngle(world_model()->ball.pos - robot()->pose.pos) + M_PI / 2);
command.setTargetTheta(getAngle(world_model()->ball.pos - robot()->pose.pos) + M_PI / 2);
} else {
command.setDribblerTargetPosition(world_model()->ball.pos);
}
Expand Down
Loading