Skip to content

Commit ff0f029

Browse files
authored
Merge branch 'develop' into improve_ball_around
2 parents 54ea7ca + 9baa2db commit ff0f029

File tree

59 files changed

+1611
-1525
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1611
-1525
lines changed

.github/workflows/custom_dict.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@
125125
"libprotobuf",
126126
"RELWITHDEBINFO",
127127
"NODEBUG",
128-
"remmina"
128+
"remmina",
129+
"gltf",
130+
"svgs"
129131
]
130132
}

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ repos:
1818
args: [--markdown-linebreak-ext=md]
1919

2020
- repo: https://github.com/igorshubovych/markdownlint-cli
21-
rev: v0.43.0
21+
rev: v0.44.0
2222
hooks:
2323
- id: markdownlint
2424
args: [-c, .markdownlint.yaml, --fix]
@@ -60,14 +60,14 @@ repos:
6060
# - id: isort
6161

6262
- repo: https://github.com/astral-sh/ruff-pre-commit
63-
rev: v0.8.4
63+
rev: v0.9.6
6464
hooks:
6565
- id: ruff
6666
args: [--fix]
6767
- id: ruff-format
6868

6969
- repo: https://github.com/pre-commit/mirrors-clang-format
70-
rev: v17.0.6
70+
rev: v19.1.7
7171
hooks:
7272
- id: clang-format
7373
types_or: [c++, c, cuda]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# crane
22

33
ドキュメントは `docs`フォルダに移動しました
4-
[こっち](https://ibis-ssl.github.io/crane_documentation/)でも公開中
4+
[こっち](https://ibis-ssl.github.io/ibis_documentation/)でも公開中

consai_ros2/robocup_ssl_msgs/CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,9 @@ add_library(proto_cpp
4747
target_link_libraries(proto_cpp ${PROTOBUF_LIBRARIES})
4848

4949
# Install
50-
if("$ENV{ROS_DISTRO}" STRGREATER "galactic")
51-
install(
52-
FILES ${PROTO_H}
53-
DESTINATION include/${PROJECT_NAME}/${PROJECT_NAME})
54-
else()
5550
install(
5651
FILES ${PROTO_H}
57-
DESTINATION include/${PROJECT_NAME})
58-
endif()
52+
DESTINATION include/${PROJECT_NAME}/${PROJECT_NAME})
5953

6054
install(
6155
TARGETS proto_cpp

crane_bringup/launch/crane.launch.py

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ def generate_launch_description():
5858
DeclareLaunchArgument(
5959
"max_vel", default_value="3.0", description="ロボットの最大速度"
6060
),
61-
DeclareLaunchArgument(
62-
"gui", default_value="true", description="consai_visualizerの起動フラグ"
63-
),
6461
DeclareLaunchArgument(
6562
"speak", default_value="true", description="音声ノードの起動フラグ"
6663
),
@@ -215,6 +212,11 @@ def generate_launch_description():
215212
# parameters=[{"blue_port": 10311}, {"yellow_port": 10312}],
216213
parameters=[{"blue_port": 10301}, {"yellow_port": 10302}],
217214
),
215+
Node(
216+
package="crane_visualization_aggregator",
217+
executable="crane_visualization_aggregator_node",
218+
output="screen",
219+
),
218220
Node(
219221
package="crane_world_model_publisher",
220222
executable="crane_world_model_publisher_node",
@@ -263,12 +265,6 @@ def generate_launch_description():
263265
{"voicevox_plugin/volumeScale": 1.0},
264266
],
265267
),
266-
Node(
267-
condition=IfCondition(LaunchConfiguration("gui")),
268-
package="consai_visualizer",
269-
executable="consai_visualizer",
270-
on_exit=default_exit_behavior,
271-
),
272268
# rosbag recordの起動設定
273269
GroupAction(
274270
condition=IfCondition(LaunchConfiguration("record")),
@@ -279,5 +275,44 @@ def generate_launch_description():
279275
),
280276
],
281277
),
278+
# https://github.com/foxglove/ros-foxglove-bridge/blob/main/ros2_foxglove_bridge/launch/foxglove_bridge_launch.xml
279+
Node(
280+
package="foxglove_bridge",
281+
executable="foxglove_bridge",
282+
parameters=[
283+
{"port": 8765},
284+
{"address": "0.0.0.0"},
285+
{"tls": False},
286+
{"certfile": ""},
287+
{"keyfile": ""},
288+
{"topic_whitelist": [".*"]},
289+
{"service_whitelist": [".*"]},
290+
{"param_whitelist": [".*"]},
291+
{"client_topic_whitelist": [".*"]},
292+
{"min_qos_depth": 1},
293+
{"max_qos_depth": 10},
294+
{"num_threads": 0},
295+
{"send_buffer_limit": 10000000},
296+
{"use_sim_time": False},
297+
{
298+
"capabilities": [
299+
"clientPublish",
300+
"parameters",
301+
"parametersSubscribe",
302+
"services",
303+
"connectionGraph",
304+
"assets",
305+
]
306+
},
307+
{"include_hidden": False},
308+
{
309+
"asset_uri_allowlist": [
310+
"^package://(?:\\w+/)*\\w+\\.(?:dae|fbx|glb|gltf|jpeg|jpg|mtl|obj|png|stl|tif|tiff|urdf|webp|xacro)$"
311+
]
312+
},
313+
],
314+
output="screen",
315+
on_exit=default_exit_behavior,
316+
),
282317
]
283318
)

