FIX: added some default values to the unpacking function
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
#include "SimCore/Position.hpp"
|
||||||
#include "SimCore/SimCore.hpp"
|
#include "SimCore/SimCore.hpp"
|
||||||
#include "WHISPER/Messages/Message.hpp"
|
#include "WHISPER/Messages/Message.hpp"
|
||||||
#include <SimCore/Messages/SimTrack.hpp>
|
#include <SimCore/Messages/SimTrack.hpp>
|
||||||
@@ -181,17 +182,34 @@ namespace SimCore
|
|||||||
if (trackMsg.has_geocentricposition())
|
if (trackMsg.has_geocentricposition())
|
||||||
{
|
{
|
||||||
track.setPosition(trackMsg.mutable_geocentricposition()->x(), trackMsg.mutable_geocentricposition()->y(), trackMsg.mutable_geocentricposition()->z());
|
track.setPosition(trackMsg.mutable_geocentricposition()->x(), trackMsg.mutable_geocentricposition()->y(), trackMsg.mutable_geocentricposition()->z());
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
Position tmpPos;
|
||||||
|
tmpPos.setGeodesicPos(0, 0, 0);
|
||||||
|
track.setPosition(tmpPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (trackMsg.has_contactcourse())
|
||||||
|
{
|
||||||
|
track.Course.setValue(trackMsg.contactcourse());
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
track.Course.setValue(0);
|
||||||
|
}
|
||||||
|
|
||||||
if (trackMsg.has_contactspeed())
|
if (trackMsg.has_contactspeed())
|
||||||
{
|
{
|
||||||
track.Speed.setValue(trackMsg.contactspeed());
|
track.Speed.setValue(trackMsg.contactspeed());
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
track.Speed.setValue(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trackMsg.has_conactpitch())
|
if (trackMsg.has_conactpitch())
|
||||||
{
|
{
|
||||||
track.Pitch.setValue(trackMsg.contactspeed());
|
track.Pitch.setValue(trackMsg.conactpitch());
|
||||||
|
}else {
|
||||||
|
track.Pitch.setValue(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trackMsg.has_contactrcs())
|
if (trackMsg.has_contactrcs())
|
||||||
|
|||||||
Reference in New Issue
Block a user