Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MacOS Runner #6580

Merged
merged 87 commits into from
Jul 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
88eb187
use latest macos runner
CoolSpy3 Jul 10, 2024
2612806
try macos 13
CoolSpy3 Jul 10, 2024
db012af
remove unnecessary stdlib argument
CoolSpy3 Jul 10, 2024
53a9b7f
Revert "remove unnecessary stdlib argument"
CoolSpy3 Jul 10, 2024
a0363d8
fix typo in Makefile.include
CoolSpy3 Jul 10, 2024
ff18ad6
don't use stdlib with c
CoolSpy3 Jul 10, 2024
f674c45
suppress unused-but-set-variable warning in ode
CoolSpy3 Jul 10, 2024
0766813
apply changes on macos
CoolSpy3 Jul 10, 2024
44b4efb
disable single-bit-bitfield-constant-conversion warning
CoolSpy3 Jul 10, 2024
21e2ff7
add macos sdk 13 to the list of supported versions
CoolSpy3 Jul 10, 2024
da6106a
fix Field::setSFColor definition
CoolSpy3 Jul 10, 2024
e9b301b
fix base_move definition
CoolSpy3 Jul 10, 2024
09cbea6
target macos12
CoolSpy3 Jul 10, 2024
b3ba282
update supported sdks
CoolSpy3 Jul 10, 2024
b49b9d6
rename kIOMasterPortDefault to kIOMainPortDefault
CoolSpy3 Jul 11, 2024
cdcf3c7
update docs
CoolSpy3 Jul 11, 2024
cca2d71
update changelog
CoolSpy3 Jul 11, 2024
269c1de
try macos 14 again
CoolSpy3 Jul 11, 2024
809d226
Merge branch 'master' of https://github.com/cyberbotics/webots into u…
CoolSpy3 Jul 11, 2024
7f49550
run test sources with latest cppcheck
CoolSpy3 Jul 11, 2024
f956edb
fix config file
CoolSpy3 Jul 11, 2024
93f72b6
try enabling workflow on all branches
CoolSpy3 Jul 11, 2024
6fb517c
revert last three commits
CoolSpy3 Jul 11, 2024
a9dba77
bump cppcheck
CoolSpy3 Jul 11, 2024
cb396b2
actually bump cpp check
CoolSpy3 Jul 11, 2024
728dd68
bump cppcheck to latest
CoolSpy3 Jul 11, 2024
7b2bb6c
bump delete artifacts task to macos 14
CoolSpy3 Jul 11, 2024
45fe4cb
fix pass by value warnings
CoolSpy3 Jul 11, 2024
2c10e21
fix variable scope warnings
CoolSpy3 Jul 11, 2024
c07e5ae
fix c-style cast warnings
CoolSpy3 Jul 11, 2024
9877ee0
fix knownConditionTrueFalse warnings
CoolSpy3 Jul 11, 2024
7a6f20c
fix return by reference warnings
CoolSpy3 Jul 11, 2024
9d653d9
suppress some warnings globally
CoolSpy3 Jul 11, 2024
5836abb
revert warning fixes
CoolSpy3 Jul 11, 2024
e337a69
Revert "revert warning fixes"
CoolSpy3 Jul 12, 2024
4800f56
remove returnByReference suppressions
CoolSpy3 Jul 12, 2024
642eccb
run exhaustive cppcheck on CI
CoolSpy3 Jul 12, 2024
e4709cc
suppress constParameterCallback warning in ros controller
CoolSpy3 Jul 12, 2024
964ee4c
fix constParameterPointer warnings (in projects)
CoolSpy3 Jul 13, 2024
b7d5cde
fix constParameter warnings (in projects)
CoolSpy3 Jul 13, 2024
4514a63
fix constVariable warnings (in projects)
CoolSpy3 Jul 13, 2024
d5da5df
suppress constParameterCallback warnings globally
CoolSpy3 Jul 13, 2024
279e497
fix constVariablePointer warnings
CoolSpy3 Jul 17, 2024
d54977b
fix constParameterPointer warnings
CoolSpy3 Jul 17, 2024
e706c83
fix constVariable warnings
CoolSpy3 Jul 17, 2024
a07242c
fix missingOverride warnings
CoolSpy3 Jul 18, 2024
d4135fd
fix knownPointerToBool warnings
CoolSpy3 Jul 18, 2024
f81483f
fix truncLongCastReturn warnings
CoolSpy3 Jul 18, 2024
0d8a83e
fix iterateByValue warnings
CoolSpy3 Jul 18, 2024
aecf5e5
fix ignoredReturnErrorCode warnings
CoolSpy3 Jul 18, 2024
ebfd31a
fix unreadVariable warnings
CoolSpy3 Jul 18, 2024
5dc1bbc
fix uselessOverride warnings
CoolSpy3 Jul 18, 2024
fa3fdc1
fix constParameterReference warnings
CoolSpy3 Jul 18, 2024
6546e57
fix truncLongCastAssignment warnings
CoolSpy3 Jul 18, 2024
8a8056e
fix redundantCopyLocalConst warnings
CoolSpy3 Jul 18, 2024
4a4af30
fix functionConst warnings
CoolSpy3 Jul 18, 2024
78b888e
fix unassignedVariable warnings
CoolSpy3 Jul 18, 2024
8bc80f7
remove unused function
CoolSpy3 Jul 18, 2024
026b017
fix incorrectStringBooleanError warnings
CoolSpy3 Jul 18, 2024
fc1fca3
add missing break
CoolSpy3 Jul 18, 2024
bf00c76
update cppcheck on windows
CoolSpy3 Jul 18, 2024
38a3152
use curl instead of wget
CoolSpy3 Jul 18, 2024
0fdd438
set curl flags
CoolSpy3 Jul 18, 2024
59fa356
add msiexec args
CoolSpy3 Jul 18, 2024
7358b79
add debug prints
CoolSpy3 Jul 18, 2024
9640a91
try bumping the windows runner
CoolSpy3 Jul 18, 2024
603a964
revert last two commits
CoolSpy3 Jul 18, 2024
0d5c258
try installing cppcheck as admin
CoolSpy3 Jul 18, 2024
2ef8378
upload msiexec log
CoolSpy3 Jul 18, 2024
2b680be
Revert "upload msiexec log"
CoolSpy3 Jul 18, 2024
bb83e19
install msi with powershell
CoolSpy3 Jul 18, 2024
2a3a639
fix quotation marks
CoolSpy3 Jul 18, 2024
863cce8
use -ArgumentList
CoolSpy3 Jul 18, 2024
0c3d9de
fix constVariablePointer warnings (round 2)
CoolSpy3 Jul 18, 2024
d746f82
fix constParameterPointer warnings (round 2)
CoolSpy3 Jul 18, 2024
56694c5
fix other warnings (round 2)
CoolSpy3 Jul 18, 2024
b5714f7
fix build errors
CoolSpy3 Jul 19, 2024
e077ee9
fix more warnings
CoolSpy3 Jul 19, 2024
f3060fe
run clang-format
CoolSpy3 Jul 19, 2024
bd3202a
run clang-format
CoolSpy3 Jul 19, 2024
846a66a
run clang-format on c code
CoolSpy3 Jul 19, 2024
28e7cf6
run clang-format@14
CoolSpy3 Jul 19, 2024
acbf0eb
fix cppcheck warnings on Windows
CoolSpy3 Jul 19, 2024
92dee8b
fix windows build
CoolSpy3 Jul 19, 2024
75346d9
store bool values before calling assert
CoolSpy3 Jul 19, 2024
fc7b143
don't use unnecessary variables
CoolSpy3 Jul 19, 2024
69671e0
remove redundant if-condition
CoolSpy3 Jul 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .github/workflows/test_suite_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
if: ${{ contains(github.event.pull_request.labels.*.name, 'test webots build') }}
strategy:
matrix:
os: [macos-11]
os: [macos-14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand All @@ -33,7 +33,7 @@ jobs:
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'test distribution') || contains(github.event.pull_request.labels.*.name, 'test suite') }}
strategy:
matrix:
os: [macos-11]
os: [macos-14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
if: ${{ contains(github.event.pull_request.labels.*.name, 'test suite') }}
strategy:
matrix:
os: [macos-11]
os: [macos-14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
if: ${{ always() && !contains(github.event.pull_request.labels.*.name, 'test distribution') && !contains(github.event.pull_request.labels.*.name, 'test webots build') }}
strategy:
matrix:
os: [macos-11]
os: [macos-14]
runs-on: ubuntu-latest
steps:
- name: Delete artifacts
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test_suite_mac_develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
if: ${{ contains(github.event.pull_request.labels.*.name, 'test webots build') }}
strategy:
matrix:
os: [macos-11]
os: [macos-14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand All @@ -28,7 +28,7 @@ jobs:
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'test distribution') || contains(github.event.pull_request.labels.*.name, 'test suite') }}
strategy:
matrix:
os: [macos-11]
os: [macos-14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
if: ${{ contains(github.event.pull_request.labels.*.name, 'test suite') }}
strategy:
matrix:
os: [macos-11]
os: [macos-14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
if: ${{ always() && !contains(github.event.pull_request.labels.*.name, 'test distribution') && !contains(github.event.pull_request.labels.*.name, 'test webots build') }}
strategy:
matrix:
os: [macos-11]
os: [macos-14]
runs-on: ubuntu-latest
steps:
- name: Delete artifacts
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/tests_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-11, windows-2019]
os: [ubuntu-22.04, macos-14, windows-2019]
python: [3.9]
include:
- os: ubuntu-22.04
DEPENDENCIES_INSTALLATION: "wget https://github.com/danmar/cppcheck/archive/refs/tags/2.10.tar.gz; tar -xf 2.10.tar.gz -C ~/; mkdir -p ~/cppcheck-2.10/build; cd ~/cppcheck-2.10/build; cmake ..; cmake --build .; export PATH=~/cppcheck-2.10/build/bin:$PATH"
- os: macos-11
DEPENDENCIES_INSTALLATION: "brew tap-new --no-git $USER/local-cppcheck; brew extract --version=2.10 cppcheck $USER/local-cppcheck; brew install cppcheck@2.10; brew tap-new --no-git $USER/local-clang-format; brew extract --version=14.0.0 clang-format $USER/local-clang-format; brew install clang-format@14.0.0"
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 ..; cmake --build .; 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 cppcheck@2.14.2; brew tap-new --no-git $USER/local-clang-format; brew extract --version=14.0.0 clang-format $USER/local-clang-format; brew install clang-format@14.0.0"
- os: windows-2019
DEPENDENCIES_INSTALLATION: "choco install -y cppcheck --version=2.10 || true; choco uninstall -y llvm; choco install -y llvm --version=14.0.0; export PATH=$PATH:\"/c/Program Files/Cppcheck:/c/Program Files/LLVM/bin\""
DEPENDENCIES_INSTALLATION: "curl -LJO https://github.com/danmar/cppcheck/releases/download/2.14.1/cppcheck-2.14.1-x64-Setup.msi; powershell 'Start-Process msiexec -ArgumentList \"/quiet\",\"/passive\",\"/qn\",\"/i\",\"cppcheck-2.14.1-x64-Setup.msi\" -Wait'; choco uninstall -y llvm; choco install -y llvm --version=14.0.0; export PATH=$PATH:\"/c/Program Files/Cppcheck:/c/Program Files/LLVM/bin\""
runs-on: ${{ matrix.os }}
if: needs.job-skipper.outputs.should_skip != 'true'
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests_sources_with_latest_cppcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-11, windows-2019]
os: [ubuntu-22.04, macos-14, windows-2019]
python: [3.9]
include:
- os: ubuntu-22.04
DEPENDENCIES_INSTALLATION: "sudo apt -y install cppcheck"
- os: macos-11
- 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 clang-format@14.0.0"
- os: windows-2019
DEPENDENCIES_INSTALLATION: "choco install -y cppcheck || true; choco uninstall -y llvm; choco install -y llvm --version=14.0.0; export PATH=$PATH:\"/c/Program Files/Cppcheck:/c/Program Files/LLVM/bin\""
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/system-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ We recommend using a recent version of Linux.
Webots is provided for Linux 64 (x86-64) systems only.
Webots doesn't run on Ubuntu versions earlier than 20.04.
- Windows: Webots runs on Windows 11 and Windows 10 (64-bit versions only).
- Mac: Webots runs on macOS 11 "Big Sur", macOS 12 "Monterey" and macOS 13 "Ventura".
- Mac: Webots runs on macOS macOS 12 "Monterey", macOS 13 "Ventura", and macOS 14 "Sonoma".