crane_bringup/package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
<buildtool_depend>ament_cmake_auto</buildtool_depend>
1111
<exec_depend>ament_index_python</exec_depend>
12+
<exec_depend>foxglove_bridge</exec_depend>
1213
<exec_depend>joy</exec_depend>
1314
<exec_depend>launch_ros</exec_depend>
1415

crane_game_analyzer/include/crane_game_analyzer/game_analyzer.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#define CRANE_GAME_ANALYZER__GAME_ANALYZER_HPP_
99

1010
#include <algorithm>
11-
#include <crane_msg_wrappers/consai_visualizer_wrapper.hpp>
11+
#include <crane_msg_wrappers/crane_visualizer_wrapper.hpp>
1212
#include <crane_msg_wrappers/world_model_wrapper.hpp>
1313
#include <crane_msgs/msg/game_analysis.hpp>
1414
#include <crane_msgs/msg/world_model.hpp>
@@ -126,7 +126,7 @@ class GameAnalyzerComponent : public rclcpp::Node
126126

127127
GameAnalyzerConfig config;
128128

129-
ConsaiVisualizerBuffer::MessageBuilder::UniquePtr visualizer;
129+
CraneVisualizerBuffer::MessageBuilder::UniquePtr visualizer;
130130
};
131131
} // namespace crane
132132

crane_game_analyzer/include/crane_game_analyzer/kick_event_detector.hpp

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class KickEventDetector
3232

