@@ -20,6 +20,7 @@ SingleBallPlacement::SingleBallPlacement(uint8_t id, const std::shared_ptr<World
20
20
[this ](ConsaiVisualizerWrapper::SharedPtr visualizer) -> Status {
21
21
if (not go_over_ball) {
22
22
go_over_ball = std::make_shared<GoOverBall>(robot->id , world_model);
23
+ go_over_ball->setCommander (command);
23
24
go_over_ball->setParameter (" next_target_x" , getParameter<double >(" placement_x" ));
24
25
go_over_ball->setParameter (" next_target_y" , getParameter<double >(" placement_y" ));
25
26
go_over_ball->setParameter (" margin" , 0.4 );
@@ -39,6 +40,7 @@ SingleBallPlacement::SingleBallPlacement(uint8_t id, const std::shared_ptr<World
39
40
[this ](ConsaiVisualizerWrapper::SharedPtr visualizer) -> Status {
40
41
if (not get_ball_contact) {
41
42
get_ball_contact = std::make_shared<GetBallContact>(robot->id , world_model);
43
+ get_ball_contact->setCommander (command);
42
44
}
43
45
44
46
skill_status = get_ball_contact->run (visualizer);
@@ -55,6 +57,7 @@ SingleBallPlacement::SingleBallPlacement(uint8_t id, const std::shared_ptr<World
55
57
[this ](ConsaiVisualizerWrapper::SharedPtr visualizer) -> Status {
56
58
if (not move_with_ball) {
57
59
move_with_ball = std::make_shared<MoveWithBall>(robot->id , world_model);
60
+ move_with_ball->setCommander (command);
58
61
move_with_ball->setParameter (" target_x" , getParameter<double >(" placement_x" ));
59
62
move_with_ball->setParameter (" target_y" , getParameter<double >(" placement_y" ));
60
63
}
@@ -73,6 +76,7 @@ SingleBallPlacement::SingleBallPlacement(uint8_t id, const std::shared_ptr<World
73
76
[this ](ConsaiVisualizerWrapper::SharedPtr visualizer) -> Status {
74
77
if (not sleep ) {
75
78
sleep = std::make_shared<Sleep>(robot->id , world_model);
79
+ sleep ->setCommander (command);
76
80
}
77
81
skill_status = sleep ->run (visualizer);
78
82
return Status::RUNNING;
@@ -87,6 +91,7 @@ SingleBallPlacement::SingleBallPlacement(uint8_t id, const std::shared_ptr<World
87
91
[this ](ConsaiVisualizerWrapper::SharedPtr visualizer) -> Status {
88
92
if (not sleep ) {
89
93
sleep = std::make_shared<Sleep>(robot->id , world_model);
94
+ sleep ->setCommander (command);
90
95
sleep ->setParameter (" duration" , 0.5 );
91
96
}
92
97
skill_status = sleep ->run (visualizer);
@@ -102,6 +107,7 @@ SingleBallPlacement::SingleBallPlacement(uint8_t id, const std::shared_ptr<World
102
107
[this ](ConsaiVisualizerWrapper::SharedPtr visualizer) -> Status {
103
108
if (not set_target_position) {
104
109
set_target_position = std::make_shared<CmdSetTargetPosition>(robot->id , world_model);
110
+ set_target_position->setCommander (command);
105
111
}
106
112
// メモ:().normalized() * 0.6したらなぜかゼロベクトルが出来上がってしまう
107
113
Vector2 diff = (robot->pose .pos - world_model->ball .pos );
0 commit comments