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 "WHISPER/Messages/Message.hpp"
|
||||
#include <SimCore/Messages/SimTrack.hpp>
|
||||
@@ -181,20 +182,37 @@ namespace SimCore
|
||||
if (trackMsg.has_geocentricposition())
|
||||
{
|
||||
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())
|
||||
{
|
||||
track.Speed.setValue(trackMsg.contactspeed());
|
||||
}else
|
||||
{
|
||||
track.Speed.setValue(0);
|
||||
}
|
||||
|
||||
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())
|
||||
{
|
||||
track.RCS.setValue(trackMsg.contactrcs());
|
||||
}else
|
||||
|
||||
Reference in New Issue
Block a user