Removed unused variable
This commit is contained in:
parent
b6abc6725c
commit
6eefd5892c
@ -2,7 +2,8 @@
|
||||
|
||||
#include "RoboidControl/NetworkSync.h"
|
||||
|
||||
void NetworkPerception::ProcessPacket(Roboid *roboid, unsigned char *buffer,
|
||||
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]);
|
||||
@ -12,7 +13,7 @@ void NetworkPerception::ProcessPacket(Roboid *roboid, unsigned char *buffer,
|
||||
}
|
||||
}
|
||||
|
||||
Int32 NetworkPerception::ReceiveInt32(unsigned char *data, int startIndex) {
|
||||
Int32 NetworkPerception::ReceiveInt32(unsigned char* data, int startIndex) {
|
||||
Int32 a = Int32((UInt32)(data[startIndex + 3]) << 24 |
|
||||
(UInt32)(data[startIndex + 2]) << 16 |
|
||||
(UInt32)(data[startIndex + 1]) << 8 |
|
||||
@ -20,13 +21,13 @@ Int32 NetworkPerception::ReceiveInt32(unsigned char *data, int startIndex) {
|
||||
return a;
|
||||
}
|
||||
|
||||
float NetworkPerception::ReceiveFloat100(unsigned char *data, int startIndex) {
|
||||
float NetworkPerception::ReceiveFloat100(unsigned char* data, int startIndex) {
|
||||
Int32 intValue = ReceiveInt32(data, startIndex);
|
||||
float f = (float)intValue / 100.0F;
|
||||
return f;
|
||||
}
|
||||
|
||||
Vector3 NetworkPerception::ReceiveVector3(unsigned char *data, int startIndex) {
|
||||
Vector3 NetworkPerception::ReceiveVector3(unsigned char* data, int startIndex) {
|
||||
float x = ReceiveFloat100(data, startIndex);
|
||||
float y = ReceiveFloat100(data, startIndex + 4);
|
||||
float z = ReceiveFloat100(data, startIndex + 8);
|
||||
@ -34,9 +35,9 @@ Vector3 NetworkPerception::ReceiveVector3(unsigned char *data, int startIndex) {
|
||||
return v;
|
||||
}
|
||||
|
||||
void NetworkPerception::ReceiveObject(unsigned char *data, Roboid *roboid) {
|
||||
void NetworkPerception::ReceiveObject(unsigned char* data, Roboid* roboid) {
|
||||
unsigned char objectId = data[1];
|
||||
char poseType = data[2];
|
||||
// char poseType = data[2];
|
||||
Vector3 worldPosition = ReceiveVector3(data, 3);
|
||||
Vector3 worldAngles = ReceiveVector3(data, 15);
|
||||
Quaternion worldOrientation = Quaternion::Euler(worldAngles);
|
||||
@ -48,7 +49,7 @@ void NetworkPerception::ReceiveObject(unsigned char *data, Roboid *roboid) {
|
||||
// worldPosition.z, worldDirection.x, worldDirection.z);
|
||||
|
||||
} else {
|
||||
Vector3 myPosition = roboid->GetPosition(); // Vector3::zero;
|
||||
Vector3 myPosition = roboid->GetPosition(); // Vector3::zero;
|
||||
Vector2 myPosition2 = Vector3::ProjectHorizontalPlane(myPosition);
|
||||
Quaternion myOrientation = roboid->GetOrientation();
|
||||
Vector3 myDirection = myOrientation * Vector3::forward;
|
||||
|
@ -8,16 +8,16 @@ namespace Passer {
|
||||
namespace RoboidControl {
|
||||
|
||||
class NetworkPerception : public Sensor {
|
||||
public:
|
||||
void ProcessPacket(Roboid *roboid, unsigned char *buffer, int packetsize);
|
||||
public:
|
||||
void ProcessPacket(Roboid* roboid, unsigned char* buffer, int packetsize);
|
||||
|
||||
protected:
|
||||
void ReceiveObject(unsigned char *data, Roboid *roboid);
|
||||
protected:
|
||||
void ReceiveObject(unsigned char* data, Roboid* roboid);
|
||||
|
||||
Int32 ReceiveInt32(unsigned char *data, int startIndex);
|
||||
float ReceiveFloat100(unsigned char *data, int startIndex);
|
||||
Vector3 ReceiveVector3(unsigned char *data, int startIndex);
|
||||
Int32 ReceiveInt32(unsigned char* data, int startIndex);
|
||||
float ReceiveFloat100(unsigned char* data, int startIndex);
|
||||
Vector3 ReceiveVector3(unsigned char* data, int startIndex);
|
||||
};
|
||||
|
||||
} // namespace RoboidControl
|
||||
} // namespace Passer
|
||||
} // namespace RoboidControl
|
||||
} // namespace Passer
|
Loading…
x
Reference in New Issue
Block a user