Fix MacOS compatibility issues
This commit is contained in:
parent
c2ac149df6
commit
315c37d3bf
@ -70,7 +70,7 @@ bool Participant::Send(IMessage* msg) {
|
|||||||
return thisWindows->Send(remoteParticipant, bufferSize);
|
return thisWindows->Send(remoteParticipant, bufferSize);
|
||||||
#elif defined(__unix__) || defined(__APPLE__)
|
#elif defined(__unix__) || defined(__APPLE__)
|
||||||
Posix::ParticipantUDP* thisPosix = static_cast<Posix::ParticipantUDP*>(this);
|
Posix::ParticipantUDP* thisPosix = static_cast<Posix::ParticipantUDP*>(this);
|
||||||
return thisPosix->Send(remoteParticipant, bufferSize);
|
return thisPosix->Send(this, bufferSize);
|
||||||
#elif defined(ARDUINO)
|
#elif defined(ARDUINO)
|
||||||
Arduino::ParticipantUDP* thisArduino =
|
Arduino::ParticipantUDP* thisArduino =
|
||||||
static_cast<Arduino::ParticipantUDP*>(this);
|
static_cast<Arduino::ParticipantUDP*>(this);
|
||||||
|
@ -27,10 +27,10 @@ int main() {
|
|||||||
while (true) {
|
while (true) {
|
||||||
// The left wheel turns forward when nothing is touched on the right side
|
// The left wheel turns forward when nothing is touched on the right side
|
||||||
// and turn backward when the roboid hits something on the right
|
// 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
|
// The right wheel does the same, but instead is controlled by
|
||||||
// touches on the left side
|
// 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
|
// When both sides are touching something, both wheels will turn backward
|
||||||
// and the roboid will move backwards
|
// and the roboid will move backwards
|
||||||
bb2b.SetWheelVelocity(leftWheelSpeed, rightWheelSpeed);
|
bb2b.SetWheelVelocity(leftWheelSpeed, rightWheelSpeed);
|
||||||
|
@ -15,7 +15,7 @@ TEST(RoboidControlSuite, HiddenParticipant) {
|
|||||||
unsigned long milliseconds = Thing::GetTimeMs();
|
unsigned long milliseconds = Thing::GetTimeMs();
|
||||||
unsigned long startTime = milliseconds;
|
unsigned long startTime = milliseconds;
|
||||||
while (milliseconds < startTime + 1000) {
|
while (milliseconds < startTime + 1000) {
|
||||||
Thing::UpdateThings();
|
thing->Update();
|
||||||
|
|
||||||
milliseconds = Thing::GetTimeMs();
|
milliseconds = Thing::GetTimeMs();
|
||||||
}
|
}
|
||||||
@ -23,7 +23,7 @@ TEST(RoboidControlSuite, HiddenParticipant) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST(RoboidControlSuite, IsolatedParticipant) {
|
TEST(RoboidControlSuite, IsolatedParticipant) {
|
||||||
ParticipantUDP* participant = ParticipantUDP::Isolated();
|
ParticipantUDP* participant = new ParticipantUDP(0);
|
||||||
Thing* thing = new Thing();
|
Thing* thing = new Thing();
|
||||||
|
|
||||||
unsigned long milliseconds = Thing::GetTimeMs();
|
unsigned long milliseconds = Thing::GetTimeMs();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user