Fixed poseType check
This commit is contained in:
parent
c2daeb2657
commit
4272d912b9
@ -4,8 +4,8 @@
|
||||
|
||||
void NetworkPerception::ProcessPacket(Roboid *roboid, unsigned char *buffer,
|
||||
int packetsize) {
|
||||
// printf("packet received, type = 0x%02x %d %d %d %d\n", buffer[0],
|
||||
// buffer[2], buffer[3], buffer[4], buffer[5]);
|
||||
// printf("packet received, type = 0x%02x %d %d %d %d %d\n", buffer[0],
|
||||
// buffer[2], buffer[2], buffer[3], buffer[4], buffer[5]);
|
||||
|
||||
if (buffer[0] == NetworkSync::PoseMsg) {
|
||||
ReceiveObject(buffer, roboid);
|
||||
@ -79,8 +79,8 @@ void NetworkPerception::ReceiveObject(unsigned char *data, Roboid *roboid) {
|
||||
}
|
||||
}
|
||||
|
||||
// HACK!!!
|
||||
#include "../../../src/LighthouseTracker.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
void NetworkPerception::ReceiveTypedObject(unsigned char *data,
|
||||
Roboid *roboid) {
|
||||
@ -88,8 +88,10 @@ void NetworkPerception::ReceiveTypedObject(unsigned char *data,
|
||||
unsigned char objectId = data[2];
|
||||
if (objectType == 0x02) { // lighthouse
|
||||
// We require position and orientation for lighthouses
|
||||
if (data[3] != NetworkSync::Pose_Position | NetworkSync::Pose_Orientation)
|
||||
if (data[3] !=
|
||||
(NetworkSync::Pose_Position | NetworkSync::Pose_Orientation)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Vector3 worldPosition = ReceiveVector3(data, 4);
|
||||
Vector3 worldAngles = ReceiveVector3(data, 16);
|
||||
@ -102,6 +104,4 @@ void NetworkPerception::ReceiveTypedObject(unsigned char *data,
|
||||
LighthouseTracker *lhSensor = (LighthouseTracker *)sensor;
|
||||
lhSensor->UpdateGeometry(objectId, worldPosition, worldOrientation);
|
||||
}
|
||||
|
||||
Serial.printf("Typed Object received\n");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user