ADD: added Movement calculation and a Tracklist class
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <tuple>
|
||||
#define CATCH_CONFIG_MAIN
|
||||
#include <catch2/catch.hpp>
|
||||
#include <Entities/Entity.hpp>
|
||||
@@ -25,21 +26,35 @@ class Ship : public Entities::Entity
|
||||
std::string CommandIPAddress):
|
||||
Entity( OwnID,EntityName,ownType, ParentID, EntityKind, GroundTruthPort, CommandPort, CommandIPAddress)
|
||||
{
|
||||
this->ownShipPosition_ = std::make_shared<SimCore::Position>();
|
||||
this->ownShipOrientation_ = std::make_shared<SimCore::Orientation>();
|
||||
SimCore::Position pos1;
|
||||
pos1.setGeodesicPos(55, 6, 0);
|
||||
Movement_.setPosition(pos1);
|
||||
Movement_.setCourse(0);
|
||||
Movement_.setSpeed(100);
|
||||
|
||||
LOG_S(INFO)<<std::endl<<Movement_.getPosition().getGeodesicPos();
|
||||
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
void specificPhysicsCalculations(std::chrono::milliseconds::rep duration) override
|
||||
{
|
||||
SimCore::Position pos1;
|
||||
pos1.setGeodesicPos(55, 6, 0);
|
||||
|
||||
|
||||
LOG_S(INFO)<<"calculating every " << duration << "milliseconds";
|
||||
|
||||
LOG_S(INFO)<<std::endl<<Movement_.getPosition().getGeodesicPos();
|
||||
double distance, bearing1;
|
||||
std::tie(distance, bearing1) = Movement_.getPosition().distanceBearingToPosition(pos1);
|
||||
LOG_S(INFO)<<"distance from start is:" << distance;
|
||||
LOG_S(INFO)<<"calculating every " << duration << " milliseconds";
|
||||
};
|
||||
|
||||
void specificReloadCharacteristicts() override
|
||||
{
|
||||
|
||||
|
||||
LOG_S(INFO)<<"loading specifications";
|
||||
};
|
||||
};
|
||||
@@ -55,7 +70,7 @@ SCENARIO("Testing the SimCore Sensor")
|
||||
SimCore::Identifier ID1(0,2,false);
|
||||
Ship Ship(ID1,"FGS Hamburg",WHISPER::SourceType::SHIP,IDParent,SimCore::EntityKind::SURFACE,8000,8001,"127.0.0.1");
|
||||
Ship.start();
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(5000));
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10000));
|
||||
Ship.stop();
|
||||
WHEN("constructing Track Object with data")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user