Webots may work but is not officially supported on earlier versions of the above mentioned operating systems.

Expand Down
5 changes: 3 additions & 2 deletions docs/reference/changelog-r2024.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
Released on December **th, 2023.
- New Features
- **Change the name of the web scene format from `X3D` to `W3D` ([#6280](https://github.com/cyberbotics/webots/pull/6280)).**
- Removed support for macOS 11 "Big Sur" and added support for macOS 14 "Sonoma" ([#6580](https://github.com/cyberbotics/webots/pull/6580)).
- Enhancements
- Improved the image range of the rotating [Lidar](lidar.md) ([#6324](https://github.com/cyberbotics/webots/pull/6324)).
- Cleanup
- Removed deprecated `windowPosition`, `pixelSize` fields of [Display](display.md) node ([#6327](https://github.com/cyberbotics/webots/pull/6327)).
- Bug Fixes
- Fixed error message on Windows when `libssl-3-x64.dll` was added to `PATH` ([#6553](https://github.com/cyberbotics/webots/pull/6553)).
- Fixed length of arrays returned by `getPose()` in Java ([#6556](https://github.com/cyberbotics/webots/pull/6556)).
- Fixed length of arrays returned by `CameraRecognitionObject.getColors()` in Java ([#6564](https://github.com/cyberbotics/webots/pull/6564))
- Fixed handling of device objects with the same name in the controller API ([#6579](https://github.com/cyberbotics/webots/pull/6579))
- Fixed length of arrays returned by `CameraRecognitionObject.getColors()` in Java ([#6564](https://github.com/cyberbotics/webots/pull/6564)).
- Fixed handling of device objects with the same name in the controller API ([#6579](https://github.com/cyberbotics/webots/pull/6579)).
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ extern "C" {
#endif

void wbu_generic_robot_window_parse_device_command(char *token, char *tokens);
bool wbu_generic_robot_window_parse_device_control_command(char *first_token, char *tokens);
bool wbu_generic_robot_window_parse_device_control_command(const char *first_token, char *tokens);
bool wbu_generic_robot_window_handle_messages(const char *message);
void wbu_generic_robot_window_init();
void wbu_generic_robot_window_update();
Expand Down
2 changes: 1 addition & 1 deletion include/controller/c/webots/utils/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extern "C" {
#endif

char *wbu_string_strsep(char **stringp, const char *delim);
char *wbu_string_replace(char *value, char *before, char *after);
char *wbu_string_replace(char *value, const char *before, const char *after);

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion include/wren/drawable_texture.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ typedef struct WrFont WrFont;
WrDrawableTexture *wr_drawable_texture_new();

void wr_drawable_texture_set_font(WrDrawableTexture *texture, WrFont *font);
void wr_drawable_texture_set_color(WrDrawableTexture *texture, float *color);
void wr_drawable_texture_set_color(WrDrawableTexture *texture, const float *color);
void wr_drawable_texture_set_antialasing(WrDrawableTexture *texture, bool enabled);
void wr_drawable_texture_set_use_premultiplied_alpha(WrDrawableTexture *texture, bool premultipliedAlpha);

Expand Down
2 changes: 1 addition & 1 deletion projects/default/controllers/ros/RosSensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include "RosSensor.hpp"

RosSensor::RosSensor(std::string deviceName, Device *device, Ros *ros, bool enableDefaultServices) :
RosSensor::RosSensor(const std::string &deviceName, Device *device, Ros *ros, bool enableDefaultServices) :
RosDevice(device, ros, enableDefaultServices),
mFrameIdPrefix("") {
std::string fixedDeviceName = Ros::fixedNameString(deviceName);
Expand Down
2 changes: 1 addition & 1 deletion projects/default/controllers/ros/RosSensor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class RosSensor : public RosDevice {
bool enableSensor(int timestep);

protected:
RosSensor(std::string deviceName, Device *device, Ros *ros, bool enableDefaultServices = true);
RosSensor(const std::string &deviceName, Device *device, Ros *ros, bool enableDefaultServices = true);

virtual ros::Publisher createPublisher() = 0;
virtual void publishValue(ros::Publisher publisher) = 0;
Expand Down
2 changes: 1 addition & 1 deletion projects/default/libraries/vehicle/c/car/src/car.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void wbu_car_init() {
// Parse vehicle caracteristics from the beginning of the data string
char engine_type;
int engine_sound_length;
char *sub_data_string = (char *)wb_robot_get_custom_data();
const char *sub_data_string = wb_robot_get_custom_data();
i = sscanf(sub_data_string, "%lf %lf %lf %lf %lf %lf %lf %c %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %d %d",
&instance->wheelbase, &instance->track_front, &instance->track_rear, &instance->front_wheel_radius,
&instance->rear_wheel_radius, &instance->brake_coefficient, &instance->defaultDampingConstant, &engine_type,
Expand Down
1 change: 1 addition & 0 deletions projects/default/libraries/vehicle/c/driver/src/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ static void update_engine_sound() {
}
if (rpm < instance->car->engine_min_rpm)
rpm = instance->car->engine_min_rpm;
// cppcheck-suppress variableScope
double pitch = rpm / instance->car->engine_sound_rpm_reference;
if (stop_sound)
wb_speaker_stop(instance->engine_speaker, instance->car->engine_sound);
Expand Down
8 changes: 4 additions & 4 deletions projects/default/libraries/vehicle/java/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ $(WRAPPER_OBJECT): $(WRAPPER)
@$(CXX) $(CFLAGS2) $(INCLUDES) $(JAVA_INCLUDES) $< -o "$@"

$(WRAPPER_OBJECT_ARM64): $(WRAPPER)
@$(CXX) -target arm64-apple-macos11 $(CFLAGS2) $(INCLUDES) $(JAVA_INCLUDES) $< -o "$@"
@$(CXX) -target arm64-apple-macos12 $(CFLAGS2) $(INCLUDES) $(JAVA_INCLUDES) $< -o "$@"

$(WRAPPER_OBJECT_X86_64): $(WRAPPER)
@$(CXX) -target x86_64-apple-macos11 $(CFLAGS2) $(INCLUDES) $(JAVA_INCLUDES) $< -o "$@"
@$(CXX) -target x86_64-apple-macos12 $(CFLAGS2) $(INCLUDES) $(JAVA_INCLUDES) $< -o "$@"

%.so: $(WRAPPER_OBJECT)
@mkdir -p $(WEBOTS_CONTROLLER_LIB_PATH)/java
Expand All @@ -102,8 +102,8 @@ $(WRAPPER_OBJECT_X86_64): $(WRAPPER)
@$(CXX) -shared -mwindows -Wl,--add-stdcall-alias -Wl,--enable-auto-import -O -lm $< $(LIB) -o "$@"

%.jnilib: $(WRAPPER_OBJECT_ARM64) $(WRAPPER_OBJECT_X86_64)
@$(CXX) -target arm64-apple-macos11 $(CFLAGS1) -bundle $(WRAPPER_OBJECT_ARM64) $(LIB) -o lib$(MODULE_NAME)-arm64.jnilib
@$(CXX) -target x86_64-apple-macos11 $(CFLAGS1) -bundle $(WRAPPER_OBJECT_X86_64) $(LIB) -o lib$(MODULE_NAME)-x86_64.jnilib
@$(CXX) -target arm64-apple-macos12 $(CFLAGS1) -bundle $(WRAPPER_OBJECT_ARM64) $(LIB) -o lib$(MODULE_NAME)-arm64.jnilib
@$(CXX) -target x86_64-apple-macos12 $(CFLAGS1) -bundle $(WRAPPER_OBJECT_X86_64) $(LIB) -o lib$(MODULE_NAME)-x86_64.jnilib
@mkdir -p $(WEBOTS_CONTROLLER_LIB_PATH)/java
@lipo -create -output "$@" lib$(MODULE_NAME)-arm64.jnilib lib$(MODULE_NAME)-x86_64.jnilib
@codesign -s - "$@"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ typedef struct WbuBvhMotionPrivate {
// Utility functions //
//***********************************//

static BvhMotionJointPrivate_t *add_new_joint(FILE *file, WbuBvhMotion motion, char *this_name, BvhMotionJointPrivate_t *parent,
int *channels_count) {
static BvhMotionJointPrivate_t *add_new_joint(FILE *file, WbuBvhMotion motion, const char *this_name,
BvhMotionJointPrivate_t *parent, int *channels_count) {
// create and init new joint
BvhMotionJointPrivate_t *new_joint = malloc(sizeof(BvhMotionJointPrivate_t));
new_joint->name = (char *)malloc(strlen(this_name) + 1);
Expand All @@ -100,7 +100,7 @@ static BvhMotionJointPrivate_t *add_new_joint(FILE *file, WbuBvhMotion motion, c

char line[MAX_LINE];
while (fgets(line, MAX_LINE, file)) {
char *token = strtok(line, DELIM);
const char *token = strtok(line, DELIM);

// opening bracket of joint
if (strcmp(token, "{") == 0)
Expand Down Expand Up @@ -193,7 +193,7 @@ static BvhMotionJointPrivate_t *add_new_joint(FILE *file, WbuBvhMotion motion, c

static void read_motion(FILE *file, WbuBvhMotion motion, int frame_channels_count) {
int n_frames = motion->n_frames;
char *token;
const char *token;
int joint_index;

// init joints
Expand Down Expand Up @@ -316,7 +316,7 @@ WbuBvhMotion wbu_bvh_read_file(const char *filename) {
int channels_count = 0;
char line[MAX_LINE];
while (fgets(line, MAX_LINE, file)) {
char *token;
const char *token;
token = strtok(line, DELIM);
// skeleton section
if (strcmp(token, "HIERARCHY") == 0)
Expand Down Expand Up @@ -476,7 +476,7 @@ void wbu_bvh_set_scale(WbuBvhMotion motion, double scale) {
const double *wbu_bvh_get_root_translation(const WbuBvhMotion motion) {
static double result[3];
int frame_index = motion->current_frame;
double *frame_position = motion->joint_list[0]->frame_position[frame_index];
const double *frame_position = motion->joint_list[0]->frame_position[frame_index];
int i = 0;
for (; i < 3; ++i)
result[i] = frame_position[i] * motion->scale_factor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <assert.h>
#include <stdio.h>

// cppcheck-suppress constParameter
int main(int argc, char *argv[]) {
wb_robot_init();
assert(argc == 3); // speed and timer excepted as argument.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ void init_pid_attitude_fixed_height_controller() {
altitudeIntegrator = 0;
}

void pid_attitude_fixed_height_controller(actual_state_t actual_state, desired_state_t *desired_state, gains_pid_t gains_pid,
double dt, motor_power_t *motorCommands) {
void pid_attitude_fixed_height_controller(actual_state_t actual_state, const desired_state_t *desired_state,
gains_pid_t gains_pid, double dt, motor_power_t *motorCommands) {
control_commands_t control_commands = {0};
pid_fixed_height_controller(actual_state, desired_state, gains_pid, dt, &control_commands);
pid_attitude_controller(actual_state, desired_state, gains_pid, dt, &control_commands);
Expand All @@ -70,8 +70,8 @@ void pid_velocity_fixed_height_controller(actual_state_t actual_state, desired_s
motor_mixing(control_commands, motorCommands);
}

void pid_fixed_height_controller(actual_state_t actual_state, desired_state_t *desired_state, gains_pid_t gains_pid, double dt,
control_commands_t *control_commands) {
void pid_fixed_height_controller(actual_state_t actual_state, const desired_state_t *desired_state, gains_pid_t gains_pid,
double dt, control_commands_t *control_commands) {
double altitudeError = desired_state->altitude - actual_state.altitude;
double altitudeDerivativeError = (altitudeError - pastAltitudeError) / dt;
control_commands->altitude =
Expand All @@ -91,8 +91,8 @@ void motor_mixing(control_commands_t control_commands, motor_power_t *motorComma
motorCommands->m4 = control_commands.altitude + control_commands.roll + control_commands.pitch - control_commands.yaw;
}

void pid_attitude_controller(actual_state_t actual_state, desired_state_t *desired_state, gains_pid_t gains_pid, double dt,
control_commands_t *control_commands) {
void pid_attitude_controller(actual_state_t actual_state, const desired_state_t *desired_state, gains_pid_t gains_pid,
double dt, control_commands_t *control_commands) {
// Calculate errors
double pitchError = desired_state->pitch - actual_state.pitch;
double pitchDerivativeError = (pitchError - pastPitchError) / dt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,19 @@ typedef struct gains_pid_s {
float constrain(float value, const float minVal, const float maxVal);
void init_pid_attitude_fixed_height_controller();

void pid_attitude_fixed_height_controller(actual_state_t actual_state, desired_state_t *desired_state, gains_pid_t gains_pid,
double dt, motor_power_t *motorCommands);
void pid_attitude_fixed_height_controller(actual_state_t actual_state, const desired_state_t *desired_state,
gains_pid_t gains_pid, double dt, motor_power_t *motorCommands);

void pid_velocity_fixed_height_controller(actual_state_t actual_state, desired_state_t *desired_state, gains_pid_t gains_pid,
double dt, motor_power_t *motorCommands);

void pid_fixed_height_controller(actual_state_t actual_state, desired_state_t *desired_state, gains_pid_t gains_pid, double dt,
control_commands_t *control_commands);
void pid_fixed_height_controller(actual_state_t actual_state, const desired_state_t *desired_state, gains_pid_t gains_pid,
double dt, control_commands_t *control_commands);

void motor_mixing(control_commands_t control_commands, motor_power_t *motorCommands);

void pid_attitude_controller(actual_state_t actual_state, desired_state_t *desired_state, gains_pid_t gains_pid, double dt,
control_commands_t *control_commands);
void pid_attitude_controller(actual_state_t actual_state, const desired_state_t *desired_state, gains_pid_t gains_pid,
double dt, control_commands_t *control_commands);

void pid_horizontal_velocity_controller(actual_state_t actual_state, desired_state_t *desired_state, gains_pid_t gains_pid,
double dt);
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static void print_keyboard_help() {
* This function is simply used to display clearly the answers of the Shrimp
* to our commands.
*/
static void print_answer(unsigned char *answer) {
static void print_answer(const unsigned char *answer) {
int i;
char answer_string[MAX_STRING_SIZE];

Expand Down Expand Up @@ -181,7 +181,7 @@ static void run_step() {

int main() {
unsigned char buffer[MAX_BUFFER_SIZE];
unsigned char *answer;
const unsigned char *answer;
int position, in_position;

wb_robot_init();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ static void command_01(byte *answer) {
answer[3] = SHRIMP_PATCH_NUMBER;
}

// cppcheck-suppress constParameterPointer
/*
* This function allows to to set the speed and the steering angle of the
* robot.
Expand Down
6 changes: 3 additions & 3 deletions projects/robots/epfl/lis/controllers/blimp/js.h
Original file line number Diff line number Diff line change
Expand Up @@ -495,13 +495,13 @@ class jsJoystick {
saturate[axis] = st;
}

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

Expand Down
Loading
Loading