diff --git a/.gitmodules b/.gitmodules index 25afe2d..e20bbe9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "libs/json"] path = libs/json url = https://github.com/nlohmann/json.git +[submodule "libs/whisper-com"] + path = libs/SimCore/libs/whisper-com + url = ssh://git@dev-gitea.ftewa.ti.unibw-hamburg.de:12000/hwinkel/whisper-com.git diff --git a/include/Entities/Entity.hpp b/include/Entities/Entity.hpp index 6f9c0aa..7dcfc4b 100644 --- a/include/Entities/Entity.hpp +++ b/include/Entities/Entity.hpp @@ -4,6 +4,7 @@ #include "SimCore/Messages/GroundThruthTrack.hpp" #include "SimCore/Messages/Track.hpp" +#include "SimCore/Orientation.hpp" #include "SimCore/SafeMap.hpp" #include "SimCore/SimCore.hpp" @@ -53,7 +54,8 @@ namespace Entities { std::uint32_t GroundTruthPort, std::uint32_t CommandPort, std::string CommandIPAddress); - // ~Entity(); + ~Entity(); + void start(); void stop(); @@ -67,6 +69,8 @@ namespace Entities { virtual void specificReloadCharacteristicts() = 0; std::shared_ptr ownShipPosition_ = nullptr; + std::shared_ptr ownShipOrientation_ = nullptr; + private: diff --git a/libs/SimCore b/libs/SimCore index 086f5d1..e83e291 160000 --- a/libs/SimCore +++ b/libs/SimCore @@ -1 +1 @@ -Subproject commit 086f5d109e6272813cb5b18f2a8c143f71707a6a +Subproject commit e83e29190d69f35ecdb50786e8583511fb774fb3 diff --git a/libs/json b/libs/json index b230614..546370c 160000 --- a/libs/json +++ b/libs/json @@ -1 +1 @@ -Subproject commit b2306145e1789368e6f261680e8dc007e91cc986 +Subproject commit 546370c9e778d99e7176641123e5cc1d0b62acab diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index 8844cfe..26625ee 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -25,7 +25,8 @@ namespace Entities SimCore::EntityKind EntityKind, std::uint32_t GroundTruthPort, std::uint32_t CommandPort, - std::string CommandIPAddress):EntityName_(EnttityName), + std::string CommandIPAddress): + EntityName_(EnttityName), ownTrack_(OwnType, OwnID, SimCore::TrackKind::GROUND_TRUTH_TRACK), ParentID_(ParentID), EntityKind_(EntityKind), @@ -37,6 +38,12 @@ namespace Entities } + + Entity::~Entity() + { + stop(); + } + void Entity::start() { @@ -68,21 +75,19 @@ namespace Entities // } - for (std::vector::iterator it = threads.begin(); it != threads.end();) - { - if (it->joinable()) + for (std::vector::iterator it = threads.begin(); it != threads.end();) { - it->join(); - it = threads.erase(it); + if (it->joinable()) + { + it->join(); + it = threads.erase(it); + } + } - - } LOG_S(ERROR)<< threads.size(); - - } void Entity::physicsWorker() diff --git a/tests/test_EntityClass.cpp b/tests/test_EntityClass.cpp index a7be914..2469ab8 100644 --- a/tests/test_EntityClass.cpp +++ b/tests/test_EntityClass.cpp @@ -1,5 +1,7 @@ #include "SimCore/Identifier.hpp" +#include "SimCore/Orientation.hpp" +#include "SimCore/Position.hpp" #include "WHISPER/Messages/Message.hpp" #include #include @@ -23,13 +25,16 @@ class Ship : public Entities::Entity std::string CommandIPAddress): Entity( OwnID,EntityName,ownType, ParentID, EntityKind, GroundTruthPort, CommandPort, CommandIPAddress) { - + this->ownShipPosition_ = std::make_shared(); + this->ownShipOrientation_ = std::make_shared(); } private: void specificPhysicsCalculations(std::chrono::milliseconds::rep duration) override { + + LOG_S(INFO)<<"calculating every " << duration << "milliseconds"; };