-
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.
consai_visualizer_msgs->crane_visualization_interfaces (#661)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
07b3044
commit 95273e6
Showing
29 changed files
with
207 additions
and
200 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 was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
consai_ros2/consai_visualizer_msgs/include/consai_visualizer_msgs/manual_conversions.hpp
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
cmake_minimum_required(VERSION 3.8) | ||
project(crane_visualization_interfaces) | ||
|
||
# Default to C++20 | ||
if(NOT CMAKE_CXX_STANDARD) | ||
set(CMAKE_CXX_STANDARD 20) | ||
endif() | ||
|
||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
add_compile_options(-Wall -Wextra -Wpedantic -g) | ||
endif() | ||
|
||
# find dependencies | ||
find_package(ament_cmake_auto REQUIRED) | ||
ament_auto_find_build_dependencies() | ||
|
||
find_package(Protobuf REQUIRED) | ||
|
||
add_subdirectory(proto) | ||
|
||
### proto -> ROS msg | ||
proto2ros_generate( | ||
${PROJECT_NAME}_messages_gen | ||
PROTOS proto/ObjectsArray.proto | ||
IMPORT_DIRS proto | ||
INTERFACES_OUT_VAR ros_messages | ||
PYTHON_OUT_VAR py_sources | ||
CPP_OUT_VAR cpp_sources | ||
INCLUDE_OUT_VAR cpp_include_dir | ||
APPEND_PYTHONPATH "${CMAKE_CURRENT_BINARY_DIR}/proto" | ||
DEPENDS ${PROJECT_NAME}_proto_gen | ||
) | ||
|
||
## ROS msg -> C++ / Python | ||
rosidl_generate_interfaces( | ||
${PROJECT_NAME} ${ros_messages} | ||
DEPENDENCIES builtin_interfaces proto2ros | ||
) | ||
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_messages_gen) | ||
|
||
## 変換ライブラリ | ||
ament_auto_add_library(${PROJECT_NAME}_conversions SHARED ${cpp_sources} src/manual_conversions.cpp) | ||
target_include_directories(${PROJECT_NAME}_conversions PUBLIC | ||
"$<BUILD_INTERFACE:${cpp_include_dir}>" | ||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>" | ||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/proto>" | ||
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>" | ||
) | ||
rosidl_get_typesupport_target(${PROJECT_NAME}_cpp_msgs ${PROJECT_NAME} "rosidl_typesupport_cpp") | ||
target_link_libraries(${PROJECT_NAME}_conversions | ||
${${PROJECT_NAME}_cpp_msgs} ${PROJECT_NAME}_proto protobuf::libprotobuf) | ||
|
||
rosidl_generated_python_package_add( | ||
${PROJECT_NAME}_additional_modules | ||
MODULES ${proto_py_sources} ${py_sources} | ||
PACKAGES ${PROJECT_NAME} | ||
DESTINATION ${PROJECT_NAME} | ||
) | ||
|
||
# C++ファイルインストール | ||
set(cpp_headers ${cpp_sources} ${proto_cpp_sources}) | ||
list(FILTER cpp_headers INCLUDE REGEX ".*\.(hpp|h)$") | ||
install( | ||
FILES ${cpp_headers} | ||
DESTINATION include/${PROJECT_NAME}/${PROJECT_NAME}/ | ||
) | ||
|
||
ament_auto_package() |
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,6 @@ | ||
# crane_visualization_interfaces | ||
|
||
Boston Dynamicsの`proto2ros`を使ってprotoファイルからROSメッセージと相互変換関数を生成するパッケージ | ||
|
||
生成されるメッセージの内容は以下とほぼ同じです。 | ||
<https://github.com/SSL-Roots/consai_ros2/tree/main/consai_visualizer_msgs/msg> |
File renamed without changes.
12 changes: 12 additions & 0 deletions
12
crane_visualization_interfaces/include/crane_visualization_interfaces/manual_conversions.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,12 @@ | ||
// 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_VISUALIZATION_INTERFACES__MANUAL_CONVERSIONS_HPP_ | ||
#define CRANE_VISUALIZATION_INTERFACES__MANUAL_CONVERSIONS_HPP_ | ||
|
||
// IMPLEMENT MANUAL CONVERSIONS HERE | ||
|
||
#endif // CRANE_VISUALIZATION_INTERFACES__MANUAL_CONVERSIONS_HPP_ |
7 changes: 4 additions & 3 deletions
7
...i_ros2/consai_visualizer_msgs/package.xml → crane_visualization_interfaces/package.xml
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
20 changes: 10 additions & 10 deletions
20
...nsai_visualizer_msgs/proto/CMakeLists.txt → ...alization_interfaces/proto/CMakeLists.txt
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 |
---|---|---|
@@ -1,26 +1,26 @@ | ||
find_package(Protobuf REQUIRED) | ||
|
||
protobuf_generate( | ||
LANGUAGE python | ||
OUT_VAR proto_py_sources | ||
PROTOS ObjectsArray.proto | ||
LANGUAGE python | ||
OUT_VAR proto_py_sources | ||
PROTOS ObjectsArray.proto | ||
) | ||
|
||
protobuf_generate( | ||
LANGUAGE cpp | ||
OUT_VAR proto_cpp_sources | ||
PROTOS ObjectsArray.proto | ||
LANGUAGE cpp | ||
OUT_VAR proto_cpp_sources | ||
PROTOS ObjectsArray.proto | ||
) | ||
|
||
add_library(${PROJECT_NAME}_proto SHARED ${proto_cpp_sources} ) | ||
add_library(${PROJECT_NAME}_proto SHARED ${proto_cpp_sources}) | ||
#target_include_directories(${PROJECT_NAME}_proto PUBLIC "${CMAKE_CURRENT_BINARY_DIR}") | ||
target_compile_options(${PROJECT_NAME}_proto PUBLIC -Wno-deprecated-declarations) | ||
target_link_libraries(${PROJECT_NAME}_proto protobuf::libprotobuf) | ||
|
||
add_custom_target( | ||
${PROJECT_NAME}_proto_gen ALL DEPENDS | ||
${proto_py_sources} | ||
${proto_cpp_sources} | ||
${PROJECT_NAME}_proto_gen ALL DEPENDS | ||
${proto_py_sources} | ||
${proto_cpp_sources} | ||
) | ||
|
||
set(PROTO_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}" PARENT_SCOPE) |
2 changes: 2 additions & 0 deletions
2
..._visualizer_msgs/proto/ObjectsArray.proto → ...ation_interfaces/proto/ObjectsArray.proto
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
Oops, something went wrong.