Skip to content

Commit

Permalink
Revert Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MNikoliCC committed Nov 25, 2024
1 parent 8bfd582 commit e2c19c4
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 37 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/tests_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-14, windows-2019]
os: [ubuntu-22.04, macos-14, windows-2019]
python: [3.9]
include:
- os: ubuntu-24.04
- os: ubuntu-22.04
DEPENDENCIES_INSTALLATION: "wget https://github.com/danmar/cppcheck/archive/refs/tags/2.14.2.tar.gz; tar -xf 2.14.2.tar.gz -C ~/; mkdir -p ~/cppcheck-2.14.2/build; cd ~/cppcheck-2.14.2/build; cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..; cmake --build . --config RelWithDebInfo; export PATH=~/cppcheck-2.14.2/build/bin:$PATH"
- os: macos-14
DEPENDENCIES_INSTALLATION: "brew tap-new --no-git $USER/local-cppcheck; brew extract --version=2.14.2 cppcheck $USER/local-cppcheck; brew install [email protected]; brew tap-new --no-git $USER/local-clang-format; brew extract --version=14.0.0 clang-format $USER/local-clang-format; brew install [email protected]"
Expand All @@ -47,7 +47,7 @@ jobs:
if: needs.job-skipper.outputs.should_skip != 'true'
steps:
- name: OS check
if: (matrix.os == 'ubuntu-24.04' && matrix.python == '3.9') || github.event_name == 'schedule' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'test sources')
if: (matrix.os == 'ubuntu-22.04' && matrix.python == '3.9') || github.event_name == 'schedule' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'test sources')
run: |
echo "job_needed=true" >> "$GITHUB_OUTPUT"
id: os_check
Expand All @@ -72,3 +72,4 @@ jobs:
cp dependencies/.clang-format-9 .clang-format
pip install -r tests/sources/requirements.txt
python -m unittest discover -s tests/sources -v
6 changes: 3 additions & 3 deletions .github/workflows/tests_sources_with_latest_cppcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-14, windows-2019]
os: [ubuntu-22.04, macos-14, windows-2019]
python: [3.9]
include:
- os: ubuntu-24.04
- os: ubuntu-22.04
DEPENDENCIES_INSTALLATION: "sudo apt -y install cppcheck"
- os: macos-14
DEPENDENCIES_INSTALLATION: "brew install cppcheck; brew tap-new --no-git $USER/local-clang-format; brew extract --version=14.0.0 clang-format $USER/local-clang-format; brew install [email protected]"
Expand All @@ -43,7 +43,7 @@ jobs:
if: needs.job-skipper.outputs.should_skip != 'true'
steps:
- name: OS check
if: (matrix.os == 'ubuntu-24.04' && matrix.python == '3.9') || github.event_name == 'schedule' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'test sources')
if: (matrix.os == 'ubuntu-22.04' && matrix.python == '3.9') || github.event_name == 'schedule' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'test sources')
run: |
echo "job_needed=true" >> "$GITHUB_OUTPUT"
id: os_check
Expand Down
56 changes: 42 additions & 14 deletions projects/robots/epfl/lis/controllers/blimp/js.h
Original file line number Diff line number Diff line change
Expand Up @@ -467,25 +467,53 @@ class jsJoystick {
#endif
}

~jsJoystick() { close(); }
~jsJoystick() {
close();
}

int getNumAxes() const { return num_axes; }
int notWorking() const { return error; }
void setError() { error = JS_TRUE; }
int getNumAxes() const {
return num_axes;
}
int notWorking() const {
return error;
}
void setError() {
error = JS_TRUE;
}

float getDeadBand(int axis) const { return dead_band[axis]; }
void setDeadBand(int axis, float db) { dead_band[axis] = db; }
float getDeadBand(int axis) const {
return dead_band[axis];
}
void setDeadBand(int axis, float db) {
dead_band[axis] = db;
}

float getSaturation(int axis) const { return saturate[axis]; }
void setSaturation(int axis, float st) { saturate[axis] = st; }
float getSaturation(int axis) const {
return saturate[axis];
}
void setSaturation(int axis, float st) {
saturate[axis] = st;
}

void setMinRange(const float *axes) { memcpy(min, axes, num_axes * sizeof(float)); }
void setMaxRange(const float *axes) { memcpy(max, axes, num_axes * sizeof(float)); }
void setCenter(const float *axes) { memcpy(center, axes, num_axes * sizeof(float)); }
void setMinRange(const float *axes) {
memcpy(min, axes, num_axes * sizeof(float));
}
void setMaxRange(const float *axes) {
memcpy(max, axes, num_axes * sizeof(float));
}
void setCenter(const float *axes) {
memcpy(center, axes, num_axes * sizeof(float));
}

void getMinRange(float *axes) { memcpy(axes, min, num_axes * sizeof(float)); }
void getMaxRange(float *axes) { memcpy(axes, max, num_axes * sizeof(float)); }
void getCenter(float *axes) { memcpy(axes, center, num_axes * sizeof(float)); }
void getMinRange(float *axes) {
memcpy(axes, min, num_axes * sizeof(float));
}
void getMaxRange(float *axes) {
memcpy(axes, max, num_axes * sizeof(float));
}
void getCenter(float *axes) {
memcpy(axes, center, num_axes * sizeof(float));
}

