FIX: fixed bugs from changing simcore
This commit is contained in:
@@ -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_;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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_;
|
||||
|
||||
|
||||
Submodule libs/KubeControl updated: 89465f06a5...49b36053d7
Submodule libs/SimCore updated: a390f73334...c8061ca068
@@ -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);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -131,6 +139,8 @@ namespace Entities
|
||||
|
||||
stopMainLoop = true;
|
||||
|
||||
BroadcastServer_.reset();
|
||||
|
||||
|
||||
|
||||
for (std::vector<std::thread>::iterator it = threads.begin(); it != threads.end();)
|
||||
@@ -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));
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user