Skip to content
Closed
6 changes: 3 additions & 3 deletions crane_bringup/launch/crane.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ limitations under the License.
<!-- sim=falseの場合(公式ポート) -->
<let name="vision_port_final" value="10006" if="$(eval &quot;'$(var vision_port)' == '' and '$(var sim)' == 'false'&quot;)"/>
<let name="referee_port_final" value="10003" if="$(eval &quot;'$(var referee_port)' == '' and '$(var sim)' == 'false'&quot;)"/>
<let name="tracker_port_final" value="10010" if="$(eval &quot;'$(var tracker_port)' == '' and '$(var sim)' == 'false'&quot;)"/>
<let name="tracker_port_final" value="11010" if="$(eval &quot;'$(var tracker_port)' == '' and '$(var sim)' == 'false'&quot;)"/>

<!-- ユーザー指定がある場合はそれを使用 -->
<let name="vision_port_final" value="$(var vision_port)" unless="$(eval &quot;'$(var vision_port)' == ''&quot;)"/>
Expand All @@ -60,7 +60,7 @@ limitations under the License.
<!-- ============================================================ -->
<!-- ロボット性能パラメータ -->
<!-- ============================================================ -->
<arg name="max_vel" default="8.0" description="ロボットの最大速度 [m/s]"/>
<arg name="max_vel" default="4.0" description="ロボットの最大速度 [m/s]"/>

<!-- Slack時間計算パラメータ -->
<arg name="slack.robot_max_acceleration" default="2.5" description="slack時間計算に用いるロボットの最大加速度 [m/s^2]"/>
Expand All @@ -81,7 +81,7 @@ limitations under the License.
<arg name="robot_acceleration.velocity_threshold" default="1.0" description="高速域・低速域のしきい値 [m/s]"/>

<!-- 経路計画用の減速度パラメータ(実行側の90%以下に設定して計画と実行の不一致によるオーバーシュートを防止) -->
<arg name="planning_deceleration" default="1.5" description="減速計算用の減速度 [m/s^2]"/>
<arg name="planning_deceleration" default="1.0" description="減速計算用の減速度 [m/s^2]"/>
<!-- 経路計画用の加速度パラメータ(加速フェーズ専用、減速度より高い値を設定可能) -->
<arg name="planning_acceleration" default="3.0" description="加速フェーズの計画用加速度 [m/s^2]"/>

Expand Down
6 changes: 3 additions & 3 deletions crane_robot_skills/include/crane_robot_skills/attacker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <crane_geometry/boost_geometry.hpp>
#include <crane_geometry/interval.hpp>
#include <crane_robot_skills/goal_kick.hpp>
#include <crane_robot_skills/kick.hpp>
#include <crane_robot_skills/kick_old.hpp>
#include <crane_robot_skills/receive.hpp>
#include <crane_robot_skills/skill_base.hpp>
#include <memory>
Expand Down Expand Up @@ -64,7 +64,7 @@ class Attacker : public SkillBaseWithState

int forced_pass_receiver_id = -1;

Kick kick_skill;
KickOld kick_skill;

GoalKick goal_kick_skill;

Expand All @@ -74,7 +74,7 @@ class Attacker : public SkillBaseWithState
void onPostUpdate() override;

private:
void configurePassKick(const Point & target, Kick & kick_skill);
void configurePassKick(const Point & target, KickOld & kick_skill);

// KICK状態の進捗タイムアウト用
std::chrono::steady_clock::time_point kick_state_entry_time{};
Expand Down
4 changes: 2 additions & 2 deletions crane_robot_skills/include/crane_robot_skills/goal_kick.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define CRANE_ROBOT_SKILLS__GOAL_KICK_HPP_

#include <crane_geometry/vector2d_adapter.hpp>
#include <crane_robot_skills/kick.hpp>
#include <crane_robot_skills/kick_old.hpp>
#include <crane_robot_skills/skill_base.hpp>
#include <memory>

Expand All @@ -26,7 +26,7 @@ class GoalKick : public SkillBase

Status update() override;

Kick kick_skill;
KickOld kick_skill;

