Skip to content
Snippets Groups Projects
Commit 9a62a10d authored by Franz Bethke's avatar Franz Bethke
Browse files

Merge

parents 4d19a4c3 90be5046
No related merge requests found
cmake_minimum_required(VERSION 3.5.1)
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
......@@ -13,3 +22,8 @@ set(SOURCE_FILES
add_executable(PC ${SOURCE_FILES})
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
......@@ -22,6 +22,10 @@ using InnerPlatoonDistance = float;
struct PlatoonConfig
{
PlatoonConfig(PlatoonSpeed platoonSpeed, InnerPlatoonDistance innerPlatoonDistance)
: platoonSpeed(platoonSpeed), innerPlatoonDistance(innerPlatoonDistance)
{}
PlatoonSpeed platoonSpeed;
InnerPlatoonDistance innerPlatoonDistance;
};
......
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