diff --git a/NetworkPerception.cpp b/NetworkPerception.cpp index 999ec36..20be813 100644 --- a/NetworkPerception.cpp +++ b/NetworkPerception.cpp @@ -124,11 +124,12 @@ void NetworkPerception::ReceiveSphere(unsigned char *data, Roboid *roboid) { roboid->perception->AddTrackedObject(this, position, Quaternion::identity, 0x81, 0x81, networkId); - roboid->networkSync->SendText("Received Sphere\n\0"); - if ((float)position.horizontalAngle == 0) - roboid->networkSync->SendText("Zero hor angle\0"); - if ((float)position.verticalAngle == 0) - roboid->networkSync->SendText("Zero vertical angle\0"); + // roboid->networkSync->SendText("Received Sphere\n\0"); + // roboid->networkSync->SendInt(position.distance * 100); + // if ((float)position.horizontalAngle == 0) + // roboid->networkSync->SendText("Zero hor angle\0"); + // if ((float)position.verticalAngle == 0) + // roboid->networkSync->SendText("Zero vertical angle\0"); } void NetworkPerception::ReceivePoseMsg(unsigned char *data, Roboid *roboid) { diff --git a/Perception.cpp b/Perception.cpp index 5bce0c0..020a0eb 100644 --- a/Perception.cpp +++ b/Perception.cpp @@ -290,11 +290,11 @@ Perception::AddTrackedObject(Sensor *sensor, Spherical position, // Do we see the same object? else { if (thing->IsTheSameAs(this->trackedObjects[thingIx])) { - if ((float)thing->position.horizontalAngle != - (float)this->trackedObjects[thingIx]->position.horizontalAngle) - this->roboid->networkSync->SendText("Update\0"); - else - this->roboid->networkSync->SendText("Refresh\0"); + // if ((float)thing->position.horizontalAngle != + // (float)this->trackedObjects[thingIx]->position.horizontalAngle) + // this->roboid->networkSync->SendText("Update\0"); + // else + // this->roboid->networkSync->SendText("Refresh\0"); this->trackedObjects[thingIx]->Refresh(thing->position, thing->orientation); delete thing; diff --git a/Roboid.cpp b/Roboid.cpp index 8c8936a..6bef157 100644 --- a/Roboid.cpp +++ b/Roboid.cpp @@ -49,11 +49,10 @@ void Roboid::Update(unsigned long currentTimeMs) { Vector3::up)); } - // if (actuation != nullptr) - // actuation->Update(currentTimeMs); if (childCount > 0 && children != nullptr) { - for (unsigned char childIx = 0; childIx < this->childCount; childIx++) + for (unsigned char childIx = 0; childIx < this->childCount; childIx++) { children[childIx]->Update(currentTimeMs); + } } if (networkSync != nullptr) diff --git a/ServoMotor.cpp b/ServoMotor.cpp index 641c57c..6667fca 100644 --- a/ServoMotor.cpp +++ b/ServoMotor.cpp @@ -43,7 +43,7 @@ void ServoMotor::SetTargetVelocity(float targetVelocity) { float ServoMotor::GetTargetVelocity() { return this->targetVelocity; } -void ServoMotor::Update(float currentTimeMs) { +void ServoMotor::Update(unsigned long currentTimeMs) { for (unsigned char childIx = 0; childIx < this->childCount; childIx++) { Thing *child = this->GetChild(childIx); if (child != nullptr && child->type == Thing::ServoType) { diff --git a/ServoMotor.h b/ServoMotor.h index 0c8b795..eb0d1e1 100644 --- a/ServoMotor.h +++ b/ServoMotor.h @@ -24,7 +24,7 @@ public: virtual void SetTargetVelocity(float velocity); virtual float GetTargetVelocity(); - virtual void Update(float currentTimeMs); + virtual void Update(unsigned long currentTimeMs) override; protected: bool hasTargetAngle = false;