static double getBestAngleToShootFromPoint(
double minimum_angle_accuracy, const Point from_point,
Expand Down
4 changes: 2 additions & 2 deletions crane_robot_skills/include/crane_robot_skills/goalie.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <chrono>
#include <crane_geometry/vector2d_adapter.hpp>
#include <crane_robot_skills/kick.hpp>
#include <crane_robot_skills/kick_old.hpp>
#include <crane_robot_skills/skill_base.hpp>
#include <memory>
#include <string>
Expand All @@ -35,7 +35,7 @@ class Goalie : public SkillBase

std::string phase;

Kick kick_skill;
KickOld kick_skill;

std::optional<Point> prev_wait_point;

Expand Down
47 changes: 47 additions & 0 deletions crane_robot_skills/include/crane_robot_skills/kick_old.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright (c) 2023 ibis-ssl
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.

#ifndef CRANE_ROBOT_SKILLS__KICK_OLD_HPP_
#define CRANE_ROBOT_SKILLS__KICK_OLD_HPP_

#include <crane_geometry/vector2d_adapter.hpp>
#include <crane_robot_skills/skill_base.hpp>
#include <memory>

namespace crane::skills
{
// 983f026a(2025-09-14)以前の回り込みアルゴリズム(move_direction ベース 2 フェーズ)
enum class KickOldState {
ENTRY_POINT,
AROUND_BALL_AND_KICK,
};

class KickOld : public SkillBaseWithState
{
private:
static std::string getStateName(int s);

public:
template <typename... Args>
explicit KickOld(Args &&... args)
: SkillBaseWithState(
static_cast<int>(KickOldState::ENTRY_POINT), &KickOld::getStateName, "kick_old",
std::forward<Args>(args)...)
{
initialize();
}

auto getBallExitPointFromField(const double offset = 0.3) -> Point;

private:
void initialize();

void kickWithChip();

void kickStraight();
};
} // namespace crane::skills
#endif // CRANE_ROBOT_SKILLS__KICK_OLD_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <crane_geometry/interval.hpp>
#include <crane_geometry/vector2d_adapter.hpp>
#include <crane_robot_skills/kick.hpp>
#include <crane_robot_skills/kick_old.hpp>
#include <crane_robot_skills/skill_base.hpp>
#include <memory>
#include <utility>
Expand Down Expand Up @@ -45,7 +45,7 @@ class PenaltyKick : public SkillBaseWithState
return static_cast<PenaltyKickState>(SkillBaseWithState::getCurrentState());
}

Kick kick_skill;
KickOld kick_skill;

std::optional<Point> start_ball_point = std::nullopt;
};
Expand Down
16 changes: 7 additions & 9 deletions crane_robot_skills/include/crane_robot_skills/simple_kickoff.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@

#include <algorithm>
#include <crane_geometry/vector2d_adapter.hpp>
#include <crane_robot_skills/kick.hpp>
#include <crane_robot_skills/goal_kick.hpp>
#include <crane_robot_skills/kick_old.hpp>
#include <crane_robot_skills/skill_base.hpp>
#include <memory>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>

namespace crane::skills
{
Expand All @@ -24,16 +22,16 @@ class SimpleKickOff : public SkillBase
public:
template <typename... Args>
explicit SimpleKickOff(Args &&... args)
: SkillBase("simple_kickoff", std::forward<Args>(args)...), kick_skill(command)
: SkillBase("simple_kickoff", std::forward<Args>(args)...),
kick_skill(command),
goal_kick_skill(command)
{
initializeParameters();
}

void initializeParameters();

Status update() override;

Kick kick_skill;
KickOld kick_skill;
GoalKick goal_kick_skill;

private:
bool kicked = false;
Expand Down
1 change: 1 addition & 0 deletions crane_robot_skills/include/crane_robot_skills/skills.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <crane_robot_skills/goalie.hpp>
#include <crane_robot_skills/idle.hpp>
#include <crane_robot_skills/kick.hpp>
#include <crane_robot_skills/kick_old.hpp>
#include <crane_robot_skills/marker.hpp>
#include <crane_robot_skills/receive.hpp>
#include <crane_robot_skills/second_threat_defender.hpp>
Expand Down
2 changes: 1 addition & 1 deletion crane_robot_skills/src/attacker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ void Attacker::onPostUpdate()
}
}

void Attacker::configurePassKick(const Point & target, Kick & kick_skill)
void Attacker::configurePassKick(const Point & target, KickOld & kick_skill)
{
auto pass_analysis = getPassAnalysis(
world_model()->ball().pos, target, world_model()->theirs().robotsWhere().available().get());
Expand Down
2 changes: 1 addition & 1 deletion crane_robot_skills/src/kick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void Kick::initialize()
// 角度が合っている場合のみキックゾーンに入ったと判断し、ボールに向かって押し込む
if (angle_ok && bg::distance(ball_kick_zone, robot()->pose.pos) < 0.15) {
command->disableCollisionAvoidance();
return 0.5;
return 0.3;
} else {
return 0.0;
}
Expand Down
Loading
Loading