diff --git a/modules/build.sh b/modules/build.sh index 084991b75a6c9b3c53aed9f401b0f80563895ee9..0426813b1e3c1553664ac0cda70a2e01ad5a44c8 100755 --- a/modules/build.sh +++ b/modules/build.sh @@ -37,12 +37,12 @@ cd cmake-build-debug cmake .. make -# build VeloxLib -cd ../../VeloxLib/ +# build VeloxProtocolLib +cd ../../VeloxProtocolLib/ mkdir cmake-build-debug cd cmake-build-debug cmake .. -make +sudo make install # build ROS stuff cd ../../../ diff --git a/modules/catkin_ws/src/PC2CarLib/CMakeLists.txt b/modules/catkin_ws/src/PC2CarLib/CMakeLists.txt index ee7b4aacb6b0c633ca447ecbd4eaf5699befdbbf..27330da6fc7a025afd26a9eb0436ea0109b2019e 100644 --- a/modules/catkin_ws/src/PC2CarLib/CMakeLists.txt +++ b/modules/catkin_ws/src/PC2CarLib/CMakeLists.txt @@ -20,10 +20,8 @@ set(CMAKE_CXX_FLAGS -pthread) set(SOURCE_FILES include/PC2CarLib/CommandSender.h - include/PC2CarLib/TimedValue.h include/PC2CarLib/PC2Car.h include/PC2CarLib/CommandReceiver.h - include/PC2CarLib/TimedValue.h include/PC2CarLib/json.hpp src/CommandReceiver.cpp) @@ -32,7 +30,6 @@ set(PUBLIC_HEADER_FILES include/PC2CarLib/CommandReceiver.h include/PC2CarLib/json.hpp include/PC2CarLib/PC2Car.h - include/PC2CarLib/TimedValue.h ${CMAKE_CURRENT_BINARY_DIR}/PC2CarLibConfig.h) foreach(HEADER ${PUBLIC_HEADER_FILES}) diff --git a/modules/catkin_ws/src/VeloxProtocolLib/CMakeLists.txt b/modules/catkin_ws/src/VeloxProtocolLib/CMakeLists.txt index a255bfc819f6e207531fc3721701f809641238fc..99d133a4f0a47e62e2da802bb038974e490fb756 100644 --- a/modules/catkin_ws/src/VeloxProtocolLib/CMakeLists.txt +++ b/modules/catkin_ws/src/VeloxProtocolLib/CMakeLists.txt @@ -19,49 +19,49 @@ include_directories("${PROJECT_BINARY_DIR}") set(CMAKE_CXX_FLAGS -pthread) set(SOURCE_FILES - include/mavlink/checksum.h - include/mavlink/mavlink_conversions.h - include/mavlink/mavlink_get_info.h - include/mavlink/mavlink_helpers.h - include/mavlink/mavlink_sha256.h - include/mavlink/mavlink_types.h - include/mavlink/protocol.h - include/mavlink/velox/mavlink.h - include/mavlink/velox/mavlink_msg_carcontrol.h - include/mavlink/velox/mavlink_msg_cmd_request_clocksync.h - include/mavlink/velox/mavlink_msg_cmd_request_msg.h - include/mavlink/velox/mavlink_msg_cmd_request_statechange.h - include/mavlink/velox/mavlink_msg_error.h - include/mavlink/velox/mavlink_msg_heartbeat.h - include/mavlink/velox/mavlink_msg_odometry.h - include/mavlink/velox/mavlink_msg_trajectory.h - include/mavlink/velox/testsuite.h - include/mavlink/velox/velox.h - include/mavlink/velox/version.h - include/Connection.h + include/VeloxProtocolLib/mavlink/checksum.h + include/VeloxProtocolLib/mavlink/mavlink_conversions.h + include/VeloxProtocolLib/mavlink/mavlink_get_info.h + include/VeloxProtocolLib/mavlink/mavlink_helpers.h + include/VeloxProtocolLib/mavlink/mavlink_sha256.h + include/VeloxProtocolLib/mavlink/mavlink_types.h + include/VeloxProtocolLib/mavlink/protocol.h + include/VeloxProtocolLib/mavlink/velox/mavlink.h + include/VeloxProtocolLib/mavlink/velox/mavlink_msg_carcontrol.h + include/VeloxProtocolLib/mavlink/velox/mavlink_msg_cmd_request_clocksync.h + include/VeloxProtocolLib/mavlink/velox/mavlink_msg_cmd_request_msg.h + include/VeloxProtocolLib/mavlink/velox/mavlink_msg_cmd_request_statechange.h + include/VeloxProtocolLib/mavlink/velox/mavlink_msg_error.h + include/VeloxProtocolLib/mavlink/velox/mavlink_msg_heartbeat.h + include/VeloxProtocolLib/mavlink/velox/mavlink_msg_odometry.h + include/VeloxProtocolLib/mavlink/velox/mavlink_msg_trajectory.h + include/VeloxProtocolLib/mavlink/velox/testsuite.h + include/VeloxProtocolLib/mavlink/velox/velox.h + include/VeloxProtocolLib/mavlink/velox/version.h + include/VeloxProtocolLib/Connection.h src/Connection.cpp) set(PUBLIC_HEADER_FILES - include/mavlink/checksum.h - include/mavlink/mavlink_conversions.h - include/mavlink/mavlink_get_info.h - include/mavlink/mavlink_helpers.h - include/mavlink/mavlink_sha256.h - include/mavlink/mavlink_types.h - include/mavlink/protocol.h - include/mavlink/velox/mavlink.h - include/mavlink/velox/mavlink_msg_carcontrol.h - include/mavlink/velox/mavlink_msg_cmd_request_clocksync.h - include/mavlink/velox/mavlink_msg_cmd_request_msg.h - include/mavlink/velox/mavlink_msg_cmd_request_statechange.h - include/mavlink/velox/mavlink_msg_error.h - include/mavlink/velox/mavlink_msg_heartbeat.h - include/mavlink/velox/mavlink_msg_odometry.h - include/mavlink/velox/mavlink_msg_trajectory.h - include/mavlink/velox/testsuite.h - include/mavlink/velox/velox.h - include/mavlink/velox/version.h - include/Connection.h + include/VeloxProtocolLib/mavlink/checksum.h + include/VeloxProtocolLib/mavlink/mavlink_conversions.h + include/VeloxProtocolLib/mavlink/mavlink_get_info.h + include/VeloxProtocolLib/mavlink/mavlink_helpers.h + include/VeloxProtocolLib/mavlink/mavlink_sha256.h + include/VeloxProtocolLib/mavlink/mavlink_types.h + include/VeloxProtocolLib/mavlink/protocol.h + include/VeloxProtocolLib/mavlink/velox/mavlink.h + include/VeloxProtocolLib/mavlink/velox/mavlink_msg_carcontrol.h + include/VeloxProtocolLib/mavlink/velox/mavlink_msg_cmd_request_clocksync.h + include/VeloxProtocolLib/mavlink/velox/mavlink_msg_cmd_request_msg.h + include/VeloxProtocolLib/mavlink/velox/mavlink_msg_cmd_request_statechange.h + include/VeloxProtocolLib/mavlink/velox/mavlink_msg_error.h + include/VeloxProtocolLib/mavlink/velox/mavlink_msg_heartbeat.h + include/VeloxProtocolLib/mavlink/velox/mavlink_msg_odometry.h + include/VeloxProtocolLib/mavlink/velox/mavlink_msg_trajectory.h + include/VeloxProtocolLib/mavlink/velox/testsuite.h + include/VeloxProtocolLib/mavlink/velox/velox.h + include/VeloxProtocolLib/mavlink/velox/version.h + include/VeloxProtocolLib/Connection.h ${CMAKE_CURRENT_BINARY_DIR}/VeloxProtocolLibConfig.h) foreach(HEADER ${PUBLIC_HEADER_FILES}) @@ -144,8 +144,10 @@ if(INSTALL_PACKAGE) EXPORT VeloxProtocolLibTargets LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" - RUNTIME DESTINATION "${INSTALL_LIB_DIR}" # for windows - PUBLIC_HEADER DESTINATION "${INSTALL_INCLUDE_DIR}") + RUNTIME DESTINATION "${INSTALL_LIB_DIR}") # for windows + + install(DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/include/VeloxProtocolLib" + DESTINATION "${CMAKE_INSTALL_PREFIX}/include") # Install the VeloxProtocolLibConfig.cmake and VeloxProtocolLibConfigVersion.cmake install(FILES diff --git a/modules/catkin_ws/src/VeloxProtocolLib/include/Connection.h b/modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/Connection.h similarity index 98% rename from modules/catkin_ws/src/VeloxProtocolLib/include/Connection.h rename to modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/Connection.h index ed9cc576dfb1b7c468bf905da2cc960634162580..eec2b32b03d63718ec61d89c950b32ea545eb792 100644 --- a/modules/catkin_ws/src/VeloxProtocolLib/include/Connection.h +++ b/modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/Connection.h @@ -10,7 +10,7 @@ #include "NetworkingLib/Timer.h" #include "NetworkingLib/TimedValue.h" #include <boost/asio/serial_port.hpp> -#include "../include/mavlink/velox/mavlink.h" +#include "mavlink/velox/mavlink.h" namespace veloxProtocol { diff --git a/modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/checksum.h b/modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/checksum.h similarity index 100% rename from modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/checksum.h rename to modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/checksum.h diff --git a/modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/mavlink_conversions.h b/modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/mavlink_conversions.h similarity index 100% rename from modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/mavlink_conversions.h rename to modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/mavlink_conversions.h diff --git a/modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/mavlink_get_info.h b/modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/mavlink_get_info.h similarity index 100% rename from modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/mavlink_get_info.h rename to modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/mavlink_get_info.h diff --git a/modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/mavlink_helpers.h b/modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/mavlink_helpers.h similarity index 100% rename from modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/mavlink_helpers.h rename to modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/mavlink_helpers.h diff --git a/modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/mavlink_sha256.h b/modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/mavlink_sha256.h similarity index 100% rename from modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/mavlink_sha256.h rename to modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/mavlink_sha256.h diff --git a/modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/mavlink_types.h b/modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/mavlink_types.h similarity index 100% rename from modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/mavlink_types.h rename to modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/mavlink_types.h diff --git a/modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/protocol.h b/modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/protocol.h similarity index 100% rename from modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/protocol.h rename to modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/protocol.h diff --git a/modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/velox/mavlink.h b/modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/velox/mavlink.h similarity index 100% rename from modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/velox/mavlink.h rename to modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/velox/mavlink.h diff --git a/modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/velox/mavlink_msg_carcontrol.h b/modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/velox/mavlink_msg_carcontrol.h similarity index 100% rename from modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/velox/mavlink_msg_carcontrol.h rename to modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/velox/mavlink_msg_carcontrol.h diff --git a/modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/velox/mavlink_msg_cmd_request_clocksync.h b/modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/velox/mavlink_msg_cmd_request_clocksync.h similarity index 100% rename from modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/velox/mavlink_msg_cmd_request_clocksync.h rename to modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/velox/mavlink_msg_cmd_request_clocksync.h diff --git a/modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/velox/mavlink_msg_cmd_request_msg.h b/modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/velox/mavlink_msg_cmd_request_msg.h similarity index 100% rename from modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/velox/mavlink_msg_cmd_request_msg.h rename to modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/velox/mavlink_msg_cmd_request_msg.h diff --git a/modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/velox/mavlink_msg_cmd_request_statechange.h b/modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/velox/mavlink_msg_cmd_request_statechange.h similarity index 100% rename from modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/velox/mavlink_msg_cmd_request_statechange.h rename to modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/velox/mavlink_msg_cmd_request_statechange.h diff --git a/modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/velox/mavlink_msg_error.h b/modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/velox/mavlink_msg_error.h similarity index 100% rename from modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/velox/mavlink_msg_error.h rename to modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/velox/mavlink_msg_error.h diff --git a/modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/velox/mavlink_msg_heartbeat.h b/modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/velox/mavlink_msg_heartbeat.h similarity index 100% rename from modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/velox/mavlink_msg_heartbeat.h rename to modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/velox/mavlink_msg_heartbeat.h diff --git a/modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/velox/mavlink_msg_odometry.h b/modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/velox/mavlink_msg_odometry.h similarity index 100% rename from modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/velox/mavlink_msg_odometry.h rename to modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/velox/mavlink_msg_odometry.h diff --git a/modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/velox/mavlink_msg_trajectory.h b/modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/velox/mavlink_msg_trajectory.h similarity index 100% rename from modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/velox/mavlink_msg_trajectory.h rename to modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/velox/mavlink_msg_trajectory.h diff --git a/modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/velox/testsuite.h b/modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/velox/testsuite.h similarity index 100% rename from modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/velox/testsuite.h rename to modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/velox/testsuite.h diff --git a/modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/velox/velox.h b/modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/velox/velox.h similarity index 100% rename from modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/velox/velox.h rename to modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/velox/velox.h diff --git a/modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/velox/version.h b/modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/velox/version.h similarity index 100% rename from modules/catkin_ws/src/VeloxProtocolLib/include/mavlink/velox/version.h rename to modules/catkin_ws/src/VeloxProtocolLib/include/VeloxProtocolLib/mavlink/velox/version.h diff --git a/modules/catkin_ws/src/VeloxProtocolLib/src/Connection.cpp b/modules/catkin_ws/src/VeloxProtocolLib/src/Connection.cpp index 8b0f1d8e923695eda9c38ee66d4855dabf07e4ea..3118c6f9a9c919567b4067f00cae86a64ab27c17 100644 --- a/modules/catkin_ws/src/VeloxProtocolLib/src/Connection.cpp +++ b/modules/catkin_ws/src/VeloxProtocolLib/src/Connection.cpp @@ -2,7 +2,7 @@ // Created by philipp on 20.04.18. // -#include "../include/Connection.h" +#include "../include/VeloxProtocolLib/Connection.h" namespace veloxProtocol { diff --git a/modules/catkin_ws/src/VeloxProtocolLib/test/Main.cpp b/modules/catkin_ws/src/VeloxProtocolLib/test/Main.cpp index aa2547c8a976f17152aca888ca053ddb6fb67fdc..765cd0b00da050b6c4f074e6df08efe6971e3ab7 100644 --- a/modules/catkin_ws/src/VeloxProtocolLib/test/Main.cpp +++ b/modules/catkin_ws/src/VeloxProtocolLib/test/Main.cpp @@ -2,7 +2,7 @@ // Created by philipp on 20.04.18. // -#include "../include/Connection.h" +#include "../include/VeloxProtocolLib/Connection.h" #include <iostream> int main(int argc, char ** argv) @@ -12,8 +12,11 @@ int main(int argc, char ** argv) auto conn = Connection::create(net); conn->open( "/dev/ttySAC0", - [] - { std::cout << "Update received!\n"; }, + [conn] + { + std::cout << "[Update]\nSpeed=" << conn->getMeasuredSpeed().get() + << "\nSteering Angle: " << conn->getMeasuredSteeringAngle().get(); + }, [] { std::cout << "Connection closed!\n"; }); diff --git a/modules/clean.sh b/modules/clean.sh index 5ec5502192158d2be2cba75aaa3249997cb4013b..b6524a7212cee2b76edc2cf8c9c022810dcea539 100755 --- a/modules/clean.sh +++ b/modules/clean.sh @@ -6,3 +6,4 @@ rm -rf catkin_ws/src/NetworkingLib/cmake-build-debug rm -rf catkin_ws/src/PlatoonProtocolLib/cmake-build-debug rm -rf catkin_ws/src/PC2CarLib/cmake-build-debug rm -rf catkin_ws/src/PC/cmake-build-debug +rm -rf catkin_ws/src/VeloxProtocolLib/cmake-build-debug