Skip to content
Snippets Groups Projects
Commit 274353dd authored by Hoop77's avatar Hoop77
Browse files

PC programm sends command

parent d088c920
Branches
No related merge requests found
cmake_minimum_required(VERSION 3.9)
project(PC)
set(CMAKE_CXX_FLAGS "-pthread")
set(CMAKE_CXX_STANDARD 14)
set(LOCAL_INSTALL_DIR ${CMAKE_CURRENT_LIST_DIR}/../../install)
set(CMAKE_PREFIX_PATH "${LOCAL_INSTALL_DIR}")
find_package(Boost REQUIRED COMPONENTS regex system)
find_package(NetworkingLib REQUIRED)
find_package(PlatoonProtocolLib REQUIRED)
find_package(PC2CarLib REQUIRED)
set(SOURCE_FILES
src/main.cpp
......@@ -12,4 +21,9 @@ set(SOURCE_FILES
add_executable(PC ${SOURCE_FILES})
target_link_libraries(PC ${Boost_LIBRARIES})
\ No newline at end of file
target_link_libraries(PC ${Boost_LIBRARIES})
target_include_directories(PC PUBLIC ${PC2CarLib_INCLUDE_DIRS})
target_link_libraries(PC NetworkingLib)
target_link_libraries(PC PlatoonProtocolLib)
target_link_libraries(PC PC2CarLib)
\ No newline at end of file
#include "../include/Logging.h"
#include "PC2CarLib/CommandSender.h"
int main()
{
networking::Networking net;
pc::Logging logging{10207};
pc2car::CommandSender commandSender{net, "127.0.0.1"};
std::thread commandThread{
[&commandSender]
{
float speed = 0.0f;
while (true)
{
using namespace std::chrono_literals;
commandSender.setPlatoonSpeed(speed++);
std::this_thread::sleep_for(1s);
}
}};
logging.start();
return 0;
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment