From 1c94b8b13aba48b2b1122328e284cfb6791e1fe5 Mon Sep 17 00:00:00 2001 From: Olivier Michel Date: Fri, 11 Nov 2022 17:16:48 +0100 Subject: [PATCH] Fixed compilation on macOS (#5289) * Fixed compilation, echo output on macOS * Fixed echo -e * Set JAVA_HOME automatically * remove codesign from Makefile.include * Update Makefile * Update Makefile * Compiles fixes for arm64 * Fixed compilation on arm64 * Update changelog-r2022.md * Update changelog-r2022.md * Got rid of aseba * Removed aseba dependency * Removed aseba documentation * removed python brew * Fixed mac distro on arm64 Co-authored-by: Yannick Goumaz <61198661+ygoumaz@users.noreply.github.com> --- .gitmodules | 6 - Makefile | 20 +- .../robots/thymio2/aseba_target_selection.png | Bin 36632 -> 0 bytes docs/guide/thymio2.md | 31 +- lib/controller/.gitignore | 4 - projects/default/controllers/ros/Makefile | 4 +- .../default/libraries/vehicle/java/Makefile | 4 +- projects/robots/Makefile | 3 - .../robots/mobsya/thymio/controllers/Makefile | 12 - .../controllers/thymio2_aseba/.gitignore | 1 - .../thymio/controllers/thymio2_aseba/Makefile | 47 -- .../thymio2_aseba/Thymio2AsebaHub.cpp | 256 --------- .../thymio2_aseba/Thymio2AsebaHub.hpp | 52 -- .../thymio2_aseba/Thymio2Model.cpp | 518 ------------------ .../thymio2_aseba/Thymio2Model.hpp | 88 --- .../thymio/controllers/thymio2_aseba/aseba | 1 - .../thymio/controllers/thymio2_aseba/main.cpp | 76 --- .../thymio2_aseba/thymio2_definitions.c | 117 ---- .../thymio2_aseba/thymio2_definitions.h | 97 ---- .../thymio2_aseba/thymio2_natives.c | 290 ---------- .../thymio2_aseba/thymio2_natives.h | 120 ---- .../robots/mobsya/thymio/libraries/.gitignore | 1 - .../robots/mobsya/thymio/libraries/Makefile | 39 -- .../robots/mobsya/thymio/libraries/dashel-src | 1 - .../robots/mobsya/thymio/protos/Thymio2.proto | 24 +- .../darwin-op/plugins/robot_windows/Makefile | 4 +- .../robot_windows/robotis-op2_window/Makefile | 2 + .../controllers/ros_automobile/Makefile | 4 +- .../robot_windows/automobile_window/Makefile | 4 +- resources/Makefile.include | 10 +- resources/Makefile.java.include | 4 +- resources/Makefile.os.include | 6 +- scripts/install/bash_profile.mac | 2 +- scripts/packaging/files_core.txt | 4 + scripts/packaging/generate_asset_cache.py | 2 +- scripts/packaging/mac_distro.py | 4 +- scripts/packaging/recurse_in_projects.txt | 1 - src/controller/c/Makefile | 2 +- src/controller/java/Makefile | 4 +- src/controller/matlab/Makefile | 2 +- 40 files changed, 63 insertions(+), 1804 deletions(-) delete mode 100644 docs/guide/images/robots/thymio2/aseba_target_selection.png delete mode 100644 projects/robots/mobsya/thymio/controllers/thymio2_aseba/.gitignore delete mode 100644 projects/robots/mobsya/thymio/controllers/thymio2_aseba/Makefile delete mode 100644 projects/robots/mobsya/thymio/controllers/thymio2_aseba/Thymio2AsebaHub.cpp delete mode 100644 projects/robots/mobsya/thymio/controllers/thymio2_aseba/Thymio2AsebaHub.hpp delete mode 100644 projects/robots/mobsya/thymio/controllers/thymio2_aseba/Thymio2Model.cpp delete mode 100644 projects/robots/mobsya/thymio/controllers/thymio2_aseba/Thymio2Model.hpp delete mode 160000 projects/robots/mobsya/thymio/controllers/thymio2_aseba/aseba delete mode 100644 projects/robots/mobsya/thymio/controllers/thymio2_aseba/main.cpp delete mode 100644 projects/robots/mobsya/thymio/controllers/thymio2_aseba/thymio2_definitions.c delete mode 100644 projects/robots/mobsya/thymio/controllers/thymio2_aseba/thymio2_definitions.h delete mode 100644 projects/robots/mobsya/thymio/controllers/thymio2_aseba/thymio2_natives.c delete mode 100644 projects/robots/mobsya/thymio/controllers/thymio2_aseba/thymio2_natives.h delete mode 100644 projects/robots/mobsya/thymio/libraries/.gitignore delete mode 100644 projects/robots/mobsya/thymio/libraries/Makefile delete mode 160000 projects/robots/mobsya/thymio/libraries/dashel-src diff --git a/.gitmodules b/.gitmodules index 2eac8723791..a1efd3045a5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,6 @@ [submodule "src/glm"] path = src/glm url = https://github.com/g-truc/glm.git -[submodule "projects/robots/mobsya/thymio/libraries/dashel-src"] - path = projects/robots/mobsya/thymio/libraries/dashel-src - url = https://github.com/aseba-community/dashel.git -[submodule "projects/robots/mobsya/thymio/controllers/thymio2_aseba/aseba"] - path = projects/robots/mobsya/thymio/controllers/thymio2_aseba/aseba - url = https://github.com/aseba-community/aseba.git [submodule "src/stb"] path = src/stb url = https://github.com/nothings/stb.git diff --git a/Makefile b/Makefile index a6e972783ae..585481e732f 100644 --- a/Makefile +++ b/Makefile @@ -164,15 +164,15 @@ install: help: @+echo - @+echo -e "\033[32;1mWebots Makefile targets:\033[0m" + @+$(ECHO) "\033[32;1mWebots Makefile targets:\033[0m" @+echo - @+echo -e "\033[33;1mmake -j$(THREADS) release\033[0m\t# compile with maximum optimization (default)" - @+echo -e "\033[33;1mmake -j$(THREADS) debug\033[0m \t# compile with gdb debugging symbols" - @+echo -e "\033[33;1mmake -j$(THREADS) profile\033[0m\t# compile with gprof profiling information" - @+echo -e "\033[33;1mmake -j$(THREADS) distrib\033[0m\t# compile in release mode & create distribution package" - @+echo -e "\033[33;1mmake -j$(THREADS) clean\033[0m \t# clean-up the compilation output" - @+echo -e "\033[33;1mmake -j$(THREADS) cleanse\033[0m\t# deep clean-up (dependencies are also removed)" - @+echo -e "\033[33;1mmake help\033[0m\t\t# display this message and exit" + @+$(ECHO) "\033[33;1mmake -j$(THREADS) release\033[0m\t# compile with maximum optimization (default)" + @+$(ECHO) "\033[33;1mmake -j$(THREADS) debug\033[0m \t# compile with gdb debugging symbols" + @+$(ECHO) "\033[33;1mmake -j$(THREADS) profile\033[0m\t# compile with gprof profiling information" + @+$(ECHO) "\033[33;1mmake -j$(THREADS) distrib\033[0m\t# compile in release mode & create distribution package" + @+$(ECHO) "\033[33;1mmake -j$(THREADS) clean\033[0m \t# clean-up the compilation output" + @+$(ECHO) "\033[33;1mmake -j$(THREADS) cleanse\033[0m\t# deep clean-up (dependencies are also removed)" + @+$(ECHO) "\033[33;1mmake help\033[0m\t\t# display this message and exit" @+echo - @+echo -e "\033[32;1mNote:\033[0m You seem to have a processor with $(NUMBER_OF_PROCESSORS) virtual cores," - @+echo -e " hence the \033[33;1m-j$(THREADS)\033[0m option to speed-up the compilation." + @+$(ECHO) "\033[32;1mNote:\033[0m You seem to have a processor with $(NUMBER_OF_PROCESSORS) virtual cores," + @+$(ECHO) " hence the \033[33;1m-j$(THREADS)\033[0m option to speed-up the compilation." diff --git a/docs/guide/images/robots/thymio2/aseba_target_selection.png b/docs/guide/images/robots/thymio2/aseba_target_selection.png deleted file mode 100644 index fd753830126d6262da4c41d9ea84a06784ae8975..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36632 zcmb4qV{m3svu>PBCY;!|ZS$Sjwrv{|Yhv4WCbn(ccJjtI-#vAH+`50x*;TuCt-ZRd ztM*#EyVuiChs(=Kz{6t0f`EX)10+QiK|nwmzwZ|qsP8vWxQ4Oc4+tk=fHKVY zZ1vn;(yj7^zRiZ7!QiD;; zSW5cKD@kTZcOQ26ktPZX3m1~Q^G~zHaynge9dEV1Oj12(7vOFd$-@Xz!d_L6a?bD1 zcG9ED2*s0@ksu}az~W#g2^pF^Qi90~LPHLg?cu~l^K1oO&CIeE?J5D{3lW6$Tk!_G zWgl1(|Dq+WFyU;f5_b7<@B(y|RR)>q4C_MhNCENOP>?E0_N|%lDiwXKVBN~O?e+2Y zL+zk{%okRs|0I$EEMt0@dztAnWucSRcE;}VdFDDx%Y|vlgHlKVczU#!x#!fL5zsmg zJayIqNcE$X0L5Vnq|)Y)y`>q2US^xMxnnZxj92|&Nzw?5bQsVGFa(`pyyJoM+uU-S z^Y`rp3qbtCy5TCju*%FIBp8F1HW5nPK|PF}(s%l(%QP|Fz);ST-<+lmV+4EaY#G3g z!YH69LpG;dg~j3`)0Zo*Yz3M5#=Aw%O=T+EmlKO0G}P#Y~6B6(T5grG^bw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{Qd!*x3u2xS-*JIQHQYI_zycKK|c92tgzoW$d`|)J>S^$P@#5 zkHHX_4<9~!TnV^THQPRX`0#Pr;S-n-A3laHd;;^~!^g0NPhdWL_!zeE3CxENAHx -#include -#include - -#include // memcpy -#include -#include - -using namespace std; - -static Thymio2AsebaHub *thymio2 = NULL; - -Thymio2AsebaHub::Thymio2AsebaHub(int port) : stream(0), lastMessageSource(0), lastMessageData(0) { - thymio2 = this; - - vm.nodeId = 1; - - bytecode.resize(512); - vm.bytecode = &bytecode[0]; - vm.bytecodeSize = bytecode.size(); - - stack.resize(64); - vm.stack = &stack[0]; - vm.stackSize = stack.size(); - - vm.variables = reinterpret_cast(&variables); - vm.variablesSize = sizeof(variables) / sizeof(short int); - - try { - std::ostringstream o; - o << "tcpin:port=" << port; - Dashel::Hub::connect(o.str()); - cout << "Server started on port " << port << "..." << std::endl; - } catch (Dashel::DashelException &e) { - cerr << "Cannot create listening port " << port << ": " << e.what() << std::endl; - abort(); - } - - AsebaVMInit(&vm); - - variables.productid = ASEBA_PID_THYMIO2; // TODO: is this useful ? -} - -Thymio2AsebaHub::~Thymio2AsebaHub() { - thymio2 = NULL; -} - -void Thymio2AsebaHub::connectionCreated(Dashel::Stream *stream) { - std::string targetName = stream->getTargetName(); - if (targetName.substr(0, targetName.find_first_of(':')) == "tcp") { - cout << "New client connected." << endl; - if (this->stream) { - closeStream(this->stream); - cerr << " Disconnected old client." << endl; - } - this->stream = stream; - } -} - -void Thymio2AsebaHub::incomingData(Dashel::Stream *stream) { - unsigned short int temp; - unsigned short int len; - - stream->read(&temp, 2); - len = bswap16(temp); - stream->read(&temp, 2); - lastMessageSource = bswap16(temp); - lastMessageData.resize(len + 2); - stream->read(&lastMessageData[0], lastMessageData.size()); - - if (bswap16(*(unsigned short int *)&lastMessageData[0]) >= 0xA000) - AsebaProcessIncomingEvents(&vm); - else - cerr << "Non debug event dropped." << endl; -} - -void Thymio2AsebaHub::connectionClosed(Dashel::Stream *stream, bool abnormal) { - if (stream == this->stream) { - this->stream = 0; - vm.breakpointsCount = 0; - } - if (abnormal) - cerr << "Client has disconnected unexpectedly." << endl; - else - cout << "Client has disconnected properly." << endl; -} - -void Thymio2AsebaHub::sendEvents(bool events[]) { - bool vmHasRun = false; - - if (AsebaMaskIsClear(vm.flags, ASEBA_VM_STEP_BY_STEP_MASK) || AsebaMaskIsClear(vm.flags, ASEBA_VM_EVENT_ACTIVE_MASK)) { - for (int i = 0; i < EVENT_COUNT; ++i) { - if (events[i]) { - AsebaVMSetupEvent(&vm, ASEBA_EVENT_LOCAL_EVENTS_START - i); - AsebaVMRun(&vm, 1000); - vmHasRun = true; - } - } - } - - if (!vmHasRun) - AsebaVMRun(&vm, 1000); -} - -extern "C" { - -void AsebaPutVmToSleep(AsebaVMState *vm) { -} - -void AsebaSendBuffer(AsebaVMState *vm, const unsigned char *data, unsigned short int length) { - Dashel::Stream *stream = thymio2->stream; - if (!stream) { - cerr << "Invalid stream" << std::endl; - return; - } - - try { - unsigned short int temp; - temp = bswap16(length - 2); - stream->write(&temp, 2); - temp = bswap16(vm->nodeId); - stream->write(&temp, 2); - stream->write(data, length); - stream->flush(); - } catch (Dashel::DashelException &e) { - cerr << "Cannot write to socket: " << stream->getFailReason() << std::endl; - } -} - -unsigned short int AsebaGetBuffer(AsebaVMState *vm, unsigned char *data, unsigned short int maxLength, - unsigned short int *source) { - if (thymio2->lastMessageData.size()) { - *source = thymio2->lastMessageSource; - memcpy(data, &thymio2->lastMessageData[0], thymio2->lastMessageData.size()); - } - return thymio2->lastMessageData.size(); -} - -extern AsebaVMDescription vmDescription; -const AsebaVMDescription *AsebaGetVMDescription(AsebaVMState *vm) { - return &vmDescription; -} - -extern AsebaLocalEventDescription localEvents[]; -const AsebaLocalEventDescription *AsebaGetLocalEventsDescriptions(AsebaVMState *vm) { - return localEvents; -} - -extern AsebaNativeFunctionDescription *nativeFunctionsDescriptions[]; -const AsebaNativeFunctionDescription *const *AsebaGetNativeFunctionsDescriptions(AsebaVMState *vm) { - return nativeFunctionsDescriptions; -} - -extern AsebaNativeFunctionPointer nativeFunctions[]; -void AsebaNativeFunction(AsebaVMState *vm, unsigned short int id) { - nativeFunctions[id](vm); -} - -void AsebaWriteBytecode(AsebaVMState *vm) { -} - -void AsebaResetIntoBootloader(AsebaVMState *vm) { -} - -#ifndef DISABLE_WEAK_CALLBACKS -void AsebaVMRunCB(AsebaVMState *vm) { -} - -void AsebaVMErrorCB(AsebaVMState *vm, const char *message) { -} - -void AsebaVMResetCB(AsebaVMState *vm) { -} -#endif - -void AsebaAssert(AsebaVMState *vm, AsebaAssertReason reason) { - cerr << "\nFatal error: "; - switch (vm->nodeId) { - case 1: - cerr << "left motor module"; - break; - case 2: - cerr << "right motor module"; - break; - case 3: - cerr << "proximity sensors module"; - break; - case 4: - cerr << "distance sensors module"; - break; - default: - cerr << "unknown module"; - break; - } - cerr << " has produced exception: "; - switch (reason) { - case ASEBA_ASSERT_UNKNOWN: - cerr << "undefined"; - break; - case ASEBA_ASSERT_UNKNOWN_UNARY_OPERATOR: - cerr << "unknown unary operator"; - break; - case ASEBA_ASSERT_UNKNOWN_BINARY_OPERATOR: - cerr << "unknown binary operator"; - break; - case ASEBA_ASSERT_UNKNOWN_BYTECODE: - cerr << "unknown bytecode"; - break; - case ASEBA_ASSERT_STACK_OVERFLOW: - cerr << "stack overflow"; - break; - case ASEBA_ASSERT_STACK_UNDERFLOW: - cerr << "stack underflow"; - break; - case ASEBA_ASSERT_OUT_OF_VARIABLES_BOUNDS: - cerr << "out of variables bounds"; - break; - case ASEBA_ASSERT_OUT_OF_BYTECODE_BOUNDS: - cerr << "out of bytecode bounds"; - break; - case ASEBA_ASSERT_STEP_OUT_OF_RUN: - cerr << "step out of run"; - break; - case ASEBA_ASSERT_BREAKPOINT_OUT_OF_BYTECODE_BOUNDS: - cerr << "breakpoint out of bytecode bounds"; - break; - case ASEBA_ASSERT_EMIT_BUFFER_TOO_LONG: - cerr << "tried to emit a buffer too long"; - break; - default: - cerr << "unknown exception"; - break; - } - cerr << ".\npc = " << vm->pc << ", sp = " << vm->sp; - cerr << "\nResetting VM" << std::endl; - AsebaVMInit(vm); -} -} diff --git a/projects/robots/mobsya/thymio/controllers/thymio2_aseba/Thymio2AsebaHub.hpp b/projects/robots/mobsya/thymio/controllers/thymio2_aseba/Thymio2AsebaHub.hpp deleted file mode 100644 index ceb54b249ae..00000000000 --- a/projects/robots/mobsya/thymio/controllers/thymio2_aseba/Thymio2AsebaHub.hpp +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 1996-2022 Cyberbotics Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Strongly inspired from https://github.com/aseba-community/aseba/blob/master/targets/challenge/challenge.cpp - -#ifndef THYMIO2_ASEBA_STUDIO_HUB_HPP -#define THYMIO2_ASEBA_STUDIO_HUB_HPP - -#ifndef ASEBA_ASSERT -#define ASEBA_ASSERT -#endif - -#include "thymio2_definitions.h" - -#include - -#include - -#include - -class Thymio2AsebaHub : public Dashel::Hub { -public: - explicit Thymio2AsebaHub(int port); - virtual ~Thymio2AsebaHub(); - - void connectionCreated(Dashel::Stream *stream); - void incomingData(Dashel::Stream *stream); - void connectionClosed(Dashel::Stream *stream, bool abnormal); - void sendEvents(bool events[]); - - Dashel::Stream *stream; - AsebaVMState vm; - std::valarray bytecode; - std::valarray stack; - _vmVariables variables; - - unsigned short int lastMessageSource; - std::valarray lastMessageData; -}; - -#endif diff --git a/projects/robots/mobsya/thymio/controllers/thymio2_aseba/Thymio2Model.cpp b/projects/robots/mobsya/thymio/controllers/thymio2_aseba/Thymio2Model.cpp deleted file mode 100644 index 40704fbe19c..00000000000 --- a/projects/robots/mobsya/thymio/controllers/thymio2_aseba/Thymio2Model.cpp +++ /dev/null @@ -1,518 +0,0 @@ -// Copyright 1996-2022 Cyberbotics Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "Thymio2Model.hpp" - -#include "Thymio2AsebaHub.hpp" - -#include -#include -#include -#include -#include -#include - -#include // sscanf -#include -#include -#include - -#define VELOCITY_RATIO (9.53 / 500.0) - -using namespace webots; -using namespace std; - -static Thymio2Model *thymio2 = NULL; - -Thymio2Model::Thymio2Model() : Robot() { - thymio2 = this; - - mStepCounter = -1; // the first step will be step 0, the modulo tests on the period is facilitated this way - mTimeStep = (int)getBasicTimeStep(); - - if (mTimeStep != 10) - cout << "In order to have an accurate simulation, it is recommended to set WorldInfo::basicTimeStep to 10." << endl; - - // Hertz value from https://aseba.wdfiles.com/local--files/en:thymioprogram/ThymioCheatSheet.pdf - mAccelerometerPeriod = hertzToBestMsPeriod(16); // only sensor not tolerand to the recommended 10ms basic time step - mProxsPeriod = hertzToBestMsPeriod(10); - mButtonsPeriod = hertzToBestMsPeriod(20); - mMotorsPeriod = hertzToBestMsPeriod(100); - - initDevices(); - reset(); - safeStep(); -} - -Thymio2Model::~Thymio2Model() { -} - -void Thymio2Model::reset() { - mLastMotorPosition[M_LEFT] = 0.0; - mLastMotorPosition[M_RIGHT] = 0.0; - - for (int i = 0; i < 5; ++i) - mLastButtonsState[i] = false; - - for (int i = 0; i < 2; ++i) { - mLastTimerPeriod[i] = 0; - mTimerStepStart[i] = -1; - } - - mAutomaticBehaviorAccLeds = true; - mAutomaticBehaviorButtonLeds = true; - mAutomaticBehaviorProxLeds = true; -} - -bool Thymio2Model::safeStep() { - if (mAutomaticBehaviorAccLeds) - behaviorAccLeds(); - if (mAutomaticBehaviorButtonLeds) - behaviorButtonLeds(); - if (mAutomaticBehaviorProxLeds) - behaviorProxLeds(); - - ++mStepCounter; - return step(mTimeStep) != -1; -} - -void Thymio2Model::initDevices() { - mAccelerometer = getAccelerometer("acc"); - mAccelerometer->enable(mAccelerometerPeriod); - - for (int i = 0; i < 7; ++i) { - ostringstream s; - s << "prox.horizontal." << i; - mHorizontalProxs[i] = getDistanceSensor(s.str()); - mHorizontalProxs[i]->enable(mProxsPeriod); - } - - mVerticalProxs[M_LEFT] = getDistanceSensor("prox.ground.0"); - mVerticalProxs[M_RIGHT] = getDistanceSensor("prox.ground.1"); - for (int i = 0; i < 2; ++i) - mVerticalProxs[i]->enable(mProxsPeriod); - - mMotors[M_LEFT] = getMotor("motor.left"); - mMotors[M_RIGHT] = getMotor("motor.right"); - for (int i = 0; i < 2; ++i) - mMotors[i]->setPosition(numeric_limits::infinity()); - - mPositionSensors[M_LEFT] = getPositionSensor("motor.left.position"); - mPositionSensors[M_RIGHT] = getPositionSensor("motor.right.position"); - for (int i = 0; i < 2; ++i) - mPositionSensors[i]->enable(mMotorsPeriod); - - mButtons[B_FORWARD] = getTouchSensor("button.forward"); - mButtons[B_RIGHT] = getTouchSensor("button.right"); - mButtons[B_BACKWARD] = getTouchSensor("button.backward"); - mButtons[B_LEFT] = getTouchSensor("button.left"); - mButtons[B_CENTER] = getTouchSensor("button.center"); - for (int i = 0; i < 5; ++i) - mButtons[i]->enable(mButtonsPeriod); -} - -void Thymio2Model::sensorToHub(Thymio2AsebaHub *hub) { - updateWindowData(); - - if (isPeriodicEventFired(mAccelerometerPeriod)) { - const double *accValues = mAccelerometer->getValues(); - for (int i = 0; i < 3; ++i) - hub->variables.acc[i] = accValues[i]; - } - - if (isPeriodicEventFired(mProxsPeriod)) { - std::stringstream wwiMessage; - for (int i = 0; i < 7; ++i) { - const double value = mHorizontalProxs[i]->getValue(); - hub->variables.prox[i] = value; - wwiMessage << int(value) << " "; - } - for (int i = 0; i < 2; ++i) { - // TODO: - // the following is a already good approximation - // a more precise solution could be achieved by adding calibrated LightSensors - // and to set ground_ambiant, and to compute delta as - // ground_reflected - ground_ambiant - const double value = mVerticalProxs[i]->getValue(); - hub->variables.ground_reflected[i] = value; - hub->variables.ground_delta[i] = value; - wwiMessage << int(value) << " "; - } - - wwiSendText(wwiMessage.str()); - } - - if (isPeriodicEventFired(mButtonsPeriod)) - for (int i = 0; i < 5; ++i) - hub->variables.buttons_state[i] = mButtons[i]->getValue() || mWindowData[i]; - - if (isPeriodicEventFired(mMotorsPeriod)) - for (int i = 0; i < 2; ++i) { - double currentPosition = mPositionSensors[i]->getValue(); - double velocity = (currentPosition - mLastMotorPosition[i]) / (0.001 * mTimeStep); - hub->variables.uind[i] = velocity / VELOCITY_RATIO; - hub->variables.pwm[i] = -1.6 * hub->variables.uind[i]; // poor approximation - mLastMotorPosition[i] = currentPosition; - } -} - -static double clamp(double n, double lower, double upper) { - return std::max(lower, std::min(n, upper)); -} - -void Thymio2Model::hubToActuators(const Thymio2AsebaHub *hub) { - double leftVelocity = VELOCITY_RATIO * clamp(hub->variables.target[0], -500, 500); - double rightVelocity = VELOCITY_RATIO * clamp(hub->variables.target[1], -500, 500); - mMotors[M_LEFT]->setVelocity(leftVelocity); - mMotors[M_RIGHT]->setVelocity(rightVelocity); -} - -void Thymio2Model::updateEvents(const Thymio2AsebaHub *hub, bool events[]) { - // clear all events - for (int i = 0; i < EVENT_COUNT; ++i) - events[i] = false; - - // set the appropriate events - events[EVENT_ACC] = isPeriodicEventFired(mButtonsPeriod); - events[EVENT_BUTTONS] = isPeriodicEventFired(mButtonsPeriod); - events[EVENT_MOTOR] = isPeriodicEventFired(mMotorsPeriod); - events[EVENT_PROX] = isPeriodicEventFired(mProxsPeriod); - - if (events[EVENT_BUTTONS]) { - for (int i = 0; i < 5; ++i) { - bool state = mButtons[i]->getValue() || mWindowData[i]; - if (mLastButtonsState[i] != state) - events[EVENT_B_BACKWARD + i] = true; - mLastButtonsState[i] = state; - } - } - - // timer management - for (int i = 0; i < 2; i++) { - if (hub->variables.timers[i] != mLastTimerPeriod[i]) { - if (hub->variables.timers[i] > 0) { - mTimerStepStart[i] = mStepCounter; - - // check that the timer period is a multiple of WorldInfo::timeStep - // but only for small periods (arbitrarily: < 2*timeStep) because after the generated error is less important - if (hub->variables.timers[i] < 2 * mTimeStep && hub->variables.timers[i] != mTimeStep) - cout << "In simulation, timer " << i << " period should be above or equal to WorldInfo::timeStep" << endl; - } else - mTimerStepStart[i] = -1; - - mLastTimerPeriod[i] = hub->variables.timers[i]; - } - - events[EVENT_TIMER0 + i] = isPeriodicEventFired(hub->variables.timers[i], mTimerStepStart[i]); - } - - // read the robot window events if any - events[EVENT_MIC] = mWindowData[5]; - events[EVENT_TAP] = mWindowData[6]; -} - -void Thymio2Model::updateWindowData() { - std::string text = wwiReceiveText(); - if (text.compare(0, 10, "mousedown ") == 0) { - std::string buttonName = text.substr(10); - if (buttonName.compare("backward") == 0) - mWindowData[B_BACKWARD] = true; - else if (buttonName.compare("forward") == 0) - mWindowData[B_FORWARD] = true; - else if (buttonName.compare("center") == 0) - mWindowData[B_CENTER] = true; - else if (buttonName.compare("right") == 0) - mWindowData[B_RIGHT] = true; - else if (buttonName.compare("left") == 0) - mWindowData[B_LEFT] = true; - else if (buttonName.compare("clap") == 0) - mWindowData[5] = true; - else if (buttonName.compare("tap") == 0) - mWindowData[6] = true; - } else if (text.compare("mouseup") == 0) { - for (int i = 0; i < 7; ++i) - mWindowData[i] = false; - } -} - -void Thymio2Model::behaviorButtonLeds() { - // cf. https://github.com/aseba-community/aseba-target-thymio2/blob/master/behavior.c - - static unsigned int counter[5]; - int i; - for (i = 0; i < 5; ++i) { - if (mButtons[i]->getValue()) { - counter[i] += 3; - if (counter[i] > 32) - counter[i] = 32; - } else - counter[i] = 0; - } - - if (counter[2]) { - thymio2->getLED("leds.buttons.led0")->set(counter[2]); - thymio2->getLED("leds.buttons.led1")->set(counter[2]); - thymio2->getLED("leds.buttons.led2")->set(counter[2]); - thymio2->getLED("leds.buttons.led3")->set(counter[2]); - } else { - thymio2->getLED("leds.buttons.led0")->set(counter[3]); - thymio2->getLED("leds.buttons.led1")->set(counter[4]); - thymio2->getLED("leds.buttons.led2")->set(counter[0]); - thymio2->getLED("leds.buttons.led3")->set(counter[1]); - } - - // Note: removed the multi touch behavior: not possible in Webots -} - -void Thymio2Model::behaviorProxLeds() { - // cf. https://github.com/aseba-community/aseba-target-thymio2/blob/master/behavior.c - - static int max[9] = {4000, 4000, 4000, 4000, 4000, 4000, 4000, 900, 900}; - static int min[9] = {1200, 1200, 1200, 1200, 1200, 1200, 1200, 0, 0}; - static string led[10] = {"leds.prox.h.led0", "leds.prox.h.led1", "leds.prox.h.led2", "leds.prox.h.led3", "leds.prox.h.led4", - "leds.prox.h.led5", "leds.prox.h.led6", "leds.prox.h.led7", "leds.prox.v.led0", "leds.prox.v.led1"}; - int i; - for (i = 0; i < 7; ++i) { - if (max[i] < mHorizontalProxs[i]->getValue()) - max[i] = mHorizontalProxs[i]->getValue(); - if (mHorizontalProxs[i]->getValue() != 0 && min[i] > mHorizontalProxs[i]->getValue()) - min[i] = mHorizontalProxs[i]->getValue(); - } - for (i = 0; i < 2; ++i) { - if (max[i + 7] < mVerticalProxs[i]->getValue()) - max[i + 7] = mVerticalProxs[i]->getValue(); - } - - for (i = 0; i < 7; ++i) { - int s = mHorizontalProxs[i]->getValue() - min[i]; - int d = max[i] - min[i]; - - if (s < 0) - s = 0; - - int b = d ? (s * 32 / d) : 0; - - if (i == 2) { - getLED(led[i])->set(b); - getLED(led[i + 1])->set(b); - } else if (i > 2) - getLED(led[i + 1])->set(b); - else - getLED(led[i])->set(b); - } - - for (i = 0; i < 2; ++i) { - int s = mVerticalProxs[i]->getValue() > 0 ? mVerticalProxs[i]->getValue() : 0; - int b = s * 32 / max[i + 7]; - getLED(led[i + 8])->set(b); - } -} - -void Thymio2Model::behaviorAccLeds() { - // cf. https://github.com/aseba-community/aseba-target-thymio2/blob/master/behavior.c - - static string previous_led = ""; - - string led = ""; - - if (mAccelerometer->getValues()[2] < 21) { - static double M_PI_8 = M_PI / 8.0; - double ha = atan2(mAccelerometer->getValues()[0], mAccelerometer->getValues()[1]); - if (ha >= -M_PI_8 && ha < M_PI_8) - led = "leds.circle.led4"; - else if (ha < -M_PI_8 && ha >= -3.0 * M_PI_8) - led = "leds.circle.led3"; - else if (ha < -3.0 * M_PI_8 && ha >= -5.0 * M_PI_8) - led = "leds.circle.led2"; - else if (ha < -5.0 * M_PI_8 && ha >= -7.0 * M_PI_8) - led = "leds.circle.led1"; - else if (ha < -7.0 * M_PI_8 || ha >= 7.0 * M_PI_8) - led = "leds.circle.led0"; - else if (ha < 3.0 * M_PI_8 && ha >= M_PI_8) - led = "leds.circle.led5"; - else if (ha < 5.0 * M_PI_8 && ha >= 3.0 * M_PI_8) - led = "leds.circle.led6"; - else if (ha < 7.0 * M_PI_8 && ha >= 5.0 * M_PI_8) - led = "leds.circle.led7"; - - int intensity = 40 - abs(mAccelerometer->getValues()[2]) * 2; - if (intensity < 0) - intensity = 0; - else if (intensity > 32) - intensity = 32; - - if (!led.empty()) { - // cppcheck-suppress knownConditionTrueFalse - if (!previous_led.empty()) - getLED(previous_led)->set(0); - getLED(led)->set(intensity); - } - previous_led = led; - } else { - // cppcheck-suppress knownConditionTrueFalse - if (!previous_led.empty()) - getLED(previous_led)->set(0); - - previous_led = ""; - } -} - -int Thymio2Model::hertzToBestMsPeriod(int hertz) const { - return mTimeStep * (1000 / hertz / mTimeStep); -} - -bool Thymio2Model::isPeriodicEventFired(int period, int startCounter) const { - if (period > 0) { - if (period < mTimeStep) - // Webots cannot go quicker. time constraints are not fullfilled. - return true; - else { - // Hypothesis: Webots is modifying the sensors according to the following rule: - bool fireRequired((mStepCounter - startCounter) % (period / mTimeStep) == 0); - - // for the timer case, don't fire the event directly, but wait at least on the next step - if (startCounter > 0 && mStepCounter == startCounter) - return false; - - return fireRequired; - } - } - return false; -} - -static int convertRGBColorToWebotsColor(int r, int g, int b, int scale) { - return ((0xFF & (r * 0xFF / scale)) << 16) + ((0xFF & (g * 0xFF / scale)) << 8) + (0xFF & (b * 0xFF / scale)); -} - -extern "C" { -#include - -// cf. https://github.com/aseba-community/aseba-target-thymio2/blob/master/thymio_natives.c - -void set_rgb_top(AsebaVMState *vm) { - int r = vm->variables[AsebaNativePopArg(vm)]; - int g = vm->variables[AsebaNativePopArg(vm)]; - int b = vm->variables[AsebaNativePopArg(vm)]; - - thymio2->getLED("leds.top")->set(convertRGBColorToWebotsColor(r, g, b, 32)); -} - -void set_led(AsebaVMState *vm) { - /*int led = vm->variables[*/ AsebaNativePopArg(vm) /*]*/; - /*int b = vm->variables[*/ AsebaNativePopArg(vm) /*]*/; - - // This function is not accessible from the user -} - -void set_led_circle(AsebaVMState *vm) { - int l0 = vm->variables[AsebaNativePopArg(vm)]; - int l1 = vm->variables[AsebaNativePopArg(vm)]; - int l2 = vm->variables[AsebaNativePopArg(vm)]; - int l3 = vm->variables[AsebaNativePopArg(vm)]; - int l4 = vm->variables[AsebaNativePopArg(vm)]; - int l5 = vm->variables[AsebaNativePopArg(vm)]; - int l6 = vm->variables[AsebaNativePopArg(vm)]; - int l7 = vm->variables[AsebaNativePopArg(vm)]; - - thymio2->setAutomaticBehaviorAccLeds(false); - - thymio2->getLED("leds.circle.led0")->set(l0); - thymio2->getLED("leds.circle.led1")->set(l1); - thymio2->getLED("leds.circle.led2")->set(l2); - thymio2->getLED("leds.circle.led3")->set(l3); - thymio2->getLED("leds.circle.led4")->set(l4); - thymio2->getLED("leds.circle.led5")->set(l5); - thymio2->getLED("leds.circle.led6")->set(l6); - thymio2->getLED("leds.circle.led7")->set(l7); -} - -void set_rgb_br(AsebaVMState *vm) { - int r = vm->variables[AsebaNativePopArg(vm)]; - int g = vm->variables[AsebaNativePopArg(vm)]; - int b = vm->variables[AsebaNativePopArg(vm)]; - - thymio2->getLED("leds.bottom.right")->set(convertRGBColorToWebotsColor(r, g, b, 32)); -} - -void set_rgb_bl(AsebaVMState *vm) { - int r = vm->variables[AsebaNativePopArg(vm)]; - int g = vm->variables[AsebaNativePopArg(vm)]; - int b = vm->variables[AsebaNativePopArg(vm)]; - - thymio2->getLED("leds.bottom.left")->set(convertRGBColorToWebotsColor(r, g, b, 32)); -} - -void set_buttons_leds(AsebaVMState *vm) { - int l0 = vm->variables[AsebaNativePopArg(vm)]; - int l1 = vm->variables[AsebaNativePopArg(vm)]; - int l2 = vm->variables[AsebaNativePopArg(vm)]; - int l3 = vm->variables[AsebaNativePopArg(vm)]; - - thymio2->setAutomaticBehaviorButtonLeds(false); - - thymio2->getLED("leds.buttons.led0")->set(l0); - thymio2->getLED("leds.buttons.led1")->set(l1); - thymio2->getLED("leds.buttons.led2")->set(l2); - thymio2->getLED("leds.buttons.led3")->set(l3); -} - -void set_hprox_leds(AsebaVMState *vm) { - int l0 = vm->variables[AsebaNativePopArg(vm)]; - int l1 = vm->variables[AsebaNativePopArg(vm)]; - int l2 = vm->variables[AsebaNativePopArg(vm)]; - int l3 = vm->variables[AsebaNativePopArg(vm)]; - int l4 = vm->variables[AsebaNativePopArg(vm)]; - int l5 = vm->variables[AsebaNativePopArg(vm)]; - int l6 = vm->variables[AsebaNativePopArg(vm)]; - int l7 = vm->variables[AsebaNativePopArg(vm)]; - - thymio2->setAutomaticBehaviorProxLeds(false); - - thymio2->getLED("leds.prox.h.led0")->set(l0); - thymio2->getLED("leds.prox.h.led1")->set(l1); - thymio2->getLED("leds.prox.h.led2")->set(l2); - thymio2->getLED("leds.prox.h.led3")->set(l3); - thymio2->getLED("leds.prox.h.led4")->set(l4); - thymio2->getLED("leds.prox.h.led5")->set(l5); - thymio2->getLED("leds.prox.h.led6")->set(l6); - thymio2->getLED("leds.prox.h.led7")->set(l7); -} - -void set_vprox_leds(AsebaVMState *vm) { - int l0 = vm->variables[AsebaNativePopArg(vm)]; - int l1 = vm->variables[AsebaNativePopArg(vm)]; - - thymio2->setAutomaticBehaviorProxLeds(false); - - thymio2->getLED("leds.prox.v.led0")->set(l0); - thymio2->getLED("leds.prox.v.led1")->set(l1); -} - -void set_rc_leds(AsebaVMState *vm) { - int l = vm->variables[AsebaNativePopArg(vm)]; - thymio2->getLED("leds.rc")->set(l); -} - -void set_sound_leds(AsebaVMState *vm) { - int l = vm->variables[AsebaNativePopArg(vm)]; - thymio2->getLED("leds.sound")->set(l); -} - -void set_ntc_leds(AsebaVMState *vm) { - int l0 = vm->variables[AsebaNativePopArg(vm)]; - int l1 = vm->variables[AsebaNativePopArg(vm)]; - thymio2->getLED("leds.temperature.red")->set(l0); - thymio2->getLED("leds.temperature.blue")->set(l1); -} -} diff --git a/projects/robots/mobsya/thymio/controllers/thymio2_aseba/Thymio2Model.hpp b/projects/robots/mobsya/thymio/controllers/thymio2_aseba/Thymio2Model.hpp deleted file mode 100644 index 3138325c32b..00000000000 --- a/projects/robots/mobsya/thymio/controllers/thymio2_aseba/Thymio2Model.hpp +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 1996-2022 Cyberbotics Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef THYMIO_2_MODEL_HPP -#define THYMIO_2_MODEL_HPP - -#include - -namespace webots { - class Accelerometer; - class DistanceSensor; - class Motor; - class PositionSensor; - class TouchSensor; -} // namespace webots - -class Thymio2AsebaHub; - -class Thymio2Model : public webots::Robot { -public: - Thymio2Model(); - virtual ~Thymio2Model(); - - bool safeStep(); - - void sensorToHub(Thymio2AsebaHub *hub); - void hubToActuators(const Thymio2AsebaHub *hub); - void updateEvents(const Thymio2AsebaHub *hub, bool events[]); - - void setAutomaticBehaviorAccLeds(bool enable) { mAutomaticBehaviorAccLeds = enable; } - void setAutomaticBehaviorButtonLeds(bool enable) { mAutomaticBehaviorButtonLeds = enable; } - void setAutomaticBehaviorProxLeds(bool enable) { mAutomaticBehaviorProxLeds = enable; } - -private: - enum Button { B_BACKWARD, B_LEFT, B_CENTER, B_FORWARD, B_RIGHT }; - enum MotorSide { M_LEFT, M_RIGHT }; - - void initDevices(); - void reset(); - - void behaviorAccLeds(); - void behaviorButtonLeds(); - void behaviorProxLeds(); - - int hertzToBestMsPeriod(int hertz) const; - bool isPeriodicEventFired(int period, int startCounter = 0) const; - - int mTimeStep; - int mStepCounter; - - int mAccelerometerPeriod; - int mProxsPeriod; - int mButtonsPeriod; - int mMotorsPeriod; - - int mLastTimerPeriod[2]; - int mTimerStepStart[2]; - - bool mAutomaticBehaviorAccLeds; - bool mAutomaticBehaviorButtonLeds; - bool mAutomaticBehaviorProxLeds; - - double mLastMotorPosition[2]; - bool mLastButtonsState[5]; - - void updateWindowData(); - int mWindowData[7]; // should match with the robot window implementation - - webots::Accelerometer *mAccelerometer; - webots::TouchSensor *mButtons[5]; - webots::Motor *mMotors[2]; - webots::PositionSensor *mPositionSensors[2]; - webots::DistanceSensor *mHorizontalProxs[7]; - webots::DistanceSensor *mVerticalProxs[2]; -}; - -#endif diff --git a/projects/robots/mobsya/thymio/controllers/thymio2_aseba/aseba b/projects/robots/mobsya/thymio/controllers/thymio2_aseba/aseba deleted file mode 160000 index 3c14f0cb951..00000000000 --- a/projects/robots/mobsya/thymio/controllers/thymio2_aseba/aseba +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3c14f0cb9510c60502821bfd7adb22e795540479 diff --git a/projects/robots/mobsya/thymio/controllers/thymio2_aseba/main.cpp b/projects/robots/mobsya/thymio/controllers/thymio2_aseba/main.cpp deleted file mode 100644 index 8561e8f7ed2..00000000000 --- a/projects/robots/mobsya/thymio/controllers/thymio2_aseba/main.cpp +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 1996-2022 Cyberbotics Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include -#include - -#include "Thymio2AsebaHub.hpp" -#include "Thymio2Model.hpp" - -#include "thymio2_definitions.h" - -#include - -#include // sscanf -#include - -using namespace std; -using namespace webots; - -static void welcomeMessage() { - cout << "Thymio II Aseba server" << endl; - cout << "- Connect Aseba Studio or VPL for Thymio II to this controller through TCP/IP." << endl; - cout << "- Use the Thymio II robot window to access some special events (tap, clap, etc.)." << endl; - cout << "- Change the server port using the Thymio2::controllerArgs field." << endl; -} - -static void usage(const char *command) { - cout << "Usage: " << command << " [port=33333]" << endl; -} - -int main(int argc, char **argv) { - welcomeMessage(); - - Thymio2Model *thymio2 = new Thymio2Model; - - int port = ASEBA_DEFAULT_PORT; - if (argc > 2) { - cerr << "Invalid arguments" << endl; - usage(argv[0]); - } else if (argc == 2) { - if (sscanf(argv[1], "port=%d", &port) != 1) { - cerr << "Invalid arguments" << endl; - usage(argv[0]); - port = ASEBA_DEFAULT_PORT; - } - } - - Thymio2AsebaHub *hub = new Thymio2AsebaHub(port); - - bool events[EVENT_COUNT]; - - while (thymio2->safeStep()) { - hub->step(); - thymio2->sensorToHub(hub); - thymio2->updateEvents(hub, events); - hub->sendEvents(events); - thymio2->hubToActuators(hub); - } - - delete thymio2; - - return EXIT_SUCCESS; -} diff --git a/projects/robots/mobsya/thymio/controllers/thymio2_aseba/thymio2_definitions.c b/projects/robots/mobsya/thymio/controllers/thymio2_aseba/thymio2_definitions.c deleted file mode 100644 index 8e81acc6374..00000000000 --- a/projects/robots/mobsya/thymio/controllers/thymio2_aseba/thymio2_definitions.c +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright 1996-2022 Cyberbotics Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Strongly inspired from https://github.com/aseba-community/aseba-target-thymio2/blob/master/skel-usb-user.c - -#include "thymio2_definitions.h" -#include "thymio2_natives.h" - -const AsebaVMDescription vmDescription = {"thymio-II", - {{1, "_id"}, - {1, "event.source"}, - {VM_VARIABLES_ARG_SIZE, "event.args"}, - {2, "_fwversion"}, - {1, "_productId"}, - - // {5, "buttons._raw"}, - {1, "button.backward"}, - {1, "button.left"}, - {1, "button.center"}, - {1, "button.forward"}, - {1, "button.right"}, - - // {5, "buttons._mean"}, - // {5, "buttons._noise"}, - - {7, "prox.horizontal"}, - - // {7, "prox.comm.rx._payloads"}, - // {7, "prox.comm.rx._intensities"}, - {1, "prox.comm.rx"}, // not implemented - {1, "prox.comm.tx"}, // not implemented - - {2, "prox.ground.ambiant"}, - {2, "prox.ground.reflected"}, - {2, "prox.ground.delta"}, - - {1, "motor.left.target"}, - {1, "motor.right.target"}, - // {2, "_vbat"}, - // {2, "_imot"}, - {1, "motor.left.speed"}, - {1, "motor.right.speed"}, - {1, "motor.left.pwm"}, - {1, "motor.right.pwm"}, - - {3, "acc"}, - - {1, "temperature"}, // not implemented - - {1, "rc5.address"}, // not implemented - {1, "rc5.command"}, // not implemented - - {1, "mic.intensity"}, // not implemented - {1, "mic.threshold"}, // not implemented - {1, "mic._mean"}, // not implemented - - {2, "timer.period"}, - - {1, "acc._tap"}, // not implemented - - {0, NULL}}}; - -const AsebaLocalEventDescription localEvents[] = { - {"button.backward", "Backward button status changed"}, - {"button.left", "Left button status changed"}, - {"button.center", "Center button status changed"}, - {"button.forward", "Forward button status changed"}, - {"button.right", "Right button status changed"}, - {"buttons", "Buttons values updated"}, - {"prox", "Proximity values updated"}, - {"prox.comm", "Data received on the proximity communication"}, // not implemented - {"tap", "A tap is detected"}, // not implemented - {"acc", "Accelerometer values updated"}, - {"mic", "Fired when microphone intensity is above threshold"}, // not implemented - {"sound.finished", "Fired when the playback of a user initiated sound is finished"}, // not implemented - {"temperature", "Temperature value updated"}, // not implemented - {"rc5", "RC5 message received"}, // not implemented - {"motor", "Motor timer"}, - {"timer0", "Timer 0"}, - {"timer1", "Timer 1"}, - {NULL, NULL}}; - -const AsebaNativeFunctionDescription *nativeFunctionsDescriptions[] = {&AsebaNativeDescription__system_reboot, - &AsebaNativeDescription__system_settings_read, - &AsebaNativeDescription__system_settings_write, - &AsebaNativeDescription__system_settings_flash, - - ASEBA_NATIVES_STD_DESCRIPTIONS, - - THYMIO_NATIVES_DESCRIPTIONS, - - &AsebaNativeDescription_poweroff, - 0}; - -AsebaNativeFunctionPointer nativeFunctions[] = {AsebaNative__system_reboot, - AsebaNative__system_settings_read, - AsebaNative__system_settings_write, - AsebaNative__system_settings_flash, - - ASEBA_NATIVES_STD_FUNCTIONS, - - THYMIO_NATIVES_FUNCTIONS, - - power_off}; diff --git a/projects/robots/mobsya/thymio/controllers/thymio2_aseba/thymio2_definitions.h b/projects/robots/mobsya/thymio/controllers/thymio2_aseba/thymio2_definitions.h deleted file mode 100644 index 37ddaa25a1e..00000000000 --- a/projects/robots/mobsya/thymio/controllers/thymio2_aseba/thymio2_definitions.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright 1996-2022 Cyberbotics Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Strongly inspired from https://github.com/aseba-community/aseba-target-thymio2/blob/master/skel-usb-user.h - -#ifndef SKEL_USB_USER_H -#define SKEL_USB_USER_H - -#include - -#define PRODUCT_ID 8 -#define VM_VARIABLES_FREE_SPACE 512 -#define VM_VARIABLES_ARG_SIZE 32 - -struct _vmVariables { - short int id; - short int source; - short int args[VM_VARIABLES_ARG_SIZE]; - short int fwversion[2]; - short int productid; - - // short int buttons[5]; - - short int buttons_state[5]; - // short int buttons_mean[5]; - // short int buttons_noise[5]; - - short int prox[7]; - - // short int sensor_data[7]; - // short int intensity[7]; - short int rx_data; // not implemented - short int ir_tx_data; // not implemented - - short int ground_ambiant[2]; - short int ground_reflected[2]; - short int ground_delta[2]; - - short int target[2]; - // short int vbat[2]; - // short int imot[2]; - short int uind[2]; - short int pwm[2]; - - short int acc[3]; - - short int ntc; // not implemented - - short int rc5_address; // not implemented - short int rc5_command; // not implemented - - short int sound_level; // not implemented - short int sound_tresh; // not implemented - short int sound_mean; // not implemented - - short int timers[2]; - - short int acc_tap; // not implemented - - short int freeSpace[VM_VARIABLES_FREE_SPACE]; -}; - -enum Event { - EVENT_B_BACKWARD = 0, - EVENT_B_LEFT, - EVENT_B_CENTER, - EVENT_B_FORWARD, - EVENT_B_RIGHT, - EVENT_BUTTONS, - EVENT_PROX, - EVENT_DATA, // not implemented - EVENT_TAP, - EVENT_ACC, - EVENT_MIC, - EVENT_SOUND_FINISHED, // not implemented - EVENT_TEMPERATURE, // not implemented - EVENT_RC5, // not implemented - EVENT_MOTOR, - EVENT_TIMER0, - EVENT_TIMER1, - EVENT_COUNT -}; - -#endif diff --git a/projects/robots/mobsya/thymio/controllers/thymio2_aseba/thymio2_natives.c b/projects/robots/mobsya/thymio/controllers/thymio2_aseba/thymio2_natives.c deleted file mode 100644 index 599bcf26938..00000000000 --- a/projects/robots/mobsya/thymio/controllers/thymio2_aseba/thymio2_natives.c +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Copyright 1996-2022 Cyberbotics Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Strongly inspired from https://github.com/aseba-community/aseba-target-thymio2/blob/master/thymio_natives.c -// and https://github.com/aseba-community/aseba-target-thymio2/blob/master/skel-usb.c - -#include "thymio2_natives.h" - -AsebaNativeFunctionDescription AsebaNativeDescription_poweroff = {"_poweroff", "Poweroff", {{0, 0}}}; - -void power_off(AsebaVMState *vm) { -} - -AsebaNativeFunctionDescription AsebaNativeDescription__system_reboot = {"_system.reboot", - "Reboot the microcontroller", - {{0, 0}}}; - -void AsebaNative__system_reboot(AsebaVMState *vm) { -} - -AsebaNativeFunctionDescription AsebaNativeDescription__system_settings_read = {"_system.settings.read", - "Read a setting", - {{1, "address"}, {1, "value"}, {0, 0}}}; - -void AsebaNative__system_settings_read(AsebaVMState *vm) { - /*uint16 address = vm->variables[*/ AsebaNativePopArg(vm) /*]*/; - /*uint16 destidx =*/AsebaNativePopArg(vm); -} - -AsebaNativeFunctionDescription AsebaNativeDescription__system_settings_write = {"_system.settings.write", - "Write a setting", - {{1, "address"}, {1, "value"}, {0, 0}}}; - -void AsebaNative__system_settings_write(AsebaVMState *vm) { - /*uint16 address = vm->variables[*/ AsebaNativePopArg(vm) /*]*/; - /*uint16 sourceidx =*/AsebaNativePopArg(vm); -} - -AsebaNativeFunctionDescription AsebaNativeDescription__system_settings_flash = {"_system.settings.flash", - "Write the settings into flash", - {{0, 0}}}; - -void AsebaNative__system_settings_flash(AsebaVMState *vm) { -} - -AsebaNativeFunctionDescription AsebaNativeDescription_set_led = {"_leds.set", - "Set the led", - {{1, "led"}, {1, "brightness"}, {0, 0}}}; - -AsebaNativeFunctionDescription AsebaNativeDescription_record = {"sound.record", - "Start recording of rN.wav", - { - {1, "N"}, - {0, 0}, - }}; - -AsebaNativeFunctionDescription AsebaNativeDescription_play = {"sound.play", - "Start playback of pN.wav", - { - {1, "N"}, - {0, 0}, - }}; - -AsebaNativeFunctionDescription AsebaNativeDescription_replay = {"sound.replay", - "Start playback of rN.wav", - { - {1, "N"}, - {0, 0}, - }}; - -AsebaNativeFunctionDescription AsebaNativeDescription_sound_system = {"sound.system", - "Start playback of system sound N", - { - {1, "N"}, - {0, 0}, - }}; - -void sound_playback(AsebaVMState *vm) { - /*int number = vm->variables[*/ AsebaNativePopArg(vm) /*]*/; -} - -void sound_record(AsebaVMState *vm) { - /*int number = vm->variables[*/ AsebaNativePopArg(vm) /*]*/; -} - -void sound_replay(AsebaVMState *vm) { - /*int number = vm->variables[*/ AsebaNativePopArg(vm) /*]*/; -} - -void sound_system(AsebaVMState *vm) { - /*int number = vm->variables[*/ AsebaNativePopArg(vm) /*]*/; -} - -AsebaNativeFunctionDescription AsebaNativeDescription_set_led_circle = {"leds.circle", - "Set circular ring leds", - { - {1, "l0"}, - {1, "l1"}, - {1, "l2"}, - {1, "l3"}, - {1, "l4"}, - {1, "l5"}, - {1, "l6"}, - {1, "l7"}, - {0, 0}, - }}; - -AsebaNativeFunctionDescription AsebaNativeDescription_set_led_rgb_top = {"leds.top", - "Set RGB top led", - { - {1, "red"}, - {1, "green"}, - {1, "blue"}, - {0, 0}, - }}; - -AsebaNativeFunctionDescription AsebaNativeDescription_set_led_rgb_br = {"leds.bottom.right", - "Set RGB botom right led", - { - {1, "red"}, - {1, "green"}, - {1, "blue"}, - {0, 0}, - }}; - -AsebaNativeFunctionDescription AsebaNativeDescription_set_led_rgb_bl = {"leds.bottom.left", - "Set RGB botom left led", - { - {1, "red"}, - {1, "green"}, - {1, "blue"}, - {0, 0}, - }}; - -AsebaNativeFunctionDescription AsebaNativeDescription_set_led_buttons = {"leds.buttons", - "Set buttons leds", - { - {1, "l0"}, - {1, "l1"}, - {1, "l2"}, - {1, "l3"}, - {0, 0}, - }}; - -AsebaNativeFunctionDescription AsebaNativeDescription_set_hprox_leds = {"leds.prox.h", - "Set horizontal proximity leds", - { - {1, "l0"}, - {1, "l1"}, - {1, "l2"}, - {1, "l3"}, - {1, "l4"}, - {1, "l5"}, - {1, "l6"}, - {1, "l7"}, - {0, 0}, - }}; - -AsebaNativeFunctionDescription AsebaNativeDescription_set_vprox_leds = {"leds.prox.v", - "Set vertical proximity leds", - { - {1, "l0"}, - {1, "l1"}, - {0, 0}, - }}; - -AsebaNativeFunctionDescription AsebaNativeDescription_set_rc_leds = {"leds.rc", - "Set rc led", - { - {1, "led"}, - {0, 0}, - }}; - -AsebaNativeFunctionDescription AsebaNativeDescription_set_sound_leds = {"leds.sound", - "Set sound led", - { - {1, "led"}, - {0, 0}, - }}; - -AsebaNativeFunctionDescription AsebaNativeDescription_set_ntc_leds = {"leds.temperature", - "Set ntc led", - { - {1, "red"}, - {1, "blue"}, - {0, 0}, - }}; - -AsebaNativeFunctionDescription AsebaNativeDescription_play_freq = {"sound.freq", - "Play frequency", - { - {1, "Hz"}, - {1, "ds"}, - {0, 0}, - }}; - -void play_freq(AsebaVMState *vm) { - /*int freq = vm->variables[*/ AsebaNativePopArg(vm) /*]*/; - /*int time = vm->variables[*/ AsebaNativePopArg(vm) /*]*/; -} - -#define WAVEFORM_SIZE 142 -AsebaNativeFunctionDescription AsebaNativeDescription_set_wave = {"sound.wave", - "Set the primary wave of the tone generator", - { - {WAVEFORM_SIZE, "wave"}, - {0, 0}, - }}; - -void set_wave(AsebaVMState *vm) { - /*int *wave = (int *) vm->variables + */ AsebaNativePopArg(vm); -} - -AsebaNativeFunctionDescription AsebaNativeDescription_prox_network = {"prox.comm.enable", - "Enable or disable the proximity communication", - { - {1, "state"}, - {0, 0}, - }}; - -void prox_network(AsebaVMState *vm) { - /*int enable = vm->variables[*/ AsebaNativePopArg(vm) /*]*/; -} - -AsebaNativeFunctionDescription AsebaNativeDescription_sd_open = {"sd.open", - "Open a file on the SD card", - { - {1, "number"}, - {1, "status"}, - {0, 0}, - }}; - -void thymio_native_sd_open(AsebaVMState *vm) { - /*int no = vm->variables[*/ AsebaNativePopArg(vm) /*]*/; - /*unsigned int status = */ AsebaNativePopArg(vm); -} - -AsebaNativeFunctionDescription AsebaNativeDescription_sd_write = {"sd.write", - "Write data to the opened file", - { - {-1, "data"}, - {1, "written"}, - {0, 0}, - }}; - -void thymio_native_sd_write(AsebaVMState *vm) { - /*unsigned char * data = (unsigned char *) (vm->variables + */ AsebaNativePopArg(vm) /*)*/; - /*uint16 status = */ AsebaNativePopArg(vm); - /*uint16 length = */ AsebaNativePopArg(vm) /* * 2*/; -} - -AsebaNativeFunctionDescription AsebaNativeDescription_sd_read = {"sd.read", - "Read data from the opened file", - { - {-1, "data"}, - {1, "read"}, - {0, 0}, - }}; - -void thymio_native_sd_read(AsebaVMState *vm) { - /*unsigned char * data = (unsigned char *) (vm->variables + */ AsebaNativePopArg(vm) /*)*/; - /*uint16 status =*/AsebaNativePopArg(vm); - /*uint16 length =*/AsebaNativePopArg(vm) /* * 2*/; -} - -AsebaNativeFunctionDescription AsebaNativeDescription_sd_seek = {"sd.seek", - "Seek the opened file", - { - {1, "position"}, - {1, "status"}, - {0, 0}, - }}; - -void thymio_native_sd_seek(AsebaVMState *vm) { - /*unsigned long seek = vm->variables[*/ AsebaNativePopArg(vm) /*]*/; - /*unsigned int status = */ AsebaNativePopArg(vm); -} diff --git a/projects/robots/mobsya/thymio/controllers/thymio2_aseba/thymio2_natives.h b/projects/robots/mobsya/thymio/controllers/thymio2_aseba/thymio2_natives.h deleted file mode 100644 index ce2d2f2fbeb..00000000000 --- a/projects/robots/mobsya/thymio/controllers/thymio2_aseba/thymio2_natives.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright 1996-2022 Cyberbotics Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Strongly inspired from https://github.com/aseba-community/aseba-target-thymio2/blob/master/thymio_natives.h - -#ifndef THYMIO2_NATIVES_H -#define THYMIO2_NATIVES_H - -#include - -extern AsebaNativeFunctionDescription AsebaNativeDescription_poweroff; -void power_off(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription__system_reboot; -void AsebaNative__system_reboot(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription__system_settings_read; -void AsebaNative__system_settings_read(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription__system_settings_write; -void AsebaNative__system_settings_write(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription__system_settings_flash; -void AsebaNative__system_settings_flash(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription_set_led; -void set_led(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription_record; -void sound_record(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription_play; -void sound_playback(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription_replay; -void sound_replay(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription_sound_system; -void sound_system(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription_set_led_circle; -void set_led_circle(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription_set_led_rgb_top; -void set_rgb_top(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription_set_led_rgb_bl; -void set_rgb_bl(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription_set_led_rgb_br; -void set_rgb_br(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription_play_freq; -void play_freq(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription_set_led_buttons; -void set_buttons_leds(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription_set_hprox_leds; -void set_hprox_leds(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription_set_vprox_leds; -void set_vprox_leds(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription_set_rc_leds; -void set_rc_leds(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription_set_sound_leds; -void set_sound_leds(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription_set_ntc_leds; -void set_ntc_leds(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription_set_wave; -void set_wave(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription_prox_network; -void prox_network(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription_sd_open; -void thymio_native_sd_open(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription_sd_write; -void thymio_native_sd_write(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription_sd_read; -void thymio_native_sd_read(AsebaVMState *vm); - -extern AsebaNativeFunctionDescription AsebaNativeDescription_sd_seek; -void thymio_native_sd_seek(AsebaVMState *vm); - -#define THYMIO_NATIVES_DESCRIPTIONS \ - &AsebaNativeDescription_set_led, &AsebaNativeDescription_record, &AsebaNativeDescription_play, \ - &AsebaNativeDescription_replay, &AsebaNativeDescription_sound_system, &AsebaNativeDescription_set_led_circle, \ - &AsebaNativeDescription_set_led_rgb_top, &AsebaNativeDescription_set_led_rgb_bl, &AsebaNativeDescription_set_led_rgb_br, \ - &AsebaNativeDescription_play_freq, &AsebaNativeDescription_set_led_buttons, &AsebaNativeDescription_set_hprox_leds, \ - &AsebaNativeDescription_set_vprox_leds, &AsebaNativeDescription_set_rc_leds, &AsebaNativeDescription_set_sound_leds, \ - &AsebaNativeDescription_set_ntc_leds, &AsebaNativeDescription_set_wave, &AsebaNativeDescription_prox_network, \ - &AsebaNativeDescription_sd_open, &AsebaNativeDescription_sd_write, &AsebaNativeDescription_sd_read, \ - &AsebaNativeDescription_sd_seek - -#define THYMIO_NATIVES_FUNCTIONS \ - set_led, sound_record, sound_playback, sound_replay, sound_system, set_led_circle, set_rgb_top, set_rgb_bl, set_rgb_br, \ - play_freq, set_buttons_leds, set_hprox_leds, set_vprox_leds, set_rc_leds, set_sound_leds, set_ntc_leds, set_wave, \ - prox_network, thymio_native_sd_open, thymio_native_sd_write, thymio_native_sd_read, thymio_native_sd_seek - -#endif diff --git a/projects/robots/mobsya/thymio/libraries/.gitignore b/projects/robots/mobsya/thymio/libraries/.gitignore deleted file mode 100644 index 4bcd9a2732d..00000000000 --- a/projects/robots/mobsya/thymio/libraries/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/dashel diff --git a/projects/robots/mobsya/thymio/libraries/Makefile b/projects/robots/mobsya/thymio/libraries/Makefile deleted file mode 100644 index 1252ade1217..00000000000 --- a/projects/robots/mobsya/thymio/libraries/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 1996-2022 Cyberbotics Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -null := -space := $(null) $(null) -WEBOTS_HOME_PATH?=$(subst $(space),\ ,$(strip $(subst \,/,$(WEBOTS_HOME)))) -include $(WEBOTS_HOME_PATH)/resources/Makefile.os.include - -ifeq ($(OSTYPE),windows) -CMAKE_FLAGS = -G "MSYS Makefiles" -endif - -ifeq ($(OSTYPE),linux) -unexport LD_LIBRARY_PATH -endif - -release debug profile: -ifneq (, $(shell which cmake 2> /dev/null)) - @mkdir -p dashel/dashel - @cmake -Bdashel -Hdashel-src $(CMAKE_FLAGS) > /dev/null - @cp dashel-src/dashel/dashel.h dashel/dashel/ - @+make -C dashel > /dev/null -else - @echo -e "# \033[0;33mcmake not installed, skipping dashel library\033[0m" -endif - -clean: - @rm -fr dashel diff --git a/projects/robots/mobsya/thymio/libraries/dashel-src b/projects/robots/mobsya/thymio/libraries/dashel-src deleted file mode 160000 index 1a8d36e7fe4..00000000000 --- a/projects/robots/mobsya/thymio/libraries/dashel-src +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1a8d36e7fe48ce0f4fd292f5b64b2a0a880953da diff --git a/projects/robots/mobsya/thymio/protos/Thymio2.proto b/projects/robots/mobsya/thymio/protos/Thymio2.proto index df0c34549c9..399a1692c96 100644 --- a/projects/robots/mobsya/thymio/protos/Thymio2.proto +++ b/projects/robots/mobsya/thymio/protos/Thymio2.proto @@ -13,18 +13,18 @@ EXTERNPROTO "Thymio2DistanceSensor.proto" EXTERNPROTO "Thymio2LED.proto" PROTO Thymio2 [ - field SFVec3f translation 0 0 0 # Is `Transform.translation`. - field SFRotation rotation 0 0 1 0 # Is `Transform.rotation`. - field SFString name "Thymio II" # Is `Solid.name`. - field SFString controller "thymio2_aseba" # Is `Robot.controller`. - field MFString controllerArgs "port=33333" # Is `Robot.controllerArgs`. - field SFString window "" # Is `Robot.window`. - field SFString customData "" # Is `Robot.customData`. - field SFBool supervisor FALSE # Is `Robot.supervisor`. - field SFBool synchronization TRUE # Is `Robot.synchronization`. - field SFString contactMaterial "thymio body" # Defines the `Solid.contactMaterial` for the body. - field SFBool castLight TRUE # Defines whether OpenGL lights are cerated for each LEDs. - field MFNode bodySlot [] # Extends the robot with new nodes in the body slot. + field SFVec3f translation 0 0 0 # Is `Transform.translation`. + field SFRotation rotation 0 0 1 0 # Is `Transform.rotation`. + field SFString name "Thymio II" # Is `Solid.name`. + field SFString controller "thymio2_demo" # Is `Robot.controller`. + field MFString controllerArgs [] # Is `Robot.controllerArgs`. + field SFString window "" # Is `Robot.window`. + field SFString customData "" # Is `Robot.customData`. + field SFBool supervisor FALSE # Is `Robot.supervisor`. + field SFBool synchronization TRUE # Is `Robot.synchronization`. + field SFString contactMaterial "thymio body" # Defines the `Solid.contactMaterial` for the body. + field SFBool castLight TRUE # Defines whether OpenGL lights are cerated for each LEDs. + field MFNode bodySlot [] # Extends the robot with new nodes in the body slot. ] { Robot { diff --git a/projects/robots/robotis/darwin-op/plugins/robot_windows/Makefile b/projects/robots/robotis/darwin-op/plugins/robot_windows/Makefile index 3a2e35e3e87..4d43d141c76 100644 --- a/projects/robots/robotis/darwin-op/plugins/robot_windows/Makefile +++ b/projects/robots/robotis/darwin-op/plugins/robot_windows/Makefile @@ -36,10 +36,10 @@ release debug profile clean: $(TARGETS) %.Makefile: ifeq ($(NO_LIBSSH),1) - +@echo -e "# \033[0;33mlibssh not installed, skipping Robotis OP2 robot window\033[0m" + +@$(ECHO) "# \033[0;33mlibssh not installed, skipping Robotis OP2 robot window\033[0m" else ifeq ($(NO_LIBZIP),1) - +@echo -e "# \033[0;33mlibzip not installed, skipping Robotis OP2 robot window\033[0m" + +@$(ECHO) "# \033[0;33mlibzip not installed, skipping Robotis OP2 robot window\033[0m" else +@echo "# make" $(MAKECMDGOALS) $(@:.Makefile=) +@make -s -C $(@:.Makefile=) $(MAKECMDGOALS) diff --git a/projects/robots/robotis/darwin-op/plugins/robot_windows/robotis-op2_window/Makefile b/projects/robots/robotis/darwin-op/plugins/robot_windows/robotis-op2_window/Makefile index 03a69e72070..bf96fa1b4b4 100644 --- a/projects/robots/robotis/darwin-op/plugins/robot_windows/robotis-op2_window/Makefile +++ b/projects/robots/robotis/darwin-op/plugins/robot_windows/robotis-op2_window/Makefile @@ -41,6 +41,7 @@ ifeq ($(OSTYPE),darwin) LIBRARIES += -L"$(WEBOTS_HOME)/projects/robots/robotis/darwin-op/libraries/libzip" -lnihzip -L"$(WEBOTS_HOME)/projects/robots/robotis/darwin-op/libraries/libssh" -lssh INCLUDE += -I"$(WEBOTS_HOME)/projects/robots/robotis/darwin-op/libraries/libzip/include/libzip" -I"$(WEBOTS_HOME)/projects/robots/robotis/darwin-op/libraries/libssh/include/libssh" NO_FAT_BINARY = 1 +PROCESSOR = x86_64 endif ifeq ($(OSTYPE),linux) @@ -79,6 +80,7 @@ ifeq ($(OSTYPE),darwin) INCLUDE += -F"$(FRAMEWORKS_DIR)" FRAMEWORKS += -F"$(FRAMEWORKS_DIR)" DYNAMIC_LIBRARIES += -bind_at_load $(FRAMEWORKS) + LD_FLAGS = -target $(PROCESSOR)-apple-macos11 MOC = "$(WEBOTS_HOME)/bin/qt/moc" MOC_PLATFORM_FLAGS = -D__APPLE__ FRAMEWORKS += -framework QtCore -framework QtGui -framework QtWidgets -framework QtConcurrent diff --git a/projects/vehicles/controllers/ros_automobile/Makefile b/projects/vehicles/controllers/ros_automobile/Makefile index f3bca867be0..c7d7d163c1f 100644 --- a/projects/vehicles/controllers/ros_automobile/Makefile +++ b/projects/vehicles/controllers/ros_automobile/Makefile @@ -30,11 +30,11 @@ endif PYTHON_COMMAND ?= python3 ifeq (, $(ROS_DISTRO)) release debug profile clean: - @echo "# \033[0;33mROS not installed or 'ROS_DISTRO' not defined\033[0m" + @$(ECHO) "# \033[0;33mROS not installed or 'ROS_DISTRO' not defined\033[0m" else ifeq (2, $(ROS_VERSION)) release debug profile clean: - @echo "# \033[0;33mROS_DISTRO should not be a ROS2 distribution\033[0m" + @$(ECHO) "# \033[0;33mROS_DISTRO should not be a ROS2 distribution\033[0m" else CXX_SOURCES = $(wildcard *.cpp) CXX_SOURCES += $(wildcard $(WEBOTS_HOME_PATH)/projects/default/controllers/ros/Ros*.cpp) diff --git a/projects/vehicles/plugins/robot_windows/automobile_window/Makefile b/projects/vehicles/plugins/robot_windows/automobile_window/Makefile index 022a6b2e4ce..3421d073f37 100644 --- a/projects/vehicles/plugins/robot_windows/automobile_window/Makefile +++ b/projects/vehicles/plugins/robot_windows/automobile_window/Makefile @@ -27,6 +27,7 @@ HPP_FILES_TO_MOC = GeneralInformationWidget.hpp AbstractWidget.hpp USE_C_API = true NO_FAT_BINARY = 1 +PROCESSOR = x86_64 QT_UTILS = $(WEBOTS_HOME)/resources/projects/libraries/qt_utils INCLUDE = -I"$(QT_UTILS)" LIBRARIES = -L"$(QT_UTILS)" -lqt_utils -ldriver -lcar @@ -59,10 +60,11 @@ ifeq ($(OSTYPE),linux) endif ifeq ($(OSTYPE),darwin) - WBCFLAGS += -Wno-unknown-pragmas + WBCFLAGS += -Wno-unknown-pragmas -target $(PROCESSOR)-apple-macos11 FRAMEWORKS_DIR = $(WEBOTS_HOME)/Contents/Frameworks INCLUDE += -F"$(FRAMEWORKS_DIR)" FRAMEWORKS += -F"$(FRAMEWORKS_DIR)" + LD_FLAGS = -target $(PROCESSOR)-apple-macos11 DYNAMIC_LIBRARIES += -bind_at_load $(FRAMEWORKS) MOC = "$(WEBOTS_HOME)/bin/qt/moc" MOC_PLATFORM_FLAGS = -D__APPLE__ diff --git a/resources/Makefile.include b/resources/Makefile.include index e20bd5c0cc4..1d10d985bde 100644 --- a/resources/Makefile.include +++ b/resources/Makefile.include @@ -320,6 +320,10 @@ ifeq ($(OSTYPE),linux) endif ifeq ($(OSTYPE),darwin) +ifdef NO_FAT_BINARY + WBCFLAGS += -target $(PROCESSOR)-apple-macos11 + DYNAMIC_LINK_FLAGS += -target $(PROCESSOR)-apple-macos11 +endif WBCFLAGS += -mmacosx-version-min=$(MACOSX_MIN_SDK_VERSION) DYNAMIC_LINK_FLAGS += -mmacosx-version-min=$(MACOSX_MIN_SDK_VERSION) endif @@ -511,7 +515,7 @@ ifdef VS_DEF_NAME mv out.lib $(MAIN_TARGET_WINDOWS64_LIB); \ rm -f *.exp; \ else \ - echo "'VISUAL_STUDIO_PATH' environmental variable not set or Microsoft Visual Studio not installed, skipping $(NAME).lib"; \ + $(ECHO) "\033[0;33m'VISUAL_STUDIO_PATH' environmental variable not set or Microsoft Visual Studio not installed, skipping $(NAME).lib\033[0m"; \ fi \ fi endif @@ -533,7 +537,7 @@ ifdef VS_DEF_NAME mv out.lib $(MAIN_TARGET_WINDOWS64_LIB); \ rm -f *.exp; \ else \ - echo "'VISUAL_STUDIO_PATH' environmental variable not set or Microsoft Visual Studio not installed, skipping $(NAME).lib"; \ + $(ECHO) "\033[0;33m'VISUAL_STUDIO_PATH' environmental variable not set or Microsoft Visual Studio not installed, skipping $(NAME).lib\033[0m"; \ fi \ fi endif @@ -551,12 +555,10 @@ ARM64_OBJECTS = $(addprefix $(BUILD_GOAL_DIR)/arm64/, $(OBJECTS_LIST)) $(BUILD_GOAL_DIR)/$(MAIN_TARGET): $(BUILD_GOAL_DIR)/x86_64/$(MAIN_TARGET) $(BUILD_GOAL_DIR)/arm64/$(MAIN_TARGET) @echo "# creating fat" $(notdir $@) $(SILENT)lipo -create -output $@ $(BUILD_GOAL_DIR)/x86_64/$(MAIN_TARGET) $(BUILD_GOAL_DIR)/arm64/$(MAIN_TARGET) - $(SILENT)codesign -s - $@ $(TARGET_LIB_DIR)/$(MAIN_TARGET): $(BUILD_GOAL_DIR)/x86_64/$(MAIN_TARGET) $(BUILD_GOAL_DIR)/arm64/$(MAIN_TARGET) @echo "# creating fat" $(notdir $@) $(SILENT)lipo -create -output $@ $(BUILD_GOAL_DIR)/x86_64/$(MAIN_TARGET) $(BUILD_GOAL_DIR)/arm64/$(MAIN_TARGET) - $(SILENT)codesign -s - $@ $(BUILD_GOAL_DIR)/x86_64/$(MAIN_TARGET): $(X86_64_OBJECTS) $(LINK_DEPENDENCIES) @echo "# linking" $(notdir $@) "(x86_64)" diff --git a/resources/Makefile.java.include b/resources/Makefile.java.include index 1433ec3db62..9f3f0166a05 100644 --- a/resources/Makefile.java.include +++ b/resources/Makefile.java.include @@ -101,10 +101,10 @@ endif ifeq ($(JAVA_HOME),) release debug profile: - @echo -e "# \033[0;33mJava not installed or 'JAVA_HOME' not set, skipping Java API\033[0m" + @$(ECHO) "# \033[0;33mJava not installed or 'JAVA_HOME' not set, skipping Java API\033[0m" else ifeq (,$(wildcard $(WEBOTS_JAVA_LIB))) release debug profile: - @echo -e "# \033[0;33mJava library not compiled, skipping Java API\033[0m" + @$(ECHO) "# \033[0;33mJava library not compiled, skipping Java API\033[0m" else release debug profile: @javac $(JAVAC_OPTS) *.java diff --git a/resources/Makefile.os.include b/resources/Makefile.os.include index 31adaeb7c98..35d05e89c70 100644 --- a/resources/Makefile.os.include +++ b/resources/Makefile.os.include @@ -19,7 +19,7 @@ ifeq ($(OS),Windows_NT) endif ifndef OSTYPE - OSTYPE = $(shell uname) + OSTYPE := $(shell uname) endif ifeq ($(OSTYPE),Linux) @@ -74,7 +74,7 @@ ifeq ($(OSTYPE),darwin) SUPPORTED_SDK = 11 12 MACOSX_MIN_SDK_VERSION = 11 - + ECHO = echo # cf. https://stackoverflow.com/a/30225756/2210777 MACOSX_SDK_PATH = $(shell xcrun --sdk macosx --show-sdk-path) ifeq ($(wildcard $(MACOSX_SDK_PATH)),) @@ -85,6 +85,8 @@ ifeq ($(OSTYPE),darwin) ## Only recent SDKs are working, but this doesn't prevent to use others. $(warning Your macOS SDK ("$(MACOSX_SDK_PATH)") is $(MACOSX_SDK_VERSION) while Webots supports the $(SUPPORTED_SDK) SDKs.) endif +else + ECHO = echo -e endif # extensions and prefixes diff --git a/scripts/install/bash_profile.mac b/scripts/install/bash_profile.mac index b4548c0470f..afd0b3779fe 100644 --- a/scripts/install/bash_profile.mac +++ b/scripts/install/bash_profile.mac @@ -18,4 +18,4 @@ export WEBOTS_ALLOW_MODIFY_INSTALLATION=1 # If defined, you are ######################################################################### export WEBOTS_HOME=$HOME/webots # Defines the path to Webots home. -export WEBOTS_HOME_PATH=$WEBOTS_HOME/Contents # Defines the path to Webots home Contents folder (used for finding include files when compiling from a terminal). +export JAVA_HOME="$(/usr/libexec/java_home)" diff --git a/scripts/packaging/files_core.txt b/scripts/packaging/files_core.txt index a6dba9c6794..081ed160f46 100644 --- a/scripts/packaging/files_core.txt +++ b/scripts/packaging/files_core.txt @@ -87,6 +87,8 @@ lib/controller/generic_robot_window [dll,windows,linux] lib/controller/python/ [windows,linux] lib/controller/python/controller/ [windows,linux] lib/controller/python/controller/*.py [windows,linux] +lib/controller/python/vehicle/ [windows,linux] +lib/controller/python/vehicle/*.py [windows,linux] lib/controller/matlab/ [windows,linux] lib/controller/matlab/allincludes.h [windows,linux] @@ -322,6 +324,8 @@ Contents/lib/controller/generic_robot_window [dll,mac] Contents/lib/controller/python/ [mac] Contents/lib/controller/python/controller/ [mac] Contents/lib/controller/python/controller/*.py [mac] +Contents/lib/controller/python/vehicle/ [mac] +Contents/lib/controller/python/vehicle/*.py [mac] Contents/lib/controller/matlab/ [mac] Contents/lib/controller/matlab/allincludes.h [mac] diff --git a/scripts/packaging/generate_asset_cache.py b/scripts/packaging/generate_asset_cache.py index 82e983a16e3..fb7370e99ba 100644 --- a/scripts/packaging/generate_asset_cache.py +++ b/scripts/packaging/generate_asset_cache.py @@ -27,7 +27,7 @@ ] SKIPPED_DIRECTORIES = [ - '/robot_windows/', '/thymio2_aseba/' + '/robot_windows/' ] # ensure WEBOTS_HOME is set and tag was provided diff --git a/scripts/packaging/mac_distro.py b/scripts/packaging/mac_distro.py index 23d3fa02f24..29d3780dddf 100644 --- a/scripts/packaging/mac_distro.py +++ b/scripts/packaging/mac_distro.py @@ -43,7 +43,7 @@ def check_rpath(home_path): frameworkFiles[i] = re.sub(r"^/", "", frameworkFiles[i]) controllerFiles = command('find projects resources -name controllers | ' 'xargs -I{} find {} -maxdepth 1 -mindepth 1 -type d | ' - 'grep -v ros | grep -v thymio2_aseba | ' + 'grep -v ros | ' 'sed -e "s:\\(.*\\)/\\([^/]*\\):\\1/\\2/\\2:" | ' 'perl -ne \'chomp(); if (-e $_) {print "$_\n"}\' ').split() binaryFiles = [ @@ -69,6 +69,8 @@ def check_rpath(home_path): dependencies = command('otool -L ' + f + ' | grep -v ' + f + ': | sed -e "s: (compatibility.*::" | ' 'sed -e "s:^[ \t]*::"').split('\n') for d in dependencies: + if d.startswith(f + ' ('): + continue if (not d.startswith('/') and not d.startswith('@rpath/')) or 'local' in d: success = False sys.stderr.write('Dependency error:\n') diff --git a/scripts/packaging/recurse_in_projects.txt b/scripts/packaging/recurse_in_projects.txt index 54f83e2a0db..2a3767b15a4 100644 --- a/scripts/packaging/recurse_in_projects.txt +++ b/scripts/packaging/recurse_in_projects.txt @@ -1,3 +1,2 @@ projects/default/resources/sumo projects/robots/gctronic/e-puck/transfer/xc16 -projects/robots/mobsya/thymio/controllers/thymio2_aseba/aseba diff --git a/src/controller/c/Makefile b/src/controller/c/Makefile index abb926774f6..739e820503d 100644 --- a/src/controller/c/Makefile +++ b/src/controller/c/Makefile @@ -127,7 +127,7 @@ $(WEBOTS_CONTROLLER_LIB_PATH)/Controller.dll: $(MINGW64_OBJECTS) Controller.def $(WEBOTS_CONTROLLER_LIB_PATH)/Controller.lib: $(WEBOTS_CONTROLLER_LIB_PATH)/Controller.dll Controller.def ifeq ($(VISUAL_STUDIO_PATH),) - @echo -e "# \033[0;33m'VISUAL_STUDIO_PATH' not set, skipping Controller.lib\033[0m" + @$(ECHO) "# \033[0;33m'VISUAL_STUDIO_PATH' not set, skipping Controller.lib\033[0m" else @echo "# creating "$@ @PATH="$(VISUAL_STUDIO_PATH)/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64":$PATH lib /machine:X64 /def:Controller.def /out:Controller.lib > /dev/null diff --git a/src/controller/java/Makefile b/src/controller/java/Makefile index 8a170bee37b..d35b6048793 100644 --- a/src/controller/java/Makefile +++ b/src/controller/java/Makefile @@ -133,10 +133,10 @@ endif # rules ifeq ($(SWIG_EXISTS),) release debug profile: - @echo -e "# \033[0;33mSWIG not installed, skipping Java API\033[0m" + @$(ECHO) "# \033[0;33mSWIG not installed, skipping Java API\033[0m" else ifeq ($(JAVA_HOME),) release debug profile: - @echo -e "# \033[0;33mJava not installed or 'JAVA_HOME' not set, skipping Java API\033[0m" + @$(ECHO) "# \033[0;33mJava not installed or 'JAVA_HOME' not set, skipping Java API\033[0m" else release debug profile: $(JAR_FILE) $(TARGET) diff --git a/src/controller/matlab/Makefile b/src/controller/matlab/Makefile index a9dc7c36f19..ffc374d6ae4 100644 --- a/src/controller/matlab/Makefile +++ b/src/controller/matlab/Makefile @@ -26,7 +26,7 @@ PYTHON_OK := $(shell which python3) release debug profile: @echo "# generating matlab" ifeq ('$(PYTHON_OK)','') - @echo "# \033[0;33mUnable to find python3, skipping matlab API\033[0m" + @$(ECHO) "# \033[0;33mUnable to find python3, skipping matlab API\033[0m" else $(shell python3 mgenerate.py;) endif