-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from ibis-ssl/add-skills
スキルシステムのアップデート
- Loading branch information
Showing
19 changed files
with
953 additions
and
293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
crane_robot_skills/include/crane_robot_skills/robot_command_as_skill.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// 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__ROBOT_COMMAND_AS_SKILL_HPP_ | ||
#define CRANE_ROBOT_SKILLS__ROBOT_COMMAND_AS_SKILL_HPP_ | ||
|
||
#include <crane_geometry/eigen_adapter.hpp> | ||
#include <crane_robot_skills/skill_base.hpp> | ||
|
||
namespace crane | ||
{ | ||
|
||
#define DEFINE_SKILL_COMMAND(name) \ | ||
class Cmd##name : public SkillBase<> \ | ||
{ \ | ||
public: \ | ||
explicit Cmd##name(uint8_t id, std::shared_ptr<WorldModelWrapper> & world_model); \ | ||
} | ||
|
||
DEFINE_SKILL_COMMAND(KickWithChip); | ||
DEFINE_SKILL_COMMAND(KickStraight); | ||
DEFINE_SKILL_COMMAND(Dribble); | ||
DEFINE_SKILL_COMMAND(SetVelocity); | ||
DEFINE_SKILL_COMMAND(SetTargetPosition); | ||
DEFINE_SKILL_COMMAND(SetDribblerTargetPosition); | ||
DEFINE_SKILL_COMMAND(SetTargetTheta); | ||
DEFINE_SKILL_COMMAND(StopHere); | ||
DEFINE_SKILL_COMMAND(DisablePlacementAvoidance); | ||
DEFINE_SKILL_COMMAND(EnablePlacementAvoidance); | ||
DEFINE_SKILL_COMMAND(DisableBallAvoidance); | ||
DEFINE_SKILL_COMMAND(EnableBallAvoidance); | ||
DEFINE_SKILL_COMMAND(DisableCollisionAvoidance); | ||
DEFINE_SKILL_COMMAND(EnableCollisionAvoidance); | ||
DEFINE_SKILL_COMMAND(DisableGoalAreaAvoidance); | ||
DEFINE_SKILL_COMMAND(EnableGoalAreaAvoidance); | ||
DEFINE_SKILL_COMMAND(SetGoalieDefault); | ||
DEFINE_SKILL_COMMAND(EnableBallCenteringControl); | ||
DEFINE_SKILL_COMMAND(EnableLocalGoalie); | ||
DEFINE_SKILL_COMMAND(SetMaxVelocity); | ||
DEFINE_SKILL_COMMAND(SetMaxAcceleration); | ||
DEFINE_SKILL_COMMAND(SetMaxOmega); | ||
DEFINE_SKILL_COMMAND(SetTerminalVelocity); | ||
DEFINE_SKILL_COMMAND(LookAt); | ||
DEFINE_SKILL_COMMAND(LookAtBall); | ||
DEFINE_SKILL_COMMAND(LookAtBallFrom); | ||
|
||
} // namespace crane | ||
#endif // CRANE_ROBOT_SKILLS__ROBOT_COMMAND_AS_SKILL_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) 2024 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__SKILLS_HPP_ | ||
#define CRANE_ROBOT_SKILLS__SKILLS_HPP_ | ||
|
||
#include <crane_robot_skills/get_ball_contact.hpp> | ||
#include <crane_robot_skills/idle.hpp> | ||
#include <crane_robot_skills/move_to_geometry.hpp> | ||
#include <crane_robot_skills/move_with_ball.hpp> | ||
#include <crane_robot_skills/robot_command_as_skill.hpp> | ||
#include <crane_robot_skills/sleep.hpp> | ||
#include <crane_robot_skills/turn_around_point.hpp> | ||
|
||
#endif //CRANE_ROBOT_SKILLS__SKILLS_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright (c) 2024 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__SLEEP_HPP_ | ||
#define CRANE_ROBOT_SKILLS__SLEEP_HPP_ | ||
|
||
#include <crane_geometry/eigen_adapter.hpp> | ||
#include <crane_robot_skills/skill_base.hpp> | ||
|
||
namespace crane | ||
{ | ||
class Sleep : public SkillBase<> | ||
{ | ||
public: | ||
explicit Sleep(uint8_t id, std::shared_ptr<WorldModelWrapper> & world_model) | ||
: SkillBase<>("Sleep", id, world_model, DefaultStates::DEFAULT) | ||
{ | ||
setParameter("duration", 0.0); | ||
addStateFunction( | ||
DefaultStates::DEFAULT, | ||
[this]( | ||
const std::shared_ptr<WorldModelWrapper> & world_model, | ||
const std::shared_ptr<RobotInfo> & robot, | ||
crane::RobotCommandWrapper & command) -> SkillBase::Status { | ||
if (not is_started) { | ||
start_time = std::chrono::steady_clock::now(); | ||
is_started = true; | ||
} | ||
|
||
auto elapsed_time = | ||
std::chrono::duration<double>(std::chrono::steady_clock::now() - start_time); | ||
if (elapsed_time.count() > getParameter<double>("duration")) { | ||
return SkillBase::Status::SUCCESS; | ||
} else { | ||
return SkillBase::Status::RUNNING; | ||
} | ||
}); | ||
} | ||
bool is_started = false; | ||
std::chrono::time_point<std::chrono::steady_clock> start_time; | ||
}; | ||
} // namespace crane | ||
#endif // CRANE_ROBOT_SKILLS__SLEEP_HPP_ |
Oops, something went wrong.