Skip to content

Commit

Permalink
Use TASFMessage library
Browse files Browse the repository at this point in the history
  • Loading branch information
KiselevIlia committed Mar 29, 2024
1 parent 250aaff commit 777edda
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 20 deletions.
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ if(NOT ${gz-transport13_VERSION} EQUAL 13.1.0)
message(FATAL_ERROR "gz-transport13 must be version 13.1.0. You have ${gz-transport13_VERSION}")
endif ()

find_library(GZ_CUSTOM_MSGS NAMES gz_custom_messages PATHS /usr/local/bin)
if (NOT GZ_CUSTOM_MSGS)
message(FATAL_ERROR "Please install messages library from https://github.com/tiiuae/TASFMessages")
endif ()

if(gz-msgs10_FOUND)
set(GZ_MSG_VER 10)
set(Protobuf_IMPORT_DIRS ${gz-msgs10_INCLUDE_DIRS})
Expand Down Expand Up @@ -72,17 +77,19 @@ install(TARGETS
set(CPACK_PACKAGE_CONTACT "Auterion")
include(CPack)

add_library(collision_plugin SHARED src/harmonic_collision.cpp ${PROTO_SRCS})
add_library(collision_plugin SHARED src/harmonic_collision.cpp)
set_property(TARGET collision_plugin PROPERTY CXX_STANDARD 17)
target_link_libraries(collision_plugin
PRIVATE gz-sim${GAZEBO_VERSION}::gz-sim${GAZEBO_VERSION}
PRIVATE ${GZ_CUSTOM_MSGS}
)

add_library(groundtruth_plugin SHARED src/groundtruth_plugin.cpp ${GT_PROTO_SRCS})
add_library(groundtruth_plugin SHARED src/groundtruth_plugin.cpp)
target_link_libraries(groundtruth_plugin
PRIVATE gz-sim${GAZEBO_VERSION}::gz-sim${GAZEBO_VERSION}
PRIVATE gz-plugin${GZ_PLUGIN_VER}::gz-plugin${GZ_PLUGIN_VER}
PRIVATE gz-msgs10::gz-msgs10
PRIVATE ${GZ_CUSTOM_MSGS}
)
# ln -s ./libgroundtruth_plugin.so /usr/lib/x86_64-linux-gnu/gz-sim-8/plugins
# ln -s ./libcollision_plugin.so /usr/lib/x86_64-linux-gnu/gz-sim-8/plugins
2 changes: 1 addition & 1 deletion include/groundtruth_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <gz/msgs.hh>
#include <gz/sim/Model.hh>
#include "common.h"
#include "Groundtruth.pb.h"
#include "gz_custom_messages/Groundtruth.pb.h"

namespace gz {
namespace sim {
Expand Down
2 changes: 1 addition & 1 deletion include/harmonic_collision.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <gz/transport/Node.hh>
#include <gz/sim/Model.hh>

#include "CollisionObject.pb.h"
#include "gz_custom_messages/CollisionObject.pb.h"

namespace gz {
using namespace sim;
Expand Down
11 changes: 0 additions & 11 deletions msgs/CollisionObject.proto

This file was deleted.

6 changes: 1 addition & 5 deletions msgs/Groundtruth.proto
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
syntax = "proto3";
package gz.msgs;
option java_package = "com.gz.msgs";
option java_outer_classname = "GroundtruthProtos";

/// \ingroup gz.msgs
/// \interface Groundtruth
/// \brief Data from a Groundtruth plugin
/// This is for GPS message.
/// For use gz::msgs::Groundtruth

message Groundtruth
{
Expand Down

0 comments on commit 777edda

Please sign in to comment.