3333
void update(
3434
const WorldModelWrapper & world_model,
35-
const ConsaiVisualizerBuffer::MessageBuilder::UniquePtr & visualizer)
35+
const CraneVisualizerBuffer::MessageBuilder::UniquePtr & visualizer)
3636
{
3737
{
3838
Record record;
@@ -58,15 +58,23 @@ class KickEventDetector
5858
// print detected bots
5959
std::optional<KickOrigin> kick_event_origin = std::nullopt;
6060
for (const auto & id : detected_bots.friends) {
61-
RCLCPP_INFO_STREAM(rclcpp::get_logger("aaaa"), "Detected friend: " << static_cast<int>(id));
62-
visualizer->addCircle(
63-
world_model.getOurRobot(id)->pose.pos, 0.5, 2, "blue", "blue", 1.0, "KICK");
61+
SvgCircleBuilder circle_builder;
62+
circle_builder.center(world_model.getOurRobot(id)->pose.pos)
63+
.radius(0.5)
64+
.stroke("blue")
65+
.fill("blue", 0.3)
66+
.strokeWidth(20);
67+
visualizer->add(circle_builder.getSvgString());
6468
kick_event_origin.emplace(ros_clock.now(), world_model.ball.pos, RobotIdentifier{true, id});
6569
}
6670
for (const auto & id : detected_bots.enemies) {
67-
RCLCPP_INFO_STREAM(rclcpp::get_logger("aaaa"), "Detected enemy: " << static_cast<int>(id));
68-
visualizer->addCircle(
69-
world_model.getTheirRobot(id)->pose.pos, 0.5, 2, "blue", "blue", 1.0, "KICK");
71+
SvgCircleBuilder circle_builder;
72+
circle_builder.center(world_model.getTheirRobot(id)->pose.pos)
73+
.radius(0.5)
74+
.stroke("blue")
75+
.fill("blue", 0.3)
76+
.strokeWidth(20);
77+
visualizer->add(circle_builder.getSvgString());
7078
kick_event_origin.emplace(ros_clock.now(), world_model.ball.pos, RobotIdentifier{false, id});
7179
}
7280

@@ -78,20 +86,18 @@ class KickEventDetector
7886
// キック中断判定
7987
kick_history.emplace_back(ongoing_kick_origin.value(), world_model.ball.pos);
8088
ongoing_kick_origin = std::nullopt;
81-
visualizer->addCircle(world_model.ball.pos, 3.5, 2, "green", "black", 1.0, "EVENT");
8289
}
8390
}
8491

8592
// 進行中のキックを可視化
8693
if (ongoing_kick_origin.has_value()) {
87-
visualizer->addTube(
88-
world_model.ball.pos, ongoing_kick_origin.value().position, 0.2, 2, "red", "", 1.0, "KICK");
94+
SvgLineBuilder line_builder;
95+
line_builder.start(ongoing_kick_origin.value().position)
96+
.end(world_model.ball.pos)
97+
.stroke("red", 0.3)
98+
.strokeWidth(200);
99+
visualizer->add(line_builder.getSvgString());
89100
}
90-
91-
// キックの履歴を可視化
92-
// for (const auto & [kick_origin, kick_end] : kick_history) {
93-
// visualizer->addLine(kick_origin.position, kick_end, 2, "red", 0.5, "KICK");
94-
// }
95101
}
96102

97103
bool hasInterruptedOnGoingKick(const WorldModelWrapper & world_model) const

crane_game_analyzer/src/crane_game_analyzer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ namespace crane
1515
{
1616
GameAnalyzerComponent::GameAnalyzerComponent(const rclcpp::NodeOptions & options)
1717
: Node("crane_game_analyzer", options),
18-
visualizer(std::make_unique<ConsaiVisualizerBuffer::MessageBuilder>("game_analyzer"))
18+
visualizer(std::make_unique<CraneVisualizerBuffer::MessageBuilder>("game_analyzer"))
1919
{
2020
RCLCPP_INFO(get_logger(), "GameAnalyzer is constructed.");
2121

22-
ConsaiVisualizerBuffer::activate(*this);
22+
CraneVisualizerBuffer::activate(*this);
2323

2424
world_model = std::make_unique<WorldModelWrapper>(*this);
2525

@@ -37,7 +37,7 @@ GameAnalyzerComponent::GameAnalyzerComponent(const rclcpp::NodeOptions & options
3737
robot_collision_info->relative_velocity);
3838
}
3939
visualizer->flush();
40-
ConsaiVisualizerBuffer::publish();
40+
CraneVisualizerBuffer::publish();
4141
});
4242
}
4343

crane_local_planner/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ target_precompile_headers(${PROJECT_NAME}_component
2929
"<crane_basics/pid_controller.hpp>"
3030
"<crane_msgs/msg/robot_commands.hpp>"
3131
"<crane_msg_wrappers/world_model_wrapper.hpp>"
32-
"<crane_msg_wrappers/consai_visualizer_wrapper.hpp>"
32+
"<crane_msg_wrappers/crane_visualizer_wrapper.hpp>"
3333
"<rclcpp/rclcpp.hpp>"
3434
)
3535

0 commit comments

Comments
 (0)