Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PI Sprint 24/25 / PD-462] - [Feature] Migrate to RoslibJS #8

Merged
merged 2 commits into from
Mar 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 0 additions & 51 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,62 +16,11 @@ endif()
find_package(ament_cmake REQUIRED)
find_package(rosidl_default_generators REQUIRED)

set(protobuf_MODULE_COMPATIBLE TRUE)
find_package(Protobuf CONFIG REQUIRED)
message(STATUS "Using protobuf ${Protobuf_VERSION}")

find_package(gRPC CONFIG REQUIRED)
message(STATUS "Using gRPC ${gRPC_VERSION}")

# Generated sources
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/proto)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/proto/akushon.pb.cc"
"${CMAKE_CURRENT_BINARY_DIR}/proto/akushon.pb.h"
"${CMAKE_CURRENT_BINARY_DIR}/proto/akushon.grpc.pb.cc"
"${CMAKE_CURRENT_BINARY_DIR}/proto/akushon.grpc.pb.h"
COMMAND $<TARGET_FILE:protobuf::protoc>
ARGS --grpc_out "${CMAKE_CURRENT_BINARY_DIR}/proto"
--cpp_out "${CMAKE_CURRENT_BINARY_DIR}/proto"
-I ${CMAKE_CURRENT_SOURCE_DIR}/proto
--plugin=protoc-gen-grpc=$<TARGET_FILE:gRPC::grpc_cpp_plugin>
${CMAKE_CURRENT_SOURCE_DIR}/proto/akushon.proto
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/proto/akushon.proto)

add_library(akushon_proto
${CMAKE_CURRENT_BINARY_DIR}/proto/akushon.pb.cc
${CMAKE_CURRENT_BINARY_DIR}/proto/akushon.pb.h
${CMAKE_CURRENT_BINARY_DIR}/proto/akushon.grpc.pb.cc
${CMAKE_CURRENT_BINARY_DIR}/proto/akushon.grpc.pb.h)

target_compile_options(akushon_proto PRIVATE -fPIC)
target_compile_features(akushon_proto PUBLIC cxx_std_17)

target_link_libraries(akushon_proto
protobuf::libprotobuf
)

rosidl_generate_interfaces(${PROJECT_NAME}
"msg/RunAction.msg"
"msg/Status.msg"
"srv/GetActions.srv"
"srv/SaveActions.srv")

ament_export_dependencies(rosidl_default_runtime)
ament_export_targets(akushon_proto HAS_LIBRARY_TARGET)

install (
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/proto/
DESTINATION include/${PROJECT_NAME}
)

install (
TARGETS akushon_proto
EXPORT akushon_proto
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)

ament_package()
47 changes: 0 additions & 47 deletions proto/akushon.proto

This file was deleted.

2 changes: 1 addition & 1 deletion srv/SaveActions.srv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
string json
---
string status
bool status
Loading