void read(int *buttons, float *axes) {
if (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,33 @@

using namespace webotsQtUtils;

QStringList hiddenDevices =
(QStringList() << "left_steer" << "right_steer" << "right_steer_sensor" << "left_steer_sensor" << "left_front_wheel"
<< "right_front_wheel" << "left_rear_wheel" << "right_rear_wheel" << "left_front_sensor"
<< "right_front_sensor" << "left_rear_sensor" << "right_rear_sensor" << "left_wiper_motor"
<< "right_wiper_motor" << "wiper_sensor" << "left_wing_yaw_mirror_motor" << "left_wing_pitch_mirror_motor"
<< "right_wing_yaw_mirror_motor" << "right_wing_pitch_mirror_motor" << "rear_yaw_mirror_motor"
<< "rear_pitch_mirror_motor" << "rear_yaw_mirror_frame_motor" << "rear_pitch_mirror_frame_motor"
<< "steering_wheel_motor" << "speed_needle_motor" << "indicator_lever_motor" << "rpm_needle_motor");
QStringList hiddenDevices = (QStringList() << "left_steer"
<< "right_steer"
<< "right_steer_sensor"
<< "left_steer_sensor"
<< "left_front_wheel"
<< "right_front_wheel"
<< "left_rear_wheel"
<< "right_rear_wheel"
<< "left_front_sensor"
<< "right_front_sensor"
<< "left_rear_sensor"
<< "right_rear_sensor"
<< "left_wiper_motor"
<< "right_wiper_motor"
<< "wiper_sensor"
<< "left_wing_yaw_mirror_motor"
<< "left_wing_pitch_mirror_motor"
<< "right_wing_yaw_mirror_motor"
<< "right_wing_pitch_mirror_motor"
<< "rear_yaw_mirror_motor"
<< "rear_pitch_mirror_motor"
<< "rear_yaw_mirror_frame_motor"
<< "rear_pitch_mirror_frame_motor"
<< "steering_wheel_motor"
<< "speed_needle_motor"
<< "indicator_lever_motor"
<< "rpm_needle_motor");

Viewer::Viewer() : GenericWindow(hiddenDevices) {
mGeneralInformationWidget = new GeneralInformationWidget(this);
Expand Down
15 changes: 7 additions & 8 deletions src/webots/gui/WbConsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,14 +336,14 @@ void ConsoleEdit::showCustomContextMenu(const QPoint &pt) {
namespace {
void odeErrorFunc(int errnum, const char *msg, va_list ap) {
const QString error = QString::vasprintf(msg, ap);
emit WbLog::instance() -> logEmitted(WbLog::ERROR, QString("ODE Error %1: ").arg(errnum) + error, false,
WbLog::filterName(WbLog::ODE));
emit WbLog::instance()->logEmitted(WbLog::ERROR, QString("ODE Error %1: ").arg(errnum) + error, false,
WbLog::filterName(WbLog::ODE));
}

void odeDebugFunc(int errnum, const char *msg, va_list ap) {
const QString debug = QString::vasprintf(msg, ap);
emit WbLog::instance() -> logEmitted(WbLog::DEBUG, QString("ODE INTERNAL ERROR %1: ").arg(errnum) + debug, false,
WbLog::filterName(WbLog::ODE));
emit WbLog::instance()->logEmitted(WbLog::DEBUG, QString("ODE INTERNAL ERROR %1: ").arg(errnum) + debug, false,
WbLog::filterName(WbLog::ODE));
}

void odeMessageFunc(int errnum, const char *msg, va_list ap) {
Expand All @@ -354,11 +354,10 @@ namespace {
"your bounding object(s), reducing the number of joints, or reducing "
"WorldInfo.basicTimeStep.");

emit WbLog::instance() -> logEmitted(WbLog::WARNING, QString("WARNING: ") + message, false,
WbLog::filterName(WbLog::ODE));
emit WbLog::instance()->logEmitted(WbLog::WARNING, QString("WARNING: ") + message, false, WbLog::filterName(WbLog::ODE));
} else
emit WbLog::instance() -> logEmitted(WbLog::WARNING, QString("ODE Message %1: ").arg(errnum) + message, false,
WbLog::filterName(WbLog::ODE));
emit WbLog::instance()->logEmitted(WbLog::WARNING, QString("ODE Message %1: ").arg(errnum) + message, false,
WbLog::filterName(WbLog::ODE));
}
} // namespace

Expand Down
4 changes: 3 additions & 1 deletion src/webots/gui/WbRobotWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ bool WbRobotWindow::openOnWebBrowser(const QString &url, const QString &program,
return WbDesktopServices::openUrl(url);

systemProgram = "cmd";
arguments << "/Q" << "/C" << "start" << program;
arguments << "/Q"
<< "/C"
<< "start" << program;
#elif __linux__
if (program.isEmpty())
return WbDesktopServices::openUrl(url);
Expand Down

0 comments on commit e2c19c4

Please sign in to comment.