1 Star 0 Fork 4

sjhscysk/LYGSim

forked from OSGLYG/LYGSim 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
LYGBasePlane.cpp 1.39 KB
一键复制 编辑 原始数据 按行查看 历史
#include "LYGBasePlane.h"
#include "LYGConversion.h"
LYGBasePlane::LYGBasePlane()
:m_Pos(LYGPoint(0,0)),m_DestinationPos(LYGPoint(100,100))
{
m_MotionParam = boost::make_shared<MotionParam>();
}
LYGBasePlane::~LYGBasePlane()
{
}
bool LYGBasePlane::operator == (const LYGBasePlane & other)
{
if (m_Name == other.m_Name)
{
return true;
}
return false;
}
void LYGBasePlane::addSensor(LYGBaseSensorPtr sensor)
{
m_SensorVec.push_back(sensor);
}
std::vector<LYGBaseSensorPtr> LYGBasePlane::getSensors()
{
return m_SensorVec;
}
void LYGBasePlane::setPos(LYGPoint pos)
{
m_Pos = pos;
}
LYGPoint LYGBasePlane::getPos()
{
return m_Pos;
}
void LYGBasePlane::setName(std::string name)
{
m_Name = name;
}
std::string LYGBasePlane::getName()
{
return m_Name;
}
void LYGBasePlane::setDestinationPos(LYGPoint destinationPos)
{
m_DestinationPos = destinationPos;
}
LYGPoint LYGBasePlane::getDestinationPos()
{
return m_DestinationPos;
}
void LYGBasePlane::fly()
{
LYGPoint dir = getDestinationPos() - getPos();
double head = 0.0;
double pitch = 0.0;
LYGConversion::instance()->ComputeHeadPitch(dir, getPos(), head, pitch);
double newX = m_Pos.GetX() + m_MotionParam->speed * cos(head);
m_Pos.SetX(newX);
double newY = m_Pos.GetY() + m_MotionParam->speed * sin(head);
m_Pos.SetY(newY);
}
void LYGBasePlane::start()
{
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/sjhscysk/lygsim.git
git@gitee.com:sjhscysk/lygsim.git
sjhscysk
lygsim
LYGSim
master

搜索帮助