ADD: added new version of entity base class
This commit is contained in:
@@ -2,8 +2,10 @@
|
||||
|
||||
|
||||
|
||||
#include "DirectCommunicationServer.hpp"
|
||||
#include "Entities/Movement.hpp"
|
||||
#include "SimCore/Messages/GroundThruthTrack.hpp"
|
||||
#include "SimCore/Messages/SimTrack.hpp"
|
||||
#include "SimCore/Messages/Track.hpp"
|
||||
#include "SimCore/Orientation.hpp"
|
||||
#include "SimCore/SafeMap.hpp"
|
||||
@@ -53,62 +55,61 @@ namespace Entities {
|
||||
SimCore::Identifier ParentID,
|
||||
SimCore::EntityKind EntityKind,
|
||||
std::uint32_t GroundTruthPort,
|
||||
std::uint32_t CommandPort,
|
||||
std::string CommandIPAddress);
|
||||
ushort CommandPort);
|
||||
~Entity();
|
||||
|
||||
void start();
|
||||
void stop();
|
||||
void setPosition(SimCore::Position);
|
||||
void setSpeed(double speed);
|
||||
void setCourse(double course);
|
||||
void setPitch( double pitch);
|
||||
|
||||
protected:
|
||||
|
||||
std::shared_ptr<WHISPER::threadSafeQueue<WHISPER::Message>> incommingCommandMessages = nullptr;
|
||||
std::shared_ptr<WHISPER::threadSafeQueue<WHISPER::Message>> outgoingCommandMessages = nullptr;
|
||||
|
||||
|
||||
virtual void specificPhysicsCalculations(std::chrono::milliseconds::rep duration) = 0;
|
||||
virtual void specificReloadCharacteristicts() = 0;
|
||||
|
||||
std::unique_ptr<Entities::Movement> Movement_ = nullptr;
|
||||
|
||||
protected:
|
||||
|
||||
std::shared_ptr<SimCore::SimTrack> OwnShipTrack = nullptr;
|
||||
|
||||
std::string EntityName_;
|
||||
SimCore::GroundTruthTrack ownTrack_;
|
||||
SimCore::Identifier ParentID_;
|
||||
SimCore::EntityKind EntityKind_;
|
||||
std::uint32_t GroundTruthPort_;
|
||||
std::uint32_t CommandPort_;
|
||||
std::string CommandIPAddress_;
|
||||
|
||||
ushort MovemntWorkerPort_;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
std::vector<std::thread> threads;
|
||||
|
||||
std::atomic<bool> stopMainLoop = false;
|
||||
void MainLoop();
|
||||
|
||||
|
||||
void startMovementWorker();
|
||||
std::atomic<bool> MovementWorkerStarted = false;
|
||||
std::shared_ptr<DirectCommunication::DirectCommunicationServer> MovemtServer_ = nullptr;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
std::atomic<bool> stopCommandWorker = false;
|
||||
std::atomic<bool> stopSensorWorker = false;
|
||||
std::atomic<bool> stopTrackWorker = false;
|
||||
std::atomic<bool> stopPhysicsWorker = false;
|
||||
|
||||
|
||||
std::atomic<bool> physicsIsRunning = false;
|
||||
|
||||
|
||||
void CommandWorker();
|
||||
void SensorWorker();
|
||||
void TrackWorker();
|
||||
void physicsWorker();
|
||||
|
||||
|
||||
void startSensor();
|
||||
|
||||
|
||||
|
||||
std::shared_ptr<WHISPER::InternalUDPSender> GroundTruthUDPSender_ = nullptr;
|
||||
|
||||
std::shared_ptr<std::list<Entities::SensorClientData>> SensorStore_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user