This commit is contained in:
Pascal Serrarens 2024-06-17 14:30:39 +02:00
parent c299bb0018
commit bca786534d
5 changed files with 15 additions and 15 deletions

View File

@ -124,11 +124,12 @@ void NetworkPerception::ReceiveSphere(unsigned char *data, Roboid *roboid) {
roboid->perception->AddTrackedObject(this, position, Quaternion::identity, roboid->perception->AddTrackedObject(this, position, Quaternion::identity,
0x81, 0x81, networkId); 0x81, 0x81, networkId);
roboid->networkSync->SendText("Received Sphere\n\0"); // roboid->networkSync->SendText("Received Sphere\n\0");
if ((float)position.horizontalAngle == 0) // roboid->networkSync->SendInt(position.distance * 100);
roboid->networkSync->SendText("Zero hor angle\0"); // if ((float)position.horizontalAngle == 0)
if ((float)position.verticalAngle == 0) // roboid->networkSync->SendText("Zero hor angle\0");
roboid->networkSync->SendText("Zero vertical angle\0"); // if ((float)position.verticalAngle == 0)
// roboid->networkSync->SendText("Zero vertical angle\0");
} }
void NetworkPerception::ReceivePoseMsg(unsigned char *data, Roboid *roboid) { void NetworkPerception::ReceivePoseMsg(unsigned char *data, Roboid *roboid) {

View File

@ -290,11 +290,11 @@ Perception::AddTrackedObject(Sensor *sensor, Spherical position,
// Do we see the same object? // Do we see the same object?
else { else {
if (thing->IsTheSameAs(this->trackedObjects[thingIx])) { if (thing->IsTheSameAs(this->trackedObjects[thingIx])) {
if ((float)thing->position.horizontalAngle != // if ((float)thing->position.horizontalAngle !=
(float)this->trackedObjects[thingIx]->position.horizontalAngle) // (float)this->trackedObjects[thingIx]->position.horizontalAngle)
this->roboid->networkSync->SendText("Update\0"); // this->roboid->networkSync->SendText("Update\0");
else // else
this->roboid->networkSync->SendText("Refresh\0"); // this->roboid->networkSync->SendText("Refresh\0");
this->trackedObjects[thingIx]->Refresh(thing->position, this->trackedObjects[thingIx]->Refresh(thing->position,
thing->orientation); thing->orientation);
delete thing; delete thing;

View File

@ -49,12 +49,11 @@ void Roboid::Update(unsigned long currentTimeMs) {
Vector3::up)); Vector3::up));
} }
// if (actuation != nullptr)
// actuation->Update(currentTimeMs);
if (childCount > 0 && children != nullptr) { 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); children[childIx]->Update(currentTimeMs);
} }
}
if (networkSync != nullptr) if (networkSync != nullptr)
networkSync->NetworkUpdate(this); networkSync->NetworkUpdate(this);

View File

@ -43,7 +43,7 @@ void ServoMotor::SetTargetVelocity(float targetVelocity) {
float ServoMotor::GetTargetVelocity() { return this->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++) { for (unsigned char childIx = 0; childIx < this->childCount; childIx++) {
Thing *child = this->GetChild(childIx); Thing *child = this->GetChild(childIx);
if (child != nullptr && child->type == Thing::ServoType) { if (child != nullptr && child->type == Thing::ServoType) {

View File

@ -24,7 +24,7 @@ public:
virtual void SetTargetVelocity(float velocity); virtual void SetTargetVelocity(float velocity);
virtual float GetTargetVelocity(); virtual float GetTargetVelocity();
virtual void Update(float currentTimeMs); virtual void Update(unsigned long currentTimeMs) override;
protected: protected:
bool hasTargetAngle = false; bool hasTargetAngle = false;