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,
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) {

View File

@ -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;

View File

@ -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)

View File

@ -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) {

View File

@ -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;