FIX: fixed bugs from changing simcore

This commit is contained in:
Henry Winkel
2023-09-27 16:21:30 +02:00
parent 4d06ca48b4
commit 0a182bb8df
5 changed files with 27 additions and 10 deletions

View File

@@ -53,7 +53,9 @@ namespace Entities {
Entity(const SimCore::Identifier OwnID,
std::string EnttityName,
WHISPER::SourceType OwnType,
SimCore::EntityKind EntityKind,
SimCore::Kind::EntityKind EntityKind,
SimCore::Side::EntitySide EntitySide,
std::string GroundTruthAddr,
std::uint32_t GroundTruthPort,
ushort CommandPort,
bool online);
@@ -78,12 +80,16 @@ namespace Entities {
std::shared_ptr<SimCore::SimTrack> OwnShipTrack = nullptr;
std::string EntityName_;
SimCore::EntityKind EntityKind_;
SimCore::Kind::EntityKind EntityKind_;
SimCore::Side::EntitySide EntitySide_;
ushort MovemntWorkerPort_;
std::unique_ptr<kubecontrol::PodController> PodController_;
std::shared_ptr<WHISPER::InternalUDPSender> BroadcastServer_;

View File

@@ -83,7 +83,7 @@ namespace TrackList {
///range in meters
double range_;
//environment (AIR,SURFACE,SUBSURFACE,SPACE)
SimCore::EntityKind environemnt_;
SimCore::Kind::EntityKind kind_;
std::chrono::time_point<std::chrono::steady_clock> lastUpdateTimestamp_;

View File

@@ -38,17 +38,20 @@ namespace Entities
Entity::Entity(const SimCore::Identifier OwnID,
std::string EnttityName,
WHISPER::SourceType OwnType,
SimCore::EntityKind EntityKind,
SimCore::Kind::EntityKind EntityKind,
SimCore::Side::EntitySide EntitySide,
std::string GroundTruthAddr,
std::uint32_t GroundTruthPort,
ushort CommandPort,
bool online):
EntityName_(EnttityName),
EntityKind_(EntityKind),
EntitySide_(EntitySide),
online_(online)
{
PodController_ = std::make_unique<kubecontrol::PodController>("docs/config");
OwnShipTrack = std::make_shared<SimCore::SimTrack>(OwnID, EnttityName, EntityKind);
OwnShipTrack = std::make_shared<SimCore::SimTrack>(OwnID, EnttityName, EntityKind,EntitySide);
OwnShipTrack->setPosition(SimCore::Position());
MovemtServer_ = std::make_shared<DirectCommunication::DirectCommunicationServer>(__MOVEMENT_SERVER_PORT__);
@@ -56,6 +59,11 @@ namespace Entities
CommandCommsServer_ = std::make_shared<DirectCommunication::DirectCommunicationServer>(CommandPort);
CommandCommsServer_->registerMessageCallback(std::bind(&Entity::handleExternalComms,this,std::placeholders::_1));
BroadcastServer_ = std::make_shared<WHISPER::InternalUDPSender>(GroundTruthAddr, GroundTruthPort);
// BroadcastServer_ = std::make_shared<WHISPER::InternalUDPSender>("239.0.0.1", 10000);
}
@@ -130,6 +138,8 @@ namespace Entities
MovemtServer_.reset();
stopMainLoop = true;
BroadcastServer_.reset();
@@ -155,7 +165,8 @@ namespace Entities
LOG_S(INFO)<<"__ONLINE__";
MovementPodUUID_ = xg::newGuid().str();
LOG_S(INFO)<<this->OwnShipTrack->getIdentifier().getUUID();
auto MovementPod = kubecontrol::KubePod(this->OwnShipTrack->getIdentifier().getUUID(),MovementPodUUID_,"movementimage:latest");
kubecontrol::KubePod MovementPod(this->OwnShipTrack->getIdentifier().getUUID(),MovementPodUUID_,"movementimage:latest");
MovementPod.setEnvironmentVar("SERVER_IP", SimCore::UtilFunctions::getOwnIP());
MovementPod.setComponent("MovementCalculation");
LOG_S(INFO)<< MovementPod.createYAML();
@@ -203,7 +214,7 @@ namespace Entities
MovementWorkerStarted = false;
LOG_S(WARNING)<<"Movementclient lost";
}
std::this_thread::sleep_for(std::chrono::milliseconds(500));
// std::this_thread::sleep_for(std::chrono::milliseconds(500));
}
@@ -286,7 +297,7 @@ namespace Entities
handleMovement();
childWorker();
std::this_thread::sleep_for(std::chrono::milliseconds(500));
std::this_thread::sleep_for(std::chrono::milliseconds(33));
}