Fix MacOS compatibility issues

This commit is contained in:
Pascal Serrarens 2025-06-09 12:07:50 +02:00
parent c2ac149df6
commit 315c37d3bf
3 changed files with 5 additions and 5 deletions

View File

@ -70,7 +70,7 @@ bool Participant::Send(IMessage* msg) {
return thisWindows->Send(remoteParticipant, bufferSize);
#elif defined(__unix__) || defined(__APPLE__)
Posix::ParticipantUDP* thisPosix = static_cast<Posix::ParticipantUDP*>(this);
return thisPosix->Send(remoteParticipant, bufferSize);
return thisPosix->Send(this, bufferSize);
#elif defined(ARDUINO)
Arduino::ParticipantUDP* thisArduino =
static_cast<Arduino::ParticipantUDP*>(this);

View File

@ -27,10 +27,10 @@ int main() {
while (true) {
// The left wheel turns forward when nothing is touched on the right side
// and turn backward when the roboid hits something on the right
float leftWheelSpeed = (touchRight.internalTouch) ? -600.0f : 600.0f;
float leftWheelSpeed = (touchRight.IsTouching()) ? -600.0f : 600.0f;
// The right wheel does the same, but instead is controlled by
// touches on the left side
float rightWheelSpeed = (touchLeft.internalTouch) ? -600.0f : 600.0f;
float rightWheelSpeed = (touchLeft.IsTouching()) ? -600.0f : 600.0f;
// When both sides are touching something, both wheels will turn backward
// and the roboid will move backwards
bb2b.SetWheelVelocity(leftWheelSpeed, rightWheelSpeed);

View File

@ -15,7 +15,7 @@ TEST(RoboidControlSuite, HiddenParticipant) {
unsigned long milliseconds = Thing::GetTimeMs();
unsigned long startTime = milliseconds;
while (milliseconds < startTime + 1000) {
Thing::UpdateThings();
thing->Update();
milliseconds = Thing::GetTimeMs();
}
@ -23,7 +23,7 @@ TEST(RoboidControlSuite, HiddenParticipant) {
}
TEST(RoboidControlSuite, IsolatedParticipant) {
ParticipantUDP* participant = ParticipantUDP::Isolated();
ParticipantUDP* participant = new ParticipantUDP(0);
Thing* thing = new Thing();
unsigned long milliseconds = Thing::GetTimeMs();