From 4d62581629cebf41388d8402c5ca12d4ce814b19 Mon Sep 17 00:00:00 2001 From: texhnolyze Date: Thu, 16 May 2024 19:07:59 +0200 Subject: [PATCH 01/65] refactor(devcontainer): use non absolute path in PROMPT starting from `~` instead of using the whole path --- .devcontainer/zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/zshrc b/.devcontainer/zshrc index 27e9c7767..2a59d4548 100644 --- a/.devcontainer/zshrc +++ b/.devcontainer/zshrc @@ -50,7 +50,7 @@ bindkey "^[[1;5D" backward-word # Settings for the prompt to show that we are in a docker container -export PROMPT="%K{black} 🐋 %K{blue}%F{black}%/ %f%k%F{blue}%f " # Prefix the prompt with DOCKER +export PROMPT="%K{black} 🐋 %K{blue}%F{black} %~ %f%k%F{blue}%f " # Prefix the prompt with DOCKER # >>> bit-bots initialize >>> From 0b382dea3b7d32af8ae44e6c5136d5c4c07d9f8a Mon Sep 17 00:00:00 2001 From: texhnolyze Date: Thu, 16 May 2024 19:09:18 +0200 Subject: [PATCH 02/65] feat(devcontainer): use non root user `bitbots` to prevent issues when interacting with the repository both from within the container and outside the container, due to permissions not being correct --- .devcontainer/Dockerfile | 23 +++++++++++++++++------ .devcontainer/devcontainer.json | 4 ++-- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index d56d6ef9a..fc7979b17 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1,9 @@ FROM ros:iron +ARG user=bitbots +ARG uid=1000 +ARG gid=1000 + # Basic Utilities ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -y \ @@ -77,18 +81,25 @@ RUN python3 -m pip install \ # Set zsh as default shell SHELL ["/bin/zsh", "-c"] -# Create home directory and colcon workspace -RUN mkdir -p "/root/colcon_ws" +# Create user bitbots with home directory and add to sudo group +RUN useradd -m -U -u "$uid" -G sudo -s /bin/zsh $user \ + && groupmod -g "$gid" $user \ + && echo "$user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers + +USER $user + +# Create colcon workspace +RUN mkdir -p /home/$user/colcon_ws/src # Install oh-my-zsh for pretty terminal RUN sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" && \ - git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions + git clone https://github.com/zsh-users/zsh-autosuggestions "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions" -# Add zshrc -COPY zshrc "/root/.zshrc" +# Add zshrc to bitbots home directory +COPY --chown=$user:$user zshrc /home/$user/.zshrc # This is required for sharing Xauthority ENV QT_X11_NO_MITSHM=1 # Switch to the workspace directory -WORKDIR "/root/colcon_ws" +WORKDIR /home/$user/colcon_ws diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d7c87f452..fe8c55aa6 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -20,8 +20,8 @@ } }, - "workspaceMount": "type=bind,source=${localWorkspaceFolder},target=/root/colcon_ws/src/bitbots_main", - "workspaceFolder": "/root/colcon_ws/src/bitbots_main", + "workspaceMount": "type=bind,source=${localWorkspaceFolder},target=/home/bitbots/colcon_ws/src/bitbots_main", + "workspaceFolder": "/home/bitbots/colcon_ws/src/bitbots_main", "mounts": [ "type=bind,source=${localEnv:HOME},target=/srv/host_home,consistency=cached" From b4a7437bf55cbeaaa740ddb809dcf074588e07dc Mon Sep 17 00:00:00 2001 From: texhnolyze Date: Thu, 20 Jun 2024 18:13:18 +0200 Subject: [PATCH 03/65] fix(devcontainer): delete `users` group from container in `Dockerfile`, because the `updateRemoteUserUID` setting of the devcontainer does not change the `GID` of the `containerUser` dynamically to the one of the host user if the group exists in the container already microsoft/vscode-remote-release#2402. In our case the `containerUser` is set to `bitbots`, because it automatically uses the last `USER` instruction from the `Dockerfile` and the `remoteUser` inherits from `containerUser`. For reference see: microsoft/vscode-remote-release#1155 --- .devcontainer/Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index fc7979b17..497510328 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -81,8 +81,12 @@ RUN python3 -m pip install \ # Set zsh as default shell SHELL ["/bin/zsh", "-c"] -# Create user bitbots with home directory and add to sudo group -RUN useradd -m -U -u "$uid" -G sudo -s /bin/zsh $user \ +# Remove the users group, because when it exists on the host system +# the devcontainer will not dynamically update the containerUser GID, +# when the host user is part of the users group. +# Then create a bitbots user with home directory and add allow it to use sudo +RUN groupdel users \ + && useradd -m -U -u "$uid" -G sudo -s /bin/zsh $user \ && groupmod -g "$gid" $user \ && echo "$user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers From c59fe1ebd4ad357c89b380902dec5701d7159939 Mon Sep 17 00:00:00 2001 From: texhnolyze Date: Wed, 6 Nov 2024 10:37:23 +0100 Subject: [PATCH 04/65] chore(devcontainer): upgrade to ros jazzy/ubuntu-24.04 --- .devcontainer/Dockerfile | 39 ++++++++++++++++----------------- .devcontainer/devcontainer.json | 6 +++-- Makefile | 4 ++-- scripts/ros.plugin.sh | 22 ++++++++++++++----- 4 files changed, 41 insertions(+), 30 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 497510328..a2609b38e 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM ros:iron +FROM ros:jazzy ARG user=bitbots ARG uid=1000 @@ -58,25 +58,16 @@ RUN apt update -y \ RUN apt-get install -y \ python3-rosdep \ python3-vcstool \ - ros-iron-camera-calibration \ - ros-iron-desktop \ - ros-iron-joint-state-publisher-gui \ - ros-iron-plotjuggler \ - ros-iron-plotjuggler-msgs \ - ros-iron-plotjuggler-ros \ - ros-iron-rmw-cyclonedds-cpp \ - ros-iron-rqt-robot-monitor \ - ros-iron-soccer-vision-3d-rviz-markers - -# Update pip and install colcon-clean -RUN pip3 install pip -U - -# Install colcon extensions / patches -RUN python3 -m pip install \ - git+https://github.com/ruffsl/colcon-clean \ - git+https://github.com/timonegk/colcon-core.git@colors \ - git+https://github.com/timonegk/colcon-notification.git@colors \ - git+https://github.com/timonegk/colcon-output.git@colors + python3-virtualenv \ + ros-jazzy-camera-calibration \ + ros-jazzy-desktop \ + ros-jazzy-joint-state-publisher-gui \ + ros-jazzy-plotjuggler \ + ros-jazzy-plotjuggler-msgs \ + ros-jazzy-plotjuggler-ros \ + ros-jazzy-rmw-cyclonedds-cpp \ + ros-jazzy-rqt-robot-monitor \ + ros-jazzy-soccer-vision-3d-rviz-markers # Set zsh as default shell SHELL ["/bin/zsh", "-c"] @@ -86,12 +77,20 @@ SHELL ["/bin/zsh", "-c"] # when the host user is part of the users group. # Then create a bitbots user with home directory and add allow it to use sudo RUN groupdel users \ + && userdel -r ubuntu \ && useradd -m -U -u "$uid" -G sudo -s /bin/zsh $user \ && groupmod -g "$gid" $user \ && echo "$user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers USER $user +# Install pip colcon extensions / patches as user +RUN python3 -m pip install --user --break-system-packages \ + git+https://github.com/ruffsl/colcon-clean \ + git+https://github.com/timonegk/colcon-core.git@colors \ + git+https://github.com/timonegk/colcon-notification.git@colors \ + git+https://github.com/timonegk/colcon-output.git@colors + # Create colcon workspace RUN mkdir -p /home/$user/colcon_ws/src diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index fe8c55aa6..2b735fca2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,5 +1,5 @@ { - "name": "Bit-Bots Iron Dev", + "name": "Bit-Bots Jazzy Dev", "build": { "dockerfile": "Dockerfile" }, @@ -14,7 +14,9 @@ "vscode": { "settings": { "terminal.integrated.defaultProfile.linux": "zsh", - "terminal.integrated.profiles.linux": { "zsh": { "path": "/bin/zsh" } } + "terminal.integrated.profiles.linux": { "zsh": { "path": "/bin/zsh" } }, + "dev.containers.copyGitConfig": false, + "dev.containers.gitCredentialHelperConfigLocation": "none" }, "extensions": ["ms-iot.vscode-ros"] } diff --git a/Makefile b/Makefile index 48dc80295..73902c40f 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ install-no-root: pull-init update-no-root pip: # Install and upgrade pip dependencies - pip install --upgrade -r requirements/dev.txt --user + pip install --upgrade -r requirements/dev.txt --user --break-system-packages pre-commit: # Install pre-commit hooks for all submodules that have a .pre-commit-config.yaml file @@ -91,7 +91,7 @@ rosdep: [ -f /etc/ros/rosdep/sources.list.d/20-default.list ] || sudo rosdep init # Update rosdep and install dependencies from meta directory rosdep update - rosdep install --from-paths . --ignore-src --rosdistro iron -y + rosdep install --from-paths . --ignore-src --rosdistro jazzy -y status: # Show status of all repositories diff --git a/scripts/ros.plugin.sh b/scripts/ros.plugin.sh index 5012a0c1f..339c208a8 100644 --- a/scripts/ros.plugin.sh +++ b/scripts/ros.plugin.sh @@ -1,7 +1,9 @@ ### Aliases and functions for ROS 2 and colcon usage. Usage for either -### Ubuntu 22.04 or in rosdocked/dev docker container +### Ubuntu 22.04/24.04 or in rosdocked/dev docker container shell="$(basename "$SHELL")" +ros_releases=(iron jazzy rolling) +distro="$ROS_DISTRO" rid() { export ROS_DOMAIN_ID="$1" @@ -12,13 +14,21 @@ rid() { # This needs to be called every time we source something ROS 2 related. # Previous loading of bashcompinit is required. update_ros2_argcomplete() { - eval "$(register-python-argcomplete3 colcon)" - eval "$(register-python-argcomplete3 ros2)" + eval "$(register-python-argcomplete colcon)" + eval "$(register-python-argcomplete ros2)" } # Source the ROS 2 setup files if iron is installed -if [[ -d /opt/ros/iron ]]; then - source "/opt/ros/iron/setup.$shell" &> /dev/null +if [[ -n "$distro" ]]; then + source "/opt/ros/$distro/setup.$shell" &> /dev/null +else + for release in "${ros_releases[@]}"; do + if [[ -d "/opt/ros/$release" ]]; then + source "/opt/ros/$release/setup.$shell" &> /dev/null + distro="$release" + break + fi + done fi # Update the tab completion @@ -45,7 +55,7 @@ alias cb='cdc && colcon build --symlink-install --continue-on-error --packages-u alias cc='cdc && colcon clean packages --packages-select' alias cca='cdc && colcon clean packages' -alias sr="source /opt/ros/iron/setup.$shell && update_ros2_argcomplete" +alias sr="source /opt/ros/$distro/setup.$shell && update_ros2_argcomplete" alias sc="source \$COLCON_WS/install/setup.$shell && update_ros2_argcomplete" alias sa='sr && sc' From f6c1d8afdbb157c966a4c231f5b74e278a4982a8 Mon Sep 17 00:00:00 2001 From: JanNiklasFeld Date: Sat, 23 Nov 2024 20:59:59 +0000 Subject: [PATCH 05/65] Fix formatting, movit config, path and CMakeLists.txt for Jazzy --- .vscode/settings.json | 6 +++--- .../bitbots_ros_control/hardware_interface.hpp | 6 +++--- .../bitbots_ros_control/src/pressure_converter.cpp | 3 +-- .../bitbots_robot_description/launch/move_group.py | 13 +++++++++++-- bitbots_motion/bitbots_dynamic_kick/CMakeLists.txt | 2 +- bitbots_motion/bitbots_dynup/CMakeLists.txt | 4 ++-- bitbots_motion/bitbots_quintic_walk/CMakeLists.txt | 13 +++++-------- .../include/bitbots_localization/MotionModel.hpp | 2 +- .../include/bitbots_localization/Resampling.hpp | 2 +- .../include/bitbots_localization/map.hpp | 2 +- .../bitbots_localization/src/RobotState.cpp | 4 ++-- 11 files changed, 31 insertions(+), 26 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 707c2f422..c2b7564bb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -218,13 +218,13 @@ }, // Tell the ROS extension where to find the setup.bash // This also utilizes the COLCON_WS environment variable, which needs to be set - "ros.distro": "iron", + "ros.distro": "jazzy", "search.useIgnoreFiles": false, "python.autoComplete.extraPaths": [ - "/opt/ros/iron/lib/python3.10/site-packages" + "/opt/ros/jazzy/lib/python3.10/site-packages" ], "python.analysis.extraPaths": [ - "/opt/ros/iron/lib/python3.10/site-packages" + "/opt/ros/jazzy/lib/python3.10/site-packages" ], "cmake.configureOnOpen": false, "editor.formatOnSave": true, diff --git a/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/hardware_interface.hpp b/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/hardware_interface.hpp index cc59c3041..499222df5 100644 --- a/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/hardware_interface.hpp +++ b/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/hardware_interface.hpp @@ -12,11 +12,11 @@ class HardwareInterface { public: virtual bool init() = 0; - virtual void read(const rclcpp::Time &t, const rclcpp::Duration &dt){}; + virtual void read(const rclcpp::Time &t, const rclcpp::Duration &dt) {}; - virtual void write(const rclcpp::Time &t, const rclcpp::Duration &dt){}; + virtual void write(const rclcpp::Time &t, const rclcpp::Duration &dt) {}; - virtual void restoreAfterPowerCycle(){}; + virtual void restoreAfterPowerCycle() {}; virtual ~HardwareInterface(){}; }; diff --git a/bitbots_lowlevel/bitbots_ros_control/src/pressure_converter.cpp b/bitbots_lowlevel/bitbots_ros_control/src/pressure_converter.cpp index 7cdc9f597..0dff0ae2e 100644 --- a/bitbots_lowlevel/bitbots_ros_control/src/pressure_converter.cpp +++ b/bitbots_lowlevel/bitbots_ros_control/src/pressure_converter.cpp @@ -76,8 +76,7 @@ PressureConverter::PressureConverter(rclcpp::Node::SharedPtr nh, char side) { } for (int i = 0; i < 4; i++) { std::stringstream single_wrench_frame; - single_wrench_frame << side << "_" - << "cleat_" << wrench_topics[i]; + single_wrench_frame << side << "_" << "cleat_" << wrench_topics[i]; wrench_frames_.push_back(single_wrench_frame.str()); } diff --git a/bitbots_misc/bitbots_robot_description/launch/move_group.py b/bitbots_misc/bitbots_robot_description/launch/move_group.py index d36a0f5ac..0cef57ac9 100644 --- a/bitbots_misc/bitbots_robot_description/launch/move_group.py +++ b/bitbots_misc/bitbots_robot_description/launch/move_group.py @@ -62,8 +62,17 @@ def launch_setup(context, *args, **kwargs): ompl_planning_pipeline_config = { "move_group": { - "planning_plugin": "ompl_interface/OMPLPlanner", - "request_adapters": """default_planner_request_adapters/AddTimeOptimalParameterization default_planner_request_adapters/FixWorkspaceBounds default_planner_request_adapters/FixStartStateBounds default_planner_request_adapters/FixStartStateCollision default_planner_request_adapters/FixStartStatePathConstraints""", + "planning_plugins": ["ompl_interface/OMPLPlanner"], + "request_adapters": [ + "default_planning_request_adapters/ValidateWorkspaceBounds", + "default_planning_request_adapters/CheckStartStateBounds", + "default_planning_request_adapters/CheckStartStateCollision", + ], + "response_adapters": [ + "default_planning_response_adapters/AddTimeOptimalParameterization", + "default_planning_response_adapters/ValidateSolution", + "default_planning_response_adapters/DisplayMotionPath", + ], "start_state_max_bounds_error": 0.1, } } diff --git a/bitbots_motion/bitbots_dynamic_kick/CMakeLists.txt b/bitbots_motion/bitbots_dynamic_kick/CMakeLists.txt index fb4787aed..aa638fc99 100644 --- a/bitbots_motion/bitbots_dynamic_kick/CMakeLists.txt +++ b/bitbots_motion/bitbots_dynamic_kick/CMakeLists.txt @@ -27,7 +27,7 @@ find_package(tf2_geometry_msgs REQUIRED) find_package(tf2_ros REQUIRED) find_package(backward_ros REQUIRED) -find_package(PythonLibs COMPONENTS Interpreter Development) +find_package(Python3 COMPONENTS Interpreter Development) rosidl_generate_interfaces(${PROJECT_NAME} "msg/KickDebug.msg" DEPENDENCIES std_msgs geometry_msgs Python3) diff --git a/bitbots_motion/bitbots_dynup/CMakeLists.txt b/bitbots_motion/bitbots_dynup/CMakeLists.txt index 5760b5ce0..cc6b28526 100644 --- a/bitbots_motion/bitbots_dynup/CMakeLists.txt +++ b/bitbots_motion/bitbots_dynup/CMakeLists.txt @@ -31,10 +31,11 @@ find_package(tf2_eigen REQUIRED) find_package(tf2_geometry_msgs REQUIRED) find_package(tf2_ros REQUIRED) -find_package(ros2_python_extension REQUIRED) find_package(pybind11 REQUIRED) find_package(Python3 REQUIRED COMPONENTS Interpreter Development) +find_package(ros2_python_extension REQUIRED) + generate_parameter_library(dynup_parameters config/dynup_config.yaml) rosidl_generate_interfaces( @@ -48,7 +49,6 @@ rosidl_generate_interfaces( include_directories(include ${PYTHON_INCLUDE_DIRS}) -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) add_compile_options(-Wall -Werror -Wno-unused -fPIC) set(SOURCES diff --git a/bitbots_motion/bitbots_quintic_walk/CMakeLists.txt b/bitbots_motion/bitbots_quintic_walk/CMakeLists.txt index 7a4f5637a..b8c458792 100644 --- a/bitbots_motion/bitbots_quintic_walk/CMakeLists.txt +++ b/bitbots_motion/bitbots_quintic_walk/CMakeLists.txt @@ -8,6 +8,7 @@ endif() set(PYBIND11_PYTHON_VERSION 3) set(PYBIND11_FINDPYTHON ON) + find_package(ament_cmake REQUIRED) find_package(backward_ros REQUIRED) find_package(biped_interfaces REQUIRED) @@ -29,20 +30,16 @@ find_package(tf2_eigen REQUIRED) find_package(tf2_geometry_msgs REQUIRED) find_package(tf2_ros REQUIRED) -find_package(ros2_python_extension REQUIRED) find_package(pybind11 REQUIRED) find_package(Python3 REQUIRED COMPONENTS Interpreter Development) +find_package(ros2_python_extension REQUIRED) + generate_parameter_library(bitbots_quintic_walk_parameters src/parameters.yaml) rosidl_generate_interfaces( - ${PROJECT_NAME} - "msg/WalkDebug.msg" - "msg/WalkEngineDebug.msg" - DEPENDENCIES - std_msgs - geometry_msgs - Python3) + ${PROJECT_NAME} "msg/WalkDebug.msg" "msg/WalkEngineDebug.msg" DEPENDENCIES + std_msgs geometry_msgs) include_directories(include ${PYTHON_INCLUDE_DIRS}) diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/MotionModel.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/MotionModel.hpp index d767c4edc..0c26f5139 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/MotionModel.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/MotionModel.hpp @@ -61,5 +61,5 @@ class RobotMotionModel : public particle_filter::MovementModel { double sample(double b) const; }; -}; // namespace bitbots_localization +}; // namespace bitbots_localization #endif // BITBOTS_LOCALIZATION_MOTIONMODEL_H diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/Resampling.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/Resampling.hpp index b4dcbb190..49c6dea46 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/Resampling.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/Resampling.hpp @@ -97,5 +97,5 @@ void ImportanceResamplingWE::resample(const ParticleList &sourceList, // template // void ParticleFilter::drawAllFromDistribution(const // std::shared_ptr>& distribution) { -}; // namespace bitbots_localization +}; // namespace bitbots_localization #endif // IMPORTANCERESAMPLINGWE_H diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/map.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/map.hpp index 5acb8e9a5..44839346d 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/map.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/map.hpp @@ -53,5 +53,5 @@ class Map { private: double out_of_map_value_; }; -}; // namespace bitbots_localization +}; // namespace bitbots_localization #endif // BITBOTS_LOCALIZATION_MAP_H diff --git a/bitbots_navigation/bitbots_localization/src/RobotState.cpp b/bitbots_navigation/bitbots_localization/src/RobotState.cpp index a8db34214..b36ad47f3 100644 --- a/bitbots_navigation/bitbots_localization/src/RobotState.cpp +++ b/bitbots_navigation/bitbots_localization/src/RobotState.cpp @@ -69,7 +69,7 @@ void RobotState::convertParticleListToEigen(const std::vector *particle : particle_list) { if (!particle->is_explorer_) { matrix(counter, 0) = particle->getState().getXPos(); @@ -81,7 +81,7 @@ void RobotState::convertParticleListToEigen(const std::vectorgetState().getXPos(); matrix(i, 1) = particle_list[i]->getState().getYPos(); From 717944908f50b67f0613f5c6c52398eba21816c8 Mon Sep 17 00:00:00 2001 From: JanNiklasFeld Date: Sat, 23 Nov 2024 21:00:15 +0000 Subject: [PATCH 06/65] Apply formatting --- bitbots_misc/bitbots_robot_description/launch/move_group.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitbots_misc/bitbots_robot_description/launch/move_group.py b/bitbots_misc/bitbots_robot_description/launch/move_group.py index 0cef57ac9..1d4749014 100644 --- a/bitbots_misc/bitbots_robot_description/launch/move_group.py +++ b/bitbots_misc/bitbots_robot_description/launch/move_group.py @@ -72,7 +72,7 @@ def launch_setup(context, *args, **kwargs): "default_planning_response_adapters/AddTimeOptimalParameterization", "default_planning_response_adapters/ValidateSolution", "default_planning_response_adapters/DisplayMotionPath", - ], + ], "start_state_max_bounds_error": 0.1, } } From 154ccc9a53fd01da3d75e571088faaebc5617f70 Mon Sep 17 00:00:00 2001 From: JanNiklasFeld Date: Sun, 24 Nov 2024 16:07:32 +0100 Subject: [PATCH 07/65] Changes according to make format and changed ros distro to jazzy --- .github/workflows/ci.yml | 4 ++-- .pre-commit-config.yaml | 2 +- README.md | 2 +- .../include/bitbots_ros_control/utils.hpp | 6 +++--- .../dynamixel_servo_hardware_interface.cpp | 6 +++--- .../src/servo_bus_interface.cpp | 2 +- .../bitbots_ros_control/src/utils.cpp | 2 +- .../src/wolfgang_hardware_interface.cpp | 2 +- .../src/basler_camera.cpp | 6 +++--- .../docs/manual/testing/testing.rst | 2 +- .../tutorials/cl_simulation_testing_setup.rst | 2 +- .../tutorials/install_software_ros2.rst | 14 ++++++------- .../docs/manual/tutorials/vscode-ros2.rst | 4 ++-- .../src/bitbots_tf_buffer.cpp | 3 ++- bitbots_misc/bitbots_utils/src/utils.cpp | 2 +- .../include/bitbots_dynamic_kick/kick_ik.hpp | 2 +- .../bitbots_dynamic_kick/src/kick_engine.cpp | 3 +-- .../bitbots_dynamic_kick/src/kick_ik.cpp | 2 +- .../bitbots_dynamic_kick/src/kick_node.cpp | 2 +- .../bitbots_dynamic_kick/src/stabilizer.cpp | 2 +- .../bitbots_dynamic_kick/src/visualizer.cpp | 3 +-- .../include/bitbots_dynup/dynup_engine.hpp | 2 +- .../include/bitbots_dynup/dynup_ik.hpp | 2 +- .../include/bitbots_dynup/dynup_node.hpp | 15 +++++++------ .../include/bitbots_dynup/dynup_pywrapper.hpp | 5 ++--- .../bitbots_dynup/dynup_stabilizer.hpp | 2 +- .../include/bitbots_dynup/visualizer.hpp | 3 +-- .../bitbots_dynup/src/dynup_engine.cpp | 3 +-- .../bitbots_dynup/src/dynup_node.cpp | 2 +- .../bitbots_dynup/src/dynup_pywrapper.cpp | 2 +- .../bitbots_dynup/src/dynup_stabilizer.cpp | 2 +- .../bitbots_dynup/src/dynup_utils.cpp | 2 +- .../bitbots_dynup/src/visualizer.cpp | 3 +-- bitbots_motion/bitbots_hcm/src/hcm.cpp | 19 ++++++++--------- .../bitbots_head_mover/src/move_head.cpp | 5 ++--- .../src/bitbots_moveit_bindings.cpp | 9 ++++---- .../bitbots_quintic_walk/walk_engine.hpp | 11 +++++----- .../include/bitbots_quintic_walk/walk_ik.hpp | 7 +++---- .../bitbots_quintic_walk/walk_node.hpp | 21 +++++++++---------- .../bitbots_quintic_walk/walk_pywrapper.hpp | 5 ++--- .../bitbots_quintic_walk/walk_stabilizer.hpp | 4 +--- .../bitbots_quintic_walk/walk_visualizer.hpp | 9 ++++---- .../bitbots_quintic_walk/src/walk_engine.cpp | 2 +- .../bitbots_quintic_walk/src/walk_ik.cpp | 2 +- .../bitbots_quintic_walk/src/walk_node.cpp | 3 +-- .../src/walk_pywrapper.cpp | 2 +- .../src/walk_stabilizer.cpp | 2 +- .../src/walk_visualizer.cpp | 2 +- .../include/bitbots_splines/pose_spline.hpp | 3 +-- .../bitbots_splines/src/Spline/polynom.cpp | 5 ++--- .../src/Spline/pose_spline.cpp | 2 +- .../src/Spline/position_spline.cpp | 2 +- .../src/Spline/smooth_spline.cpp | 5 ++--- .../bitbots_splines/src/Spline/spline.cpp | 3 +-- .../bitbots_splines/src/Utils/combination.cpp | 3 +-- .../src/Utils/newton_binomial.cpp | 3 +-- .../bitbots_localization/ObservationModel.hpp | 3 +-- .../bitbots_localization/Resampling.hpp | 8 +++---- .../bitbots_localization/localization.hpp | 3 +-- .../bitbots_localization/src/localization.cpp | 3 +-- .../bitbots_localization/src/map.cpp | 3 +-- .../bitbots_odometry/motion_odometry.hpp | 3 +-- scripts/deploy/tasks/build.py | 2 +- scripts/robot_compile.py | 4 ++-- scripts/ros.plugin.sh | 2 +- scripts/setup.sh | 2 +- 66 files changed, 125 insertions(+), 153 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 377ce3f22..a8533d17a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,14 +39,14 @@ jobs: - name: Build packages run: | - . /opt/ros/iron/setup.sh + . /opt/ros/jazzy/setup.sh colcon build --symlink-install working-directory: /colcon_ws - name: Test packages run: | # Source workspace - . /opt/ros/iron/setup.sh + . /opt/ros/jazzy/setup.sh . install/setup.sh # Run tests for all packages colcon test --event-handlers console_direct+ --return-code-on-test-failure --parallel-workers 1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2c0c5e37a..06f738c8b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: - id: cppcheck args: - "--inline-suppr" - - "--suppress=missingInclude" + - "--suppress=missingIncludeSystem" - "--suppress=unmatchedSuppression" - "--suppress=unusedFunction" - "--suppress=unusedStructMember" diff --git a/README.md b/README.md index c04f8132d..067943c5b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build & Test](https://github.com/bit-bots/bitbots_main/actions/workflows/ci.yml/badge.svg)](https://github.com/bit-bots/bitbots_main/actions/workflows/ci.yml) [![Code style checks](https://github.com/bit-bots/bitbots_main/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/bit-bots/bitbots_main/actions/workflows/pre-commit.yml) -[![ROS Version Iron](https://img.shields.io/badge/ROS%20Version-Iron-ab8c71)](https://docs.ros.org/en/iron/index.html) +[![ROS Version Jazzy](https://img.shields.io/badge/ROS%20Version-Jazzy-00b8ff)](https://docs.ros.org/en/jazzy/index.html) This git repository contains all RoboCup-related code and documentation from the Hamburg Bit-Bots team. All code is written as individual ROS 2 packages targeting Ubuntu. diff --git a/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/utils.hpp b/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/utils.hpp index 68e480cd2..eab409395 100644 --- a/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/utils.hpp +++ b/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/utils.hpp @@ -1,8 +1,8 @@ #ifndef BITBOTS_ROS_CONTROL_INCLUDE_BITBOTS_ROS_CONTROL_UTILS_H_ #define BITBOTS_ROS_CONTROL_INCLUDE_BITBOTS_ROS_CONTROL_UTILS_H_ -#include "bitbots_msgs/msg/audio.hpp" -#include "rclcpp/rclcpp.hpp" +#include +#include namespace bitbots_ros_control { @@ -13,7 +13,7 @@ void speakError(rclcpp::Publisher::SharedPtr speak_pub uint16_t dxlMakeword(uint64_t a, uint64_t b); uint32_t dxlMakedword(uint64_t a, uint64_t b); -float dxlMakeFloat(uint8_t* data); +float dxlMakeFloat(const uint8_t* data); std::string gyroRangeToString(uint8_t range); std::string accelRangeToString(uint8_t range); diff --git a/bitbots_lowlevel/bitbots_ros_control/src/dynamixel_servo_hardware_interface.cpp b/bitbots_lowlevel/bitbots_ros_control/src/dynamixel_servo_hardware_interface.cpp index 34f24cb5d..57c1cf389 100644 --- a/bitbots_lowlevel/bitbots_ros_control/src/dynamixel_servo_hardware_interface.cpp +++ b/bitbots_lowlevel/bitbots_ros_control/src/dynamixel_servo_hardware_interface.cpp @@ -148,7 +148,7 @@ void DynamixelServoHardwareInterface::individualTorqueCb(bitbots_msgs::msg::Join RCLCPP_WARN(nh_->get_logger(), "Couldn't set torque for servo %s ", msg.joint_names[i].c_str()); } } - for (auto &bus : bus_interfaces_) { + for (const auto &bus : bus_interfaces_) { bus->switch_individual_torque_ = true; } } @@ -157,7 +157,7 @@ void DynamixelServoHardwareInterface::setTorqueCb(std_msgs::msg::Bool::SharedPtr /** * This saves the given required value, so that it can be written to the servos in the write method */ - for (auto &bus : bus_interfaces_) { + for (const auto &bus : bus_interfaces_) { bus->goal_torque_ = enabled->data; } for (size_t j = 0; j < joint_names_.size(); j++) { @@ -196,7 +196,7 @@ void DynamixelServoHardwareInterface::write(const rclcpp::Time &t, const rclcpp: // set all values from controller to the buses // todo improve performance int i = 0; - for (auto &bus : bus_interfaces_) { + for (const auto &bus : bus_interfaces_) { for (int j = 0; j < bus->joint_count_; j++) { bus->goal_position_[j] = goal_position_[i]; bus->goal_velocity_[j] = goal_velocity_[i]; diff --git a/bitbots_lowlevel/bitbots_ros_control/src/servo_bus_interface.cpp b/bitbots_lowlevel/bitbots_ros_control/src/servo_bus_interface.cpp index b034a2f98..06c82fff5 100644 --- a/bitbots_lowlevel/bitbots_ros_control/src/servo_bus_interface.cpp +++ b/bitbots_lowlevel/bitbots_ros_control/src/servo_bus_interface.cpp @@ -202,7 +202,7 @@ bool ServoBusInterface::writeROMRAM(bool first_time) { // Allocate memory for the values in the driver std::vector values(joint_names_.size()); // Iterate over parameter names - for (auto register_name : parameter_names) { + for (const auto ®ister_name : parameter_names) { // Get the value for each joint for (size_t num = 0; num < joint_names_.size(); num++) { // Get the value from the cache diff --git a/bitbots_lowlevel/bitbots_ros_control/src/utils.cpp b/bitbots_lowlevel/bitbots_ros_control/src/utils.cpp index a9e0745ba..9286eba43 100644 --- a/bitbots_lowlevel/bitbots_ros_control/src/utils.cpp +++ b/bitbots_lowlevel/bitbots_ros_control/src/utils.cpp @@ -40,7 +40,7 @@ uint32_t dxlMakedword(uint64_t a, uint64_t b) { return uint32_t(uint16_t(a & 0xffff) | uint32_t(uint16_t(b & 0xffff) << 16)); } -float dxlMakeFloat(uint8_t* data) { +float dxlMakeFloat(const uint8_t* data) { float f; uint32_t b = dxlMakedword(dxlMakeword(data[0], data[1]), dxlMakeword(data[2], data[3])); memcpy(&f, &b, sizeof(f)); diff --git a/bitbots_lowlevel/bitbots_ros_control/src/wolfgang_hardware_interface.cpp b/bitbots_lowlevel/bitbots_ros_control/src/wolfgang_hardware_interface.cpp index 929812d83..96097debd 100644 --- a/bitbots_lowlevel/bitbots_ros_control/src/wolfgang_hardware_interface.cpp +++ b/bitbots_lowlevel/bitbots_ros_control/src/wolfgang_hardware_interface.cpp @@ -307,7 +307,7 @@ void WolfgangHardwareInterface::write(const rclcpp::Time &t, const rclcpp::Durat } if (!bus_start_time_ || t > bus_start_time_.value()) { if (bus_first_write_) { - for (std::vector> &port_interfaces : interfaces_) { + for (std::vector> const &port_interfaces : interfaces_) { for (std::shared_ptr interface : port_interfaces) { interface->restoreAfterPowerCycle(); } diff --git a/bitbots_misc/bitbots_basler_camera/src/basler_camera.cpp b/bitbots_misc/bitbots_basler_camera/src/basler_camera.cpp index c1f6b2e92..b1587a0a2 100644 --- a/bitbots_misc/bitbots_basler_camera/src/basler_camera.cpp +++ b/bitbots_misc/bitbots_basler_camera/src/basler_camera.cpp @@ -12,14 +12,13 @@ #include #include #include +#include #include #include #include #include #include -#include "pylon_camera_parameters.hpp" - using std::placeholders::_1, std::placeholders::_2; using namespace Pylon; @@ -271,7 +270,8 @@ class BaslerCamera { } // Convert to cv::Mat - cv::Mat image(ptrGrabResult->GetHeight(), ptrGrabResult->GetWidth(), CV_8UC1, (uint8_t*)ptrGrabResult->GetBuffer()); + cv::Mat image(ptrGrabResult->GetHeight(), ptrGrabResult->GetWidth(), CV_8UC1, + static_cast(ptrGrabResult->GetBuffer())); // Create cv::Mat for color image cv::Mat color(image.size(), CV_MAKETYPE(CV_8U, 3)); diff --git a/bitbots_misc/bitbots_docs/docs/manual/testing/testing.rst b/bitbots_misc/bitbots_docs/docs/manual/testing/testing.rst index e3990f5f3..4f0ce8dd0 100644 --- a/bitbots_misc/bitbots_docs/docs/manual/testing/testing.rst +++ b/bitbots_misc/bitbots_docs/docs/manual/testing/testing.rst @@ -49,7 +49,7 @@ Compile (compiles) ------------------ The first step is to test if the package compiles. -Obviously this should preferably be tested on the same system that is used on the robot (Ubuntu 22.04 with the iron distribution). +Obviously this should preferably be tested on the same system that is used on the robot (Ubuntu 24.04 with the jazzy distribution). A part of this is to check if all dependencies are correct in the package.xml. This is important so they can be installed with rosdep. diff --git a/bitbots_misc/bitbots_docs/docs/manual/tutorials/cl_simulation_testing_setup.rst b/bitbots_misc/bitbots_docs/docs/manual/tutorials/cl_simulation_testing_setup.rst index 7ce7b2331..2942f71a2 100644 --- a/bitbots_misc/bitbots_docs/docs/manual/tutorials/cl_simulation_testing_setup.rst +++ b/bitbots_misc/bitbots_docs/docs/manual/tutorials/cl_simulation_testing_setup.rst @@ -35,7 +35,7 @@ For compilation of the whole meta repository run ``cba``, which is an alias for: ``cd $COLCON_WS; colcon build --symlink-install --continue-on-error`` After a successful run, before we are able to use any ros commands we now need to source colcon built sources with ``sa``, which is an alias for: -``source "/opt/ros/iron/setup.$SHELL" && source "$COLCON_WS/install/setup.$SHELL"`` +``source "/opt/ros/jazzy/setup.$SHELL" && source "$COLCON_WS/install/setup.$SHELL"`` **3. Run Webots Simulation** diff --git a/bitbots_misc/bitbots_docs/docs/manual/tutorials/install_software_ros2.rst b/bitbots_misc/bitbots_docs/docs/manual/tutorials/install_software_ros2.rst index caf93aab6..26b7fb244 100644 --- a/bitbots_misc/bitbots_docs/docs/manual/tutorials/install_software_ros2.rst +++ b/bitbots_misc/bitbots_docs/docs/manual/tutorials/install_software_ros2.rst @@ -1,13 +1,13 @@ Software installation with ROS2 =============================== -In this tutorial, we will learn how to install ROS2 Iron Irwini on Ubuntu 22.04 and build our software stack. +In this tutorial, we will learn how to install ROS2 Jazzy Jalisco on Ubuntu 24.04 and build our software stack. **TLDR**: single command setup ------------------------------ **Prerequirements** -- You have a running Ubuntu 22.04 environment +- You have a running Ubuntu 24.04 environment - You have an existing Github account and added a SSH key to your account - You have root access to your system (sudo) @@ -23,17 +23,17 @@ If you have not previously set up any of our software stack, you can use the fol Manual steps with in depth explanation -------------------------------------- -**0. Use Ubuntu 22.04** +**0. Use Ubuntu 24.04** As ROS works best on Ubuntu, we are using this distribution. -Currently, ROS2 Iron runs on Ubuntu 22.04. +Currently, ROS2 Jazzy runs on Ubuntu 24.04. -If you are not already using Ubuntu 22.04, consider installing it on your system (perhaps as a dual boot?). +If you are not already using Ubuntu 24.04, consider installing it on your system (perhaps as a dual boot?). Alternatively you can use a devcontainer :doc:`vscode-dev-container`, with a preconfigured environment and follow those instructions, as these docs do not apply to the devcontainer. **1. Setup and Install ROS 2** -- Follow this guide and when it comes to the section **Install ROS 2 packages**, install the recommended ``ros-iron-desktop-full``: https://docs.ros.org/en/iron/Installation/Ubuntu-Install-Debians.html +- Follow this guide and when it comes to the section **Install ROS 2 packages**, install the recommended ``ros-jazzy-desktop-full``: https://docs.ros.org/en/jazzy/Installation/Ubuntu-Install-Debs.html - Install additional dependencies: .. code-block:: bash @@ -88,7 +88,7 @@ If you want to install it, you can do so by running ``make webots`` in the bitbo **4. Setup colcon workspace** -`Colcon `_ is the tool provided by ROS 2 to build and install our ROS packages, so that they can be launched later. +`Colcon `_ is the tool provided by ROS 2 to build and install our ROS packages, so that they can be launched later. The colcon workspace is where your source code gets build and where we use colcon. - Create colcon workspace directory (typically ``~/colcon_ws/``) diff --git a/bitbots_misc/bitbots_docs/docs/manual/tutorials/vscode-ros2.rst b/bitbots_misc/bitbots_docs/docs/manual/tutorials/vscode-ros2.rst index 75d17ec0a..23030b7cf 100644 --- a/bitbots_misc/bitbots_docs/docs/manual/tutorials/vscode-ros2.rst +++ b/bitbots_misc/bitbots_docs/docs/manual/tutorials/vscode-ros2.rst @@ -9,14 +9,14 @@ Navigate to your colcon workspace. Source ros -`source /opt/ros/iron/setup.zsh` +`source /opt/ros/jazzy/setup.zsh` Open VSCode `code .` Install the ROS extension (from Microsoft). -You should see a `ROS2.iron` in the lower left corner. +You should see a `ROS2.jazzy` in the lower left corner. Now you should be able to build the code with `Ctrl+Shift+B` diff --git a/bitbots_misc/bitbots_tf_buffer/src/bitbots_tf_buffer.cpp b/bitbots_misc/bitbots_tf_buffer/src/bitbots_tf_buffer.cpp index 1096bf9a8..ade8337c0 100644 --- a/bitbots_misc/bitbots_tf_buffer/src/bitbots_tf_buffer.cpp +++ b/bitbots_misc/bitbots_tf_buffer/src/bitbots_tf_buffer.cpp @@ -39,7 +39,8 @@ class Buffer { py_tf2_ros.attr("TimeoutException")); // get node name from python node object - rcl_node_t *node_handle = (rcl_node_t *)node.attr("handle").attr("pointer").cast(); + rcl_node_t *node_handle = + static_cast(reinterpret_cast(node.attr("handle").attr("pointer").cast())); const char *node_name = rcl_node_get_name(node_handle); // create node with name _tf node_ = std::make_shared((std::string(node_name) + "_tf").c_str()); diff --git a/bitbots_misc/bitbots_utils/src/utils.cpp b/bitbots_misc/bitbots_utils/src/utils.cpp index a0aea990a..2131dec2e 100644 --- a/bitbots_misc/bitbots_utils/src/utils.cpp +++ b/bitbots_misc/bitbots_utils/src/utils.cpp @@ -1,4 +1,4 @@ -#include "bitbots_utils/utils.hpp" +#include namespace bitbots_utils { diff --git a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_ik.hpp b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_ik.hpp index 894a05bd9..1b999222c 100644 --- a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_ik.hpp +++ b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_ik.hpp @@ -12,7 +12,7 @@ namespace bitbots_dynamic_kick { class KickIK : public bitbots_splines::AbstractIK { public: - KickIK() = default; + KickIK() : legs_joints_group_(), left_leg_joints_group_(), right_leg_joints_group_(){}; void init(moveit::core::RobotModelPtr kinematic_model) override; bitbots_splines::JointGoals calculate(const KickPositions &positions) override; void reset() override; diff --git a/bitbots_motion/bitbots_dynamic_kick/src/kick_engine.cpp b/bitbots_motion/bitbots_dynamic_kick/src/kick_engine.cpp index b09847137..679d79739 100644 --- a/bitbots_motion/bitbots_dynamic_kick/src/kick_engine.cpp +++ b/bitbots_motion/bitbots_dynamic_kick/src/kick_engine.cpp @@ -1,5 +1,4 @@ -#include "bitbots_dynamic_kick/kick_engine.hpp" - +#include #include namespace bitbots_dynamic_kick { diff --git a/bitbots_motion/bitbots_dynamic_kick/src/kick_ik.cpp b/bitbots_motion/bitbots_dynamic_kick/src/kick_ik.cpp index a562c2da6..a44013df1 100644 --- a/bitbots_motion/bitbots_dynamic_kick/src/kick_ik.cpp +++ b/bitbots_motion/bitbots_dynamic_kick/src/kick_ik.cpp @@ -1,4 +1,4 @@ -#include "bitbots_dynamic_kick/kick_ik.hpp" +#include namespace bitbots_dynamic_kick { diff --git a/bitbots_motion/bitbots_dynamic_kick/src/kick_node.cpp b/bitbots_motion/bitbots_dynamic_kick/src/kick_node.cpp index 89d85824f..9b47bd922 100644 --- a/bitbots_motion/bitbots_dynamic_kick/src/kick_node.cpp +++ b/bitbots_motion/bitbots_dynamic_kick/src/kick_node.cpp @@ -1,4 +1,4 @@ -#include "bitbots_dynamic_kick/kick_node.hpp" +#include namespace bitbots_dynamic_kick { using namespace std::chrono_literals; diff --git a/bitbots_motion/bitbots_dynamic_kick/src/stabilizer.cpp b/bitbots_motion/bitbots_dynamic_kick/src/stabilizer.cpp index e78689de6..84320bfaf 100644 --- a/bitbots_motion/bitbots_dynamic_kick/src/stabilizer.cpp +++ b/bitbots_motion/bitbots_dynamic_kick/src/stabilizer.cpp @@ -1,4 +1,4 @@ -#include "bitbots_dynamic_kick/stabilizer.hpp" +#include namespace bitbots_dynamic_kick { diff --git a/bitbots_motion/bitbots_dynamic_kick/src/visualizer.cpp b/bitbots_motion/bitbots_dynamic_kick/src/visualizer.cpp index 266243737..69f3d3103 100644 --- a/bitbots_motion/bitbots_dynamic_kick/src/visualizer.cpp +++ b/bitbots_motion/bitbots_dynamic_kick/src/visualizer.cpp @@ -1,5 +1,4 @@ -#include "bitbots_dynamic_kick/visualizer.hpp" - +#include #include namespace bitbots_dynamic_kick { diff --git a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_engine.hpp b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_engine.hpp index 9710d6138..a2f05f9b3 100644 --- a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_engine.hpp +++ b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_engine.hpp @@ -9,13 +9,13 @@ #include #include #include +#include #include #include #include #include #include -#include "dynup_parameters.hpp" #include "dynup_stabilizer.hpp" namespace bitbots_dynup { diff --git a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_ik.hpp b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_ik.hpp index 50a8a6b3b..31774ebc8 100644 --- a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_ik.hpp +++ b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_ik.hpp @@ -7,10 +7,10 @@ #include #include +#include #include #include -#include "dynup_parameters.hpp" #include "dynup_utils.hpp" namespace bitbots_dynup { diff --git a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_node.hpp b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_node.hpp index bb563e7f9..2ea86bdcf 100644 --- a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_node.hpp +++ b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_node.hpp @@ -11,30 +11,29 @@ #include #include +#include +#include +#include #include +#include +#include #include #include #include +#include #include #include #include #include #include #include +#include #include #include #include #include #include -#include "bitbots_dynup/dynup_engine.hpp" -#include "bitbots_dynup/dynup_ik.hpp" -#include "bitbots_dynup/dynup_stabilizer.hpp" -#include "bitbots_dynup/visualizer.hpp" -#include "bitbots_msgs/action/dynup.hpp" -#include "dynup_parameters.hpp" -#include "rclcpp_action/rclcpp_action.hpp" - namespace bitbots_dynup { using DynupGoal = bitbots_msgs::action::Dynup; using DynupGoalHandle = rclcpp_action::ServerGoalHandle; diff --git a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_pywrapper.hpp b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_pywrapper.hpp index 5a3bc0532..82fe8a14e 100644 --- a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_pywrapper.hpp +++ b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_pywrapper.hpp @@ -4,14 +4,13 @@ #include #include +#include +#include #include #include #include #include -#include "bitbots_dynup/dynup_node.hpp" -#include "bitbots_dynup/dynup_utils.hpp" - namespace py = pybind11; using namespace ros2_python_extension; diff --git a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_stabilizer.hpp b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_stabilizer.hpp index 6c461c892..684474572 100644 --- a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_stabilizer.hpp +++ b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_stabilizer.hpp @@ -6,12 +6,12 @@ #include #include #include +#include #include #include #include #include -#include "dynup_parameters.hpp" #include "dynup_utils.hpp" namespace bitbots_dynup { diff --git a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/visualizer.hpp b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/visualizer.hpp index 12078bb70..621c0a7cb 100644 --- a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/visualizer.hpp +++ b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/visualizer.hpp @@ -11,14 +11,13 @@ #include #include #include +#include #include #include #include #include #include -#include "dynup_parameters.hpp" - namespace bitbots_dynup { class Visualizer : bitbots_splines::AbstractVisualizer { diff --git a/bitbots_motion/bitbots_dynup/src/dynup_engine.cpp b/bitbots_motion/bitbots_dynup/src/dynup_engine.cpp index 02712ef0c..f4805c1e4 100644 --- a/bitbots_motion/bitbots_dynup/src/dynup_engine.cpp +++ b/bitbots_motion/bitbots_dynup/src/dynup_engine.cpp @@ -1,5 +1,4 @@ -#include "bitbots_dynup/dynup_engine.hpp" - +#include #include namespace bitbots_dynup { diff --git a/bitbots_motion/bitbots_dynup/src/dynup_node.cpp b/bitbots_motion/bitbots_dynup/src/dynup_node.cpp index 69ed264c8..3316a348e 100644 --- a/bitbots_motion/bitbots_dynup/src/dynup_node.cpp +++ b/bitbots_motion/bitbots_dynup/src/dynup_node.cpp @@ -1,4 +1,4 @@ -#include "bitbots_dynup/dynup_node.hpp" +#include namespace bitbots_dynup { using namespace std::chrono_literals; diff --git a/bitbots_motion/bitbots_dynup/src/dynup_pywrapper.cpp b/bitbots_motion/bitbots_dynup/src/dynup_pywrapper.cpp index 8062bdb82..0ceb2aa34 100644 --- a/bitbots_motion/bitbots_dynup/src/dynup_pywrapper.cpp +++ b/bitbots_motion/bitbots_dynup/src/dynup_pywrapper.cpp @@ -1,4 +1,4 @@ -#include "bitbots_dynup/dynup_pywrapper.hpp" +#include PyDynupWrapper::PyDynupWrapper(const std::string ns) { // initialize rclcpp if not already done diff --git a/bitbots_motion/bitbots_dynup/src/dynup_stabilizer.cpp b/bitbots_motion/bitbots_dynup/src/dynup_stabilizer.cpp index e1e33c7f5..a44f34d15 100644 --- a/bitbots_motion/bitbots_dynup/src/dynup_stabilizer.cpp +++ b/bitbots_motion/bitbots_dynup/src/dynup_stabilizer.cpp @@ -1,4 +1,4 @@ -#include "bitbots_dynup/dynup_stabilizer.hpp" +#include namespace bitbots_dynup { diff --git a/bitbots_motion/bitbots_dynup/src/dynup_utils.cpp b/bitbots_motion/bitbots_dynup/src/dynup_utils.cpp index 3c218329c..82a85050f 100644 --- a/bitbots_motion/bitbots_dynup/src/dynup_utils.cpp +++ b/bitbots_motion/bitbots_dynup/src/dynup_utils.cpp @@ -1,4 +1,4 @@ -#include "bitbots_dynup/dynup_utils.hpp" +#include namespace bitbots_dynup { diff --git a/bitbots_motion/bitbots_dynup/src/visualizer.cpp b/bitbots_motion/bitbots_dynup/src/visualizer.cpp index 07bbaaf30..5228b28e5 100644 --- a/bitbots_motion/bitbots_dynup/src/visualizer.cpp +++ b/bitbots_motion/bitbots_dynup/src/visualizer.cpp @@ -1,5 +1,4 @@ -#include "bitbots_dynup/visualizer.hpp" - +#include #include namespace bitbots_dynup { diff --git a/bitbots_motion/bitbots_hcm/src/hcm.cpp b/bitbots_motion/bitbots_hcm/src/hcm.cpp index d22a44cee..d82358c0d 100644 --- a/bitbots_motion/bitbots_hcm/src/hcm.cpp +++ b/bitbots_motion/bitbots_hcm/src/hcm.cpp @@ -1,22 +1,21 @@ #include +#include +#include +#include +#include +#include #include +#include #include #include #include #include +#include +#include +#include #include -#include "bitbots_msgs/msg/animation.hpp" -#include "bitbots_msgs/msg/foot_pressure.hpp" -#include "bitbots_msgs/msg/joint_command.hpp" -#include "bitbots_msgs/msg/robot_control_state.hpp" -#include "builtin_interfaces/msg/time.hpp" -#include "geometry_msgs/msg/point_stamped.hpp" -#include "sensor_msgs/msg/imu.hpp" -#include "sensor_msgs/msg/joint_state.hpp" -#include "std_msgs/msg/header.hpp" - using std::placeholders::_1; namespace py = pybind11; namespace bitbots_hcm { diff --git a/bitbots_motion/bitbots_head_mover/src/move_head.cpp b/bitbots_motion/bitbots_head_mover/src/move_head.cpp index 242887a6f..c28bda1f5 100644 --- a/bitbots_motion/bitbots_head_mover/src/move_head.cpp +++ b/bitbots_motion/bitbots_head_mover/src/move_head.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -29,8 +30,6 @@ #include #include -#include "head_parameters.hpp" - using std::placeholders::_1; using namespace std::chrono_literals; @@ -648,7 +647,7 @@ class HeadMover { * @param tilt The current tilt position * @return int The index of the pattern keypoint that is closest to the current head position */ - int get_near_pattern_position(std::vector> pattern, double pan, double tilt) { + int get_near_pattern_position(const std::vector>& pattern, double pan, double tilt) { // Store the index and distance of the closest keypoint std::pair min_distance_point = {10000.0, -1}; // Iterate over all keypoints and calculate the distance to the current head position diff --git a/bitbots_motion/bitbots_moveit_bindings/src/bitbots_moveit_bindings.cpp b/bitbots_motion/bitbots_moveit_bindings/src/bitbots_moveit_bindings.cpp index e4b7ebd41..c467a2467 100644 --- a/bitbots_motion/bitbots_moveit_bindings/src/bitbots_moveit_bindings.cpp +++ b/bitbots_motion/bitbots_moveit_bindings/src/bitbots_moveit_bindings.cpp @@ -13,14 +13,13 @@ #include #include #include +#include #include #include #include #include #include #include - -#include "rcl_interfaces/srv/get_parameters.hpp" namespace py = pybind11; using namespace std::chrono_literals; using std::placeholders::_1; @@ -315,15 +314,15 @@ class BitbotsMoveitBindings { ik_options.goals.emplace_back(new bio_ik::LineGoal(m.link_name, p(m.position), p(m.direction), w(m.weight))); } - for (auto& m : ik_request.avoid_joint_limits_goals) { + for (const auto& m : ik_request.avoid_joint_limits_goals) { ik_options.goals.emplace_back(new bio_ik::AvoidJointLimitsGoal(w(m.weight), !m.primary)); } - for (auto& m : ik_request.minimal_displacement_goals) { + for (const auto& m : ik_request.minimal_displacement_goals) { ik_options.goals.emplace_back(new bio_ik::MinimalDisplacementGoal(w(m.weight), !m.primary)); } - for (auto& m : ik_request.center_joints_goals) { + for (const auto& m : ik_request.center_joints_goals) { ik_options.goals.emplace_back(new bio_ik::CenterJointsGoal(w(m.weight), !m.primary)); } diff --git a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_engine.hpp b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_engine.hpp index a57676d96..064209cde 100644 --- a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_engine.hpp +++ b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_engine.hpp @@ -9,14 +9,13 @@ The original files can be found at: #include #include +#include +#include +#include +#include +#include #include -#include "bitbots_quintic_walk/walk_utils.hpp" -#include "bitbots_quintic_walk_parameters.hpp" -#include "bitbots_splines/abstract_engine.hpp" -#include "bitbots_splines/pose_spline.hpp" -#include "bitbots_splines/smooth_spline.hpp" - namespace bitbots_quintic_walk { /** diff --git a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_ik.hpp b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_ik.hpp index 806943bfd..a64dd3113 100644 --- a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_ik.hpp +++ b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_ik.hpp @@ -2,11 +2,10 @@ #define BITBOTS_QUINTIC_WALK_INCLUDE_BITBOTS_QUINTIC_WALK_WALK_IK_H_ #include +#include +#include +#include #include - -#include "bitbots_quintic_walk/walk_utils.hpp" -#include "bitbots_quintic_walk_parameters.hpp" -#include "bitbots_splines/abstract_ik.hpp" namespace bitbots_quintic_walk { class WalkIK : public bitbots_splines::AbstractIK { diff --git a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_node.hpp b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_node.hpp index ad2da928c..62040bb1c 100644 --- a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_node.hpp +++ b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_node.hpp @@ -17,6 +17,16 @@ The original files can be found at: #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -38,17 +48,6 @@ The original files can be found at: #include #include -#include "biped_interfaces/msg/phase.hpp" -#include "bitbots_msgs/msg/foot_pressure.hpp" -#include "bitbots_msgs/msg/joint_command.hpp" -#include "bitbots_msgs/msg/robot_control_state.hpp" -#include "bitbots_quintic_walk/walk_engine.hpp" -#include "bitbots_quintic_walk/walk_ik.hpp" -#include "bitbots_quintic_walk/walk_stabilizer.hpp" -#include "bitbots_quintic_walk/walk_visualizer.hpp" -#include "bitbots_quintic_walk_parameters.hpp" -#include "bitbots_splines/abstract_ik.hpp" - namespace bitbots_quintic_walk { class WalkNode { diff --git a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_pywrapper.hpp b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_pywrapper.hpp index 258689f77..2436bd40d 100644 --- a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_pywrapper.hpp +++ b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_pywrapper.hpp @@ -7,6 +7,8 @@ #include #include #include +#include +#include #include #include #include @@ -15,9 +17,6 @@ #include #include -#include "bitbots_quintic_walk/walk_node.hpp" -#include "bitbots_quintic_walk/walk_utils.hpp" - namespace py = pybind11; using namespace ros2_python_extension; diff --git a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_stabilizer.hpp b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_stabilizer.hpp index 9ca5c46e9..7b5387833 100644 --- a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_stabilizer.hpp +++ b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_stabilizer.hpp @@ -4,6 +4,7 @@ #include #include +#include #include #include #include @@ -11,9 +12,6 @@ #include #include -#include "bitbots_quintic_walk/walk_utils.hpp" -#include "bitbots_splines/abstract_stabilizer.hpp" - namespace bitbots_quintic_walk { class WalkStabilizer : public bitbots_splines::AbstractStabilizer { diff --git a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_visualizer.hpp b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_visualizer.hpp index 490296fab..55dff00cb 100644 --- a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_visualizer.hpp +++ b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_visualizer.hpp @@ -7,19 +7,18 @@ #include #include +#include +#include #include #include +#include +#include #include #include #include #include #include -#include "bitbots_quintic_walk/msg/walk_debug.hpp" -#include "bitbots_quintic_walk/msg/walk_engine_debug.hpp" -#include "bitbots_splines/abstract_ik.hpp" -#include "bitbots_splines/abstract_visualizer.hpp" - namespace bitbots_quintic_walk { class WalkVisualizer : public bitbots_splines::AbstractVisualizer { public: diff --git a/bitbots_motion/bitbots_quintic_walk/src/walk_engine.cpp b/bitbots_motion/bitbots_quintic_walk/src/walk_engine.cpp index 6cc63a138..4b25314f8 100644 --- a/bitbots_motion/bitbots_quintic_walk/src/walk_engine.cpp +++ b/bitbots_motion/bitbots_quintic_walk/src/walk_engine.cpp @@ -3,7 +3,7 @@ This code is partly based on the original code by Quentin "Leph" Rouxel and Team The original files can be found at: https://github.com/Rhoban/model/ */ -#include "bitbots_quintic_walk/walk_engine.hpp" +#include namespace bitbots_quintic_walk { diff --git a/bitbots_motion/bitbots_quintic_walk/src/walk_ik.cpp b/bitbots_motion/bitbots_quintic_walk/src/walk_ik.cpp index 7ef787e74..14b4d5a0e 100644 --- a/bitbots_motion/bitbots_quintic_walk/src/walk_ik.cpp +++ b/bitbots_motion/bitbots_quintic_walk/src/walk_ik.cpp @@ -1,4 +1,4 @@ -#include "bitbots_quintic_walk/walk_ik.hpp" +#include namespace bitbots_quintic_walk { diff --git a/bitbots_motion/bitbots_quintic_walk/src/walk_node.cpp b/bitbots_motion/bitbots_quintic_walk/src/walk_node.cpp index 74e41eb37..4e48a6028 100644 --- a/bitbots_motion/bitbots_quintic_walk/src/walk_node.cpp +++ b/bitbots_motion/bitbots_quintic_walk/src/walk_node.cpp @@ -1,7 +1,6 @@ #define M_TAU M_PI * 2 -#include "bitbots_quintic_walk/walk_node.hpp" - +#include #include #include using std::placeholders::_1; diff --git a/bitbots_motion/bitbots_quintic_walk/src/walk_pywrapper.cpp b/bitbots_motion/bitbots_quintic_walk/src/walk_pywrapper.cpp index 3d83ae465..e0f2ac570 100644 --- a/bitbots_motion/bitbots_quintic_walk/src/walk_pywrapper.cpp +++ b/bitbots_motion/bitbots_quintic_walk/src/walk_pywrapper.cpp @@ -1,4 +1,4 @@ -#include "bitbots_quintic_walk/walk_pywrapper.hpp" +#include void PyWalkWrapper::spin_some() { rclcpp::spin_some(node_); } diff --git a/bitbots_motion/bitbots_quintic_walk/src/walk_stabilizer.cpp b/bitbots_motion/bitbots_quintic_walk/src/walk_stabilizer.cpp index 3e27e6ce3..7a54551a5 100644 --- a/bitbots_motion/bitbots_quintic_walk/src/walk_stabilizer.cpp +++ b/bitbots_motion/bitbots_quintic_walk/src/walk_stabilizer.cpp @@ -1,4 +1,4 @@ -#include "bitbots_quintic_walk/walk_stabilizer.hpp" +#include namespace bitbots_quintic_walk { diff --git a/bitbots_motion/bitbots_quintic_walk/src/walk_visualizer.cpp b/bitbots_motion/bitbots_quintic_walk/src/walk_visualizer.cpp index 0fc9e7823..a4e5d5151 100644 --- a/bitbots_motion/bitbots_quintic_walk/src/walk_visualizer.cpp +++ b/bitbots_motion/bitbots_quintic_walk/src/walk_visualizer.cpp @@ -1,4 +1,4 @@ -#include "bitbots_quintic_walk/walk_visualizer.hpp" +#include namespace bitbots_quintic_walk { WalkVisualizer::WalkVisualizer(rclcpp::Node::SharedPtr node, walking::Params::Node::Tf tf_config) diff --git a/bitbots_motion/bitbots_splines/include/bitbots_splines/pose_spline.hpp b/bitbots_motion/bitbots_splines/include/bitbots_splines/pose_spline.hpp index 8da987b65..3056d72b5 100644 --- a/bitbots_motion/bitbots_splines/include/bitbots_splines/pose_spline.hpp +++ b/bitbots_motion/bitbots_splines/include/bitbots_splines/pose_spline.hpp @@ -10,8 +10,7 @@ #include #include #include - -#include "tf2_geometry_msgs/tf2_geometry_msgs.hpp" +#include namespace bitbots_splines { diff --git a/bitbots_motion/bitbots_splines/src/Spline/polynom.cpp b/bitbots_motion/bitbots_splines/src/Spline/polynom.cpp index 691dbcc7d..546526193 100644 --- a/bitbots_motion/bitbots_splines/src/Spline/polynom.cpp +++ b/bitbots_motion/bitbots_splines/src/Spline/polynom.cpp @@ -3,9 +3,8 @@ This code is largely based on the original code by Quentin "Leph" Rouxel and Tea The original files can be found at: https://github.com/Rhoban/model/ */ -#include "bitbots_splines/polynom.hpp" - -#include "bitbots_splines/newton_binomial.hpp" +#include +#include namespace bitbots_splines { diff --git a/bitbots_motion/bitbots_splines/src/Spline/pose_spline.cpp b/bitbots_motion/bitbots_splines/src/Spline/pose_spline.cpp index 3e8392cb7..55721fbc7 100644 --- a/bitbots_motion/bitbots_splines/src/Spline/pose_spline.cpp +++ b/bitbots_motion/bitbots_splines/src/Spline/pose_spline.cpp @@ -1,4 +1,4 @@ -#include "bitbots_splines/pose_spline.hpp" +#include namespace bitbots_splines { diff --git a/bitbots_motion/bitbots_splines/src/Spline/position_spline.cpp b/bitbots_motion/bitbots_splines/src/Spline/position_spline.cpp index c979e9c6f..e2716e929 100644 --- a/bitbots_motion/bitbots_splines/src/Spline/position_spline.cpp +++ b/bitbots_motion/bitbots_splines/src/Spline/position_spline.cpp @@ -1,4 +1,4 @@ -#include "bitbots_splines/position_spline.hpp" +#include namespace bitbots_splines { diff --git a/bitbots_motion/bitbots_splines/src/Spline/smooth_spline.cpp b/bitbots_motion/bitbots_splines/src/Spline/smooth_spline.cpp index 682eaa761..1a3f2cc86 100644 --- a/bitbots_motion/bitbots_splines/src/Spline/smooth_spline.cpp +++ b/bitbots_motion/bitbots_splines/src/Spline/smooth_spline.cpp @@ -3,11 +3,10 @@ This code is largely based on the original code by Quentin "Leph" Rouxel and Tea The original files can be found at: https://github.com/Rhoban/model/ */ -#include "bitbots_splines/smooth_spline.hpp" - #include #include +#include #include namespace bitbots_splines { @@ -98,7 +97,7 @@ Polynom SmoothSpline::polynomFit(double t, double pos_1, double vel_1, double ac std::string SmoothSpline::getDebugString() { std::string output; int i = 0; - for (auto &p : points_) { + for (const auto &p : points_) { output += "Point:" + std::to_string(i) + "\n"; output += " Time: " + std::to_string(p.time) + "\n"; output += " Pos: " + std::to_string(p.position) + "\n"; diff --git a/bitbots_motion/bitbots_splines/src/Spline/spline.cpp b/bitbots_motion/bitbots_splines/src/Spline/spline.cpp index c43037270..12a83b4a7 100644 --- a/bitbots_motion/bitbots_splines/src/Spline/spline.cpp +++ b/bitbots_motion/bitbots_splines/src/Spline/spline.cpp @@ -3,8 +3,7 @@ This code is largely based on the original code by Quentin "Leph" Rouxel and Tea The original files can be found at: https://github.com/Rhoban/model/ */ -#include "bitbots_splines/spline.hpp" - +#include #include #include diff --git a/bitbots_motion/bitbots_splines/src/Utils/combination.cpp b/bitbots_motion/bitbots_splines/src/Utils/combination.cpp index eb985e418..414aaf6bb 100644 --- a/bitbots_motion/bitbots_splines/src/Utils/combination.cpp +++ b/bitbots_motion/bitbots_splines/src/Utils/combination.cpp @@ -3,8 +3,7 @@ This code is largely based on the original code by Quentin "Leph" Rouxel and Tea The original files can be found at: https://github.com/Rhoban/model/ */ -#include "bitbots_splines/combination.hpp" - +#include #include #include diff --git a/bitbots_motion/bitbots_splines/src/Utils/newton_binomial.cpp b/bitbots_motion/bitbots_splines/src/Utils/newton_binomial.cpp index 5c8dcc641..543c19548 100644 --- a/bitbots_motion/bitbots_splines/src/Utils/newton_binomial.cpp +++ b/bitbots_motion/bitbots_splines/src/Utils/newton_binomial.cpp @@ -3,8 +3,7 @@ This code is largely based on the original code by Quentin "Leph" Rouxel and Tea The original files can be found at: https://github.com/Rhoban/model/ */ -#include "bitbots_splines/newton_binomial.hpp" - +#include #include namespace bitbots_splines { diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/ObservationModel.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/ObservationModel.hpp index 2f50bc044..0819c2e19 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/ObservationModel.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/ObservationModel.hpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -18,8 +19,6 @@ #include #include -#include "localization_parameters.hpp" - namespace sm = sensor_msgs; namespace bl = bitbots_localization; namespace sv3dm = soccer_vision_3d_msgs; diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/Resampling.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/Resampling.hpp index 49c6dea46..b52b03e98 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/Resampling.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/Resampling.hpp @@ -5,10 +5,10 @@ #ifndef IMPORTANCERESAMPLINGWE_H #define IMPORTANCERESAMPLINGWE_H -#include +#include +#include -#include "particle_filter/CRandomNumberGenerator.h" -#include "particle_filter/ImportanceResampling.h" +#include namespace bitbots_localization { // ImportanceResampling with explorers @@ -97,5 +97,5 @@ void ImportanceResamplingWE::resample(const ParticleList &sourceList, // template // void ParticleFilter::drawAllFromDistribution(const // std::shared_ptr>& distribution) { -}; // namespace bitbots_localization +}; // namespace bitbots_localization #endif // IMPORTANCERESAMPLINGWE_H diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/localization.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/localization.hpp index ee996992b..819187560 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/localization.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/localization.hpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -57,8 +58,6 @@ #include #include -#include "localization_parameters.hpp" - namespace sm = sensor_msgs; namespace gm = geometry_msgs; namespace pf = particle_filter; diff --git a/bitbots_navigation/bitbots_localization/src/localization.cpp b/bitbots_navigation/bitbots_localization/src/localization.cpp index 9a9ac7884..c3cd2f8bd 100644 --- a/bitbots_navigation/bitbots_localization/src/localization.cpp +++ b/bitbots_navigation/bitbots_localization/src/localization.cpp @@ -1,5 +1,4 @@ -#include "bitbots_localization/localization.hpp" - +#include #include #include diff --git a/bitbots_navigation/bitbots_localization/src/map.cpp b/bitbots_navigation/bitbots_localization/src/map.cpp index 2f3c83491..dc63179cb 100644 --- a/bitbots_navigation/bitbots_localization/src/map.cpp +++ b/bitbots_navigation/bitbots_localization/src/map.cpp @@ -2,9 +2,8 @@ // Created by judith on 08.03.19. // -#include "bitbots_localization/map.hpp" - #include +#include #include namespace fs = boost::filesystem; diff --git a/bitbots_navigation/bitbots_odometry/include/bitbots_odometry/motion_odometry.hpp b/bitbots_navigation/bitbots_odometry/include/bitbots_odometry/motion_odometry.hpp index b734adb8b..e0b3fffc5 100644 --- a/bitbots_navigation/bitbots_odometry/include/bitbots_odometry/motion_odometry.hpp +++ b/bitbots_navigation/bitbots_odometry/include/bitbots_odometry/motion_odometry.hpp @@ -7,14 +7,13 @@ #include #include #include +#include #include #include #include #include #include -#include "odometry_parameters.hpp" - using std::placeholders::_1; namespace bitbots_odometry { diff --git a/scripts/deploy/tasks/build.py b/scripts/deploy/tasks/build.py index feb7f68c4..610d413d2 100644 --- a/scripts/deploy/tasks/build.py +++ b/scripts/deploy/tasks/build.py @@ -76,7 +76,7 @@ def _build(self, connections: Group) -> GroupResult: cmd = ( "sync;" f"cd {self._remote_workspace};" - "source /opt/ros/iron/setup.zsh;" + "source /opt/ros/jazzy/setup.zsh;" "ISOLATED_CPUS=\"$(grep -oP 'isolcpus=\\K([\\d-]+)' /proc/cmdline)\";" # type: ignore[reportInvalidStringEscapeSequence] f"chrt -r 1 taskset -c ${{ISOLATED_CPUS:-0-15}} colcon build --symlink-install {package_option} --continue-on-error || exit 1;" "sync;" diff --git a/scripts/robot_compile.py b/scripts/robot_compile.py index f8ade01d5..41321777e 100755 --- a/scripts/robot_compile.py +++ b/scripts/robot_compile.py @@ -374,7 +374,7 @@ def build(target, package="", pre_clean=False): cmd = ( "sync;" "cd {workspace};" - "source /opt/ros/iron/setup.zsh;" + "source /opt/ros/jazzy/setup.zsh;" "source install/setup.zsh;" "{cmd_clean}" "ISOLATED_CPUS=\"$(grep -oP 'isolcpus=\\K([\\d-]+)' /proc/cmdline)\";" @@ -408,7 +408,7 @@ def install_rosdeps(target): target_src_path = os.path.join(target.workspace, "src") extra_flags = "-q" if _should_run_quietly() else "" - cmd = f"rosdep install -y {extra_flags} --rosdistro iron --ignore-src --from-paths {target_src_path}" + cmd = f"rosdep install -y {extra_flags} --rosdistro jazzy --ignore-src --from-paths {target_src_path}" rosdep_result = _execute_on_target(target, cmd) if rosdep_result.returncode == 0: diff --git a/scripts/ros.plugin.sh b/scripts/ros.plugin.sh index 339c208a8..6ba9f121c 100644 --- a/scripts/ros.plugin.sh +++ b/scripts/ros.plugin.sh @@ -18,7 +18,7 @@ update_ros2_argcomplete() { eval "$(register-python-argcomplete ros2)" } -# Source the ROS 2 setup files if iron is installed +# Source the ROS 2 setup files if jazzy is installed if [[ -n "$distro" ]]; then source "/opt/ros/$distro/setup.$shell" &> /dev/null else diff --git a/scripts/setup.sh b/scripts/setup.sh index 4cb63208c..56154692e 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -2,7 +2,7 @@ set -eEuo pipefail # static/global variables -ROS_DISTRO=${ROS_DISTRO:-"iron"} +ROS_DISTRO=${ROS_DISTRO:-"jazzy"} DIR="$(dirname "$(readlink -f "$0")")" COLCON_WS="${COLCON_WS:-"$HOME/colcon_ws"}" REPO_URL="git@github.com:bit-bots/bitbots_main.git" From ae3d0c9c1795fe36995f2a1affad2d77de272410 Mon Sep 17 00:00:00 2001 From: JanNiklasFeld Date: Sun, 24 Nov 2024 15:46:07 +0000 Subject: [PATCH 08/65] New Formating --- .github/workflows/ci.yml | 2 +- .../include/bitbots_localization/Resampling.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a8533d17a..7882645e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: build: runs-on: ubuntu-latest container: - image: ubuntu:jammy + image: ubuntu:noble steps: - name: Cancel outdated jobs diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/Resampling.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/Resampling.hpp index b52b03e98..5fa085c8e 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/Resampling.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/Resampling.hpp @@ -97,5 +97,5 @@ void ImportanceResamplingWE::resample(const ParticleList &sourceList, // template // void ParticleFilter::drawAllFromDistribution(const // std::shared_ptr>& distribution) { -}; // namespace bitbots_localization +}; // namespace bitbots_localization #endif // IMPORTANCERESAMPLINGWE_H From 8ecfb9396b09744eac5677329b9938da4d22a87a Mon Sep 17 00:00:00 2001 From: texhnolyze Date: Mon, 25 Nov 2024 17:48:08 +0100 Subject: [PATCH 09/65] test(team_comm): update snapshots as with upgrade to jazzy or packages floating point handling seems to have changed slightly --- .../test_state_to_message_converter.ambr | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/bitbots_team_communication/bitbots_team_communication/test/converter/__snapshots__/test_state_to_message_converter.ambr b/bitbots_team_communication/bitbots_team_communication/test/converter/__snapshots__/test_state_to_message_converter.ambr index 12cf92053..57ca74e24 100644 --- a/bitbots_team_communication/bitbots_team_communication/test/converter/__snapshots__/test_state_to_message_converter.ambr +++ b/bitbots_team_communication/bitbots_team_communication/test/converter/__snapshots__/test_state_to_message_converter.ambr @@ -2,14 +2,14 @@ # name: test_convert_ball_position ''' position { - x: 4.599999904632568 - y: 2.799999952316284 - z: 2.9000000953674316 + x: 4.6 + y: 2.8 + z: 2.9 } velocity { - x: 1.100000023841858 - y: 0.20000000298023224 - z: 0.30000001192092896 + x: 1.1 + y: 0.2 + z: 0.3 } covariance { x { @@ -33,9 +33,9 @@ # --- # name: test_convert_current_pose ''' - x: 3.5999999046325684 - y: 1.7999999523162842 - z: 1.2167989015579224 + x: 3.6 + y: 1.8 + z: 1.2167989 ''' # --- @@ -97,23 +97,23 @@ ''' [player_id: 2 position { - x: 3.5999999046325684 - y: 1.7999999523162842 - z: 1.2167989015579224 + x: 3.6 + y: 1.8 + z: 1.2167989 } team: BLUE , player_id: 3 position { - x: 3.5999999046325684 - y: 1.7999999523162842 - z: 1.2167989015579224 + x: 3.6 + y: 1.8 + z: 1.2167989 } team: RED , player_id: 4 position { - x: 3.5999999046325684 - y: 1.7999999523162842 - z: 1.2167989015579224 + x: 3.6 + y: 1.8 + z: 1.2167989 } ] ''' @@ -128,9 +128,9 @@ # name: test_convert_target_pose ''' position { - x: 2.5999999046325684 - y: 0.800000011920929 - z: 1.2167989015579224 + x: 2.6 + y: 0.8 + z: 1.2167989 } ''' From 1cd061dbb44727155b4df132ffd466aa6d5308d4 Mon Sep 17 00:00:00 2001 From: texhnolyze Date: Thu, 12 Dec 2024 12:22:32 +0100 Subject: [PATCH 10/65] style(pre-commit): fix clang-format errors --- .../include/bitbots_ros_control/hardware_interface.hpp | 6 +++--- .../bitbots_ros_control/src/pressure_converter.cpp | 3 ++- .../include/bitbots_localization/MotionModel.hpp | 2 +- .../include/bitbots_localization/Resampling.hpp | 2 +- .../include/bitbots_localization/map.hpp | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/hardware_interface.hpp b/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/hardware_interface.hpp index 499222df5..cc59c3041 100644 --- a/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/hardware_interface.hpp +++ b/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/hardware_interface.hpp @@ -12,11 +12,11 @@ class HardwareInterface { public: virtual bool init() = 0; - virtual void read(const rclcpp::Time &t, const rclcpp::Duration &dt) {}; + virtual void read(const rclcpp::Time &t, const rclcpp::Duration &dt){}; - virtual void write(const rclcpp::Time &t, const rclcpp::Duration &dt) {}; + virtual void write(const rclcpp::Time &t, const rclcpp::Duration &dt){}; - virtual void restoreAfterPowerCycle() {}; + virtual void restoreAfterPowerCycle(){}; virtual ~HardwareInterface(){}; }; diff --git a/bitbots_lowlevel/bitbots_ros_control/src/pressure_converter.cpp b/bitbots_lowlevel/bitbots_ros_control/src/pressure_converter.cpp index 0dff0ae2e..7cdc9f597 100644 --- a/bitbots_lowlevel/bitbots_ros_control/src/pressure_converter.cpp +++ b/bitbots_lowlevel/bitbots_ros_control/src/pressure_converter.cpp @@ -76,7 +76,8 @@ PressureConverter::PressureConverter(rclcpp::Node::SharedPtr nh, char side) { } for (int i = 0; i < 4; i++) { std::stringstream single_wrench_frame; - single_wrench_frame << side << "_" << "cleat_" << wrench_topics[i]; + single_wrench_frame << side << "_" + << "cleat_" << wrench_topics[i]; wrench_frames_.push_back(single_wrench_frame.str()); } diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/MotionModel.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/MotionModel.hpp index 0c26f5139..d767c4edc 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/MotionModel.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/MotionModel.hpp @@ -61,5 +61,5 @@ class RobotMotionModel : public particle_filter::MovementModel { double sample(double b) const; }; -}; // namespace bitbots_localization +}; // namespace bitbots_localization #endif // BITBOTS_LOCALIZATION_MOTIONMODEL_H diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/Resampling.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/Resampling.hpp index 5fa085c8e..b52b03e98 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/Resampling.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/Resampling.hpp @@ -97,5 +97,5 @@ void ImportanceResamplingWE::resample(const ParticleList &sourceList, // template // void ParticleFilter::drawAllFromDistribution(const // std::shared_ptr>& distribution) { -}; // namespace bitbots_localization +}; // namespace bitbots_localization #endif // IMPORTANCERESAMPLINGWE_H diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/map.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/map.hpp index 44839346d..5acb8e9a5 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/map.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/map.hpp @@ -53,5 +53,5 @@ class Map { private: double out_of_map_value_; }; -}; // namespace bitbots_localization +}; // namespace bitbots_localization #endif // BITBOTS_LOCALIZATION_MAP_H From ef65537cb921a034c6b187d9d7cbe4b3a3103ab0 Mon Sep 17 00:00:00 2001 From: texhnolyze Date: Thu, 12 Dec 2024 19:07:37 +0100 Subject: [PATCH 11/65] test(colcon): configure our pkgs to use `pytest` to ensure that the CI `colcon test` run works, because with a change to python 3.12 the `unittest` standard library used by default with colcon now exits with an error code of 5 for an empty test suite. See: https://github.com/colcon/colcon-core/issues/678 See: https://github.com/python/cpython/pull/102051 --- bitbots_behavior/bitbots_body_behavior/package.xml | 1 + bitbots_behavior/bitbots_body_behavior/setup.py | 4 ++-- bitbots_misc/bitbots_technical_challenge_vision/setup.py | 1 + bitbots_misc/bitbots_teleop/package.xml | 2 ++ bitbots_misc/bitbots_teleop/setup.py | 1 + bitbots_misc/bitbots_tts/package.xml | 4 +++- bitbots_misc/bitbots_tts/setup.py | 3 ++- bitbots_misc/system_monitor/package.xml | 9 ++++++--- bitbots_misc/system_monitor/setup.py | 3 ++- bitbots_motion/bitbots_animation_rqt/package.xml | 2 ++ bitbots_motion/bitbots_animation_rqt/setup.py | 3 ++- bitbots_motion/bitbots_animation_server/package.xml | 2 ++ bitbots_motion/bitbots_animation_server/setup.py | 1 + bitbots_simulation/bitbots_robocup_api/package.xml | 2 ++ bitbots_simulation/bitbots_robocup_api/setup.py | 3 ++- .../bitbots_team_communication/setup.py | 4 +--- .../bitbots_team_data_sim_rqt/package.xml | 2 ++ .../bitbots_team_data_sim_rqt/setup.py | 3 ++- bitbots_vision/package.xml | 2 ++ bitbots_vision/setup.py | 1 + bitbots_world_model/bitbots_ball_filter/package.xml | 2 ++ bitbots_world_model/bitbots_ball_filter/setup.py | 1 + bitbots_world_model/bitbots_robot_filter/setup.py | 4 ++-- scripts/ros.plugin.sh | 1 + 24 files changed, 45 insertions(+), 16 deletions(-) diff --git a/bitbots_behavior/bitbots_body_behavior/package.xml b/bitbots_behavior/bitbots_body_behavior/package.xml index b660e9c5a..6a12bc9ce 100644 --- a/bitbots_behavior/bitbots_body_behavior/package.xml +++ b/bitbots_behavior/bitbots_body_behavior/package.xml @@ -30,6 +30,7 @@ tf_transformations tf2 + python3-pytest diff --git a/bitbots_behavior/bitbots_body_behavior/setup.py b/bitbots_behavior/bitbots_body_behavior/setup.py index 2b535daae..097ec5c5b 100644 --- a/bitbots_behavior/bitbots_body_behavior/setup.py +++ b/bitbots_behavior/bitbots_body_behavior/setup.py @@ -1,13 +1,13 @@ import glob -from setuptools import setup +from setuptools import find_packages, setup package_name = "bitbots_body_behavior" setup( name=package_name, - packages=[package_name], + packages=find_packages(exclude=["test"]), data_files=[ ("share/" + package_name, ["package.xml"]), ("share/ament_index/resource_index/packages", ["resource/" + package_name]), diff --git a/bitbots_misc/bitbots_technical_challenge_vision/setup.py b/bitbots_misc/bitbots_technical_challenge_vision/setup.py index 4603d372c..cfe0915aa 100644 --- a/bitbots_misc/bitbots_technical_challenge_vision/setup.py +++ b/bitbots_misc/bitbots_technical_challenge_vision/setup.py @@ -16,6 +16,7 @@ ("share/" + package_name + "/launch", glob.glob("launch/*.launch")), ], install_requires=["setuptools"], + tests_require=["pytest"], zip_safe=True, maintainer="par", maintainer_email="paer-wiegmann@gmx.de", diff --git a/bitbots_misc/bitbots_teleop/package.xml b/bitbots_misc/bitbots_teleop/package.xml index 298625eab..15aad8159 100644 --- a/bitbots_misc/bitbots_teleop/package.xml +++ b/bitbots_misc/bitbots_teleop/package.xml @@ -20,6 +20,8 @@ std_msgs tf_transformations + python3-pytest + python2 diff --git a/bitbots_misc/bitbots_teleop/setup.py b/bitbots_misc/bitbots_teleop/setup.py index 0e1db4322..148552ede 100644 --- a/bitbots_misc/bitbots_teleop/setup.py +++ b/bitbots_misc/bitbots_teleop/setup.py @@ -19,6 +19,7 @@ "launch", "setuptools", ], + tests_require=["pytest"], zip_safe=True, keywords=["ROS"], license="MIT", diff --git a/bitbots_misc/bitbots_tts/package.xml b/bitbots_misc/bitbots_tts/package.xml index 096597d26..f0a86a2cc 100644 --- a/bitbots_misc/bitbots_tts/package.xml +++ b/bitbots_misc/bitbots_tts/package.xml @@ -11,7 +11,7 @@ Hamburg Bit-Bots MIT - + Marc Bestmann ament_cmake @@ -21,6 +21,8 @@ espeak std_msgs + python3-pytest + broken diff --git a/bitbots_misc/bitbots_tts/setup.py b/bitbots_misc/bitbots_tts/setup.py index 29cedacd8..9d702643b 100644 --- a/bitbots_misc/bitbots_tts/setup.py +++ b/bitbots_misc/bitbots_tts/setup.py @@ -6,7 +6,7 @@ setup( name=package_name, - packages=find_packages(), + packages=find_packages(exclude=["test"]), data_files=[ ("share/" + package_name, ["package.xml"]), ("share/ament_index/resource_index/packages", ["resource/" + package_name]), @@ -16,6 +16,7 @@ install_requires=[ "setuptools", ], + tests_require=["pytest"], scripts=glob.glob("scripts/*"), entry_points={ "console_scripts": [ diff --git a/bitbots_misc/system_monitor/package.xml b/bitbots_misc/system_monitor/package.xml index 46545bde4..4284ff58c 100644 --- a/bitbots_misc/system_monitor/package.xml +++ b/bitbots_misc/system_monitor/package.xml @@ -11,7 +11,7 @@ Hamburg Bit-Bots MIT - + Finn-Thorben Sell ament_cmake @@ -21,7 +21,10 @@ rclpy bitbots_msgs - ament_python + python3-pytest + + + ament_python - + diff --git a/bitbots_misc/system_monitor/setup.py b/bitbots_misc/system_monitor/setup.py index eb10b08e6..0de29d43a 100644 --- a/bitbots_misc/system_monitor/setup.py +++ b/bitbots_misc/system_monitor/setup.py @@ -6,7 +6,7 @@ setup( name=package_name, - packages=find_packages(), + packages=find_packages(exclude=["test"]), data_files=[ ("share/" + package_name, ["package.xml"]), ("share/ament_index/resource_index/packages", ["resource/" + package_name]), @@ -18,6 +18,7 @@ install_requires=[ "setuptools", ], + tests_require=["pytest"], entry_points={ "console_scripts": [ "monitor = system_monitor.monitor:main", diff --git a/bitbots_motion/bitbots_animation_rqt/package.xml b/bitbots_motion/bitbots_animation_rqt/package.xml index aec6962c0..40019b786 100644 --- a/bitbots_motion/bitbots_animation_rqt/package.xml +++ b/bitbots_motion/bitbots_animation_rqt/package.xml @@ -22,6 +22,8 @@ rqt_gui std_srvs + python3-pytest + diff --git a/bitbots_motion/bitbots_animation_rqt/setup.py b/bitbots_motion/bitbots_animation_rqt/setup.py index ff22687d2..639dc194a 100644 --- a/bitbots_motion/bitbots_animation_rqt/setup.py +++ b/bitbots_motion/bitbots_animation_rqt/setup.py @@ -4,7 +4,7 @@ setup( name=package_name, - packages=find_packages(), + packages=find_packages(exclude=["test"]), data_files=[ ("share/" + package_name + "/resource", ["resource/RecordUI.ui"]), ("share/ament_index/resource_index/packages", ["resource/" + package_name]), @@ -12,6 +12,7 @@ ("share/" + package_name, ["plugin.xml"]), ], install_requires=["setuptools"], + tests_require=["pytest"], zip_safe=True, entry_points={ "console_scripts": [ diff --git a/bitbots_motion/bitbots_animation_server/package.xml b/bitbots_motion/bitbots_animation_server/package.xml index 5552f2810..77427c8ef 100644 --- a/bitbots_motion/bitbots_animation_server/package.xml +++ b/bitbots_motion/bitbots_animation_server/package.xml @@ -22,6 +22,8 @@ rclpy std_msgs + python3-pytest + tested_integration diff --git a/bitbots_motion/bitbots_animation_server/setup.py b/bitbots_motion/bitbots_animation_server/setup.py index c93d21760..c41689c5f 100644 --- a/bitbots_motion/bitbots_animation_server/setup.py +++ b/bitbots_motion/bitbots_animation_server/setup.py @@ -18,6 +18,7 @@ "launch", "setuptools", ], + tests_require=["pytest"], zip_safe=True, keywords=["ROS"], license="MIT", diff --git a/bitbots_simulation/bitbots_robocup_api/package.xml b/bitbots_simulation/bitbots_robocup_api/package.xml index b7b2c2954..3d390044e 100644 --- a/bitbots_simulation/bitbots_robocup_api/package.xml +++ b/bitbots_simulation/bitbots_robocup_api/package.xml @@ -29,6 +29,8 @@ topic_tools rosbag2 + python3-pytest + ament_python diff --git a/bitbots_simulation/bitbots_robocup_api/setup.py b/bitbots_simulation/bitbots_robocup_api/setup.py index 94fdf23af..2ab578e4e 100644 --- a/bitbots_simulation/bitbots_robocup_api/setup.py +++ b/bitbots_simulation/bitbots_robocup_api/setup.py @@ -7,7 +7,7 @@ setup( name=package_name, - packages=find_packages(), + packages=find_packages(exclude=["test"]), data_files=[ ("share/ament_index/resource_index/packages", ["resource/" + package_name]), (os.path.join("share", package_name), ["package.xml"]), @@ -18,6 +18,7 @@ "launch", "setuptools", ], + tests_require=["pytest"], zip_safe=True, keywords=["ROS"], license="MIT", diff --git a/bitbots_team_communication/bitbots_team_communication/setup.py b/bitbots_team_communication/bitbots_team_communication/setup.py index c7defe03d..e84961b43 100644 --- a/bitbots_team_communication/bitbots_team_communication/setup.py +++ b/bitbots_team_communication/bitbots_team_communication/setup.py @@ -8,7 +8,5 @@ install_requires=[ "setuptools", ], - extras_require={ - "dev": ["pytest", "syrupy"], - }, + tests_require=["pytest", "syrupy"], ) diff --git a/bitbots_team_communication/bitbots_team_data_sim_rqt/package.xml b/bitbots_team_communication/bitbots_team_data_sim_rqt/package.xml index f62e2a73e..529c50300 100644 --- a/bitbots_team_communication/bitbots_team_data_sim_rqt/package.xml +++ b/bitbots_team_communication/bitbots_team_data_sim_rqt/package.xml @@ -22,6 +22,8 @@ rqt_gui std_srvs + python3-pytest + diff --git a/bitbots_team_communication/bitbots_team_data_sim_rqt/setup.py b/bitbots_team_communication/bitbots_team_data_sim_rqt/setup.py index a0f3e44aa..65fc7a504 100644 --- a/bitbots_team_communication/bitbots_team_data_sim_rqt/setup.py +++ b/bitbots_team_communication/bitbots_team_data_sim_rqt/setup.py @@ -4,7 +4,7 @@ setup( name=package_name, - packages=find_packages(), + packages=find_packages(exclude=["test"]), data_files=[ ("share/" + package_name + "/resource", ["resource/RobotTeamDataSimulator.ui"]), ("share/ament_index/resource_index/packages", ["resource/" + package_name]), @@ -12,6 +12,7 @@ ("share/" + package_name, ["plugin.xml"]), ], install_requires=["setuptools"], + tests_require=["pytest"], zip_safe=True, entry_points={ "console_scripts": [ diff --git a/bitbots_vision/package.xml b/bitbots_vision/package.xml index 740a5ded8..752e2fc74 100644 --- a/bitbots_vision/package.xml +++ b/bitbots_vision/package.xml @@ -40,6 +40,8 @@ std_msgs vision_opencv + python3-pytest + python3 diff --git a/bitbots_vision/setup.py b/bitbots_vision/setup.py index 2e24e1962..96b053d04 100755 --- a/bitbots_vision/setup.py +++ b/bitbots_vision/setup.py @@ -23,6 +23,7 @@ "launch", "setuptools", ], + tests_require=["pytest"], zip_safe=True, keywords=["ROS"], license="MIT", diff --git a/bitbots_world_model/bitbots_ball_filter/package.xml b/bitbots_world_model/bitbots_ball_filter/package.xml index 7c3cf3f1b..554e655e3 100644 --- a/bitbots_world_model/bitbots_ball_filter/package.xml +++ b/bitbots_world_model/bitbots_ball_filter/package.xml @@ -23,6 +23,8 @@ std_srvs tf2_geometry_msgs + python3-pytest + python3 diff --git a/bitbots_world_model/bitbots_ball_filter/setup.py b/bitbots_world_model/bitbots_ball_filter/setup.py index 56e0df152..c98cbb296 100644 --- a/bitbots_world_model/bitbots_ball_filter/setup.py +++ b/bitbots_world_model/bitbots_ball_filter/setup.py @@ -24,6 +24,7 @@ "launch", "setuptools", ], + tests_require=["pytest"], zip_safe=True, keywords=["ROS"], license="MIT", diff --git a/bitbots_world_model/bitbots_robot_filter/setup.py b/bitbots_world_model/bitbots_robot_filter/setup.py index 3c1d1b074..ce4c50c38 100644 --- a/bitbots_world_model/bitbots_robot_filter/setup.py +++ b/bitbots_world_model/bitbots_robot_filter/setup.py @@ -1,13 +1,13 @@ import glob -from setuptools import setup +from setuptools import find_packages, setup package_name = "bitbots_robot_filter" setup( name=package_name, version="0.0.0", - packages=[package_name], + packages=find_packages(exclude=["test"]), data_files=[ ("share/ament_index/resource_index/packages", ["resource/" + package_name]), ("share/" + package_name, ["package.xml"]), diff --git a/scripts/ros.plugin.sh b/scripts/ros.plugin.sh index 6ba9f121c..3fe2f1096 100644 --- a/scripts/ros.plugin.sh +++ b/scripts/ros.plugin.sh @@ -54,6 +54,7 @@ alias cbs='cdc && colcon build --symlink-install --packages-select' alias cb='cdc && colcon build --symlink-install --continue-on-error --packages-up-to' alias cc='cdc && colcon clean packages --packages-select' alias cca='cdc && colcon clean packages' +alias ct='cdc && colcon test --event-handlers console_direct+ --return-code-on-test-failure' alias sr="source /opt/ros/$distro/setup.$shell && update_ros2_argcomplete" alias sc="source \$COLCON_WS/install/setup.$shell && update_ros2_argcomplete" From 67423dc4d2035812f02b0b68bf064f144be263b4 Mon Sep 17 00:00:00 2001 From: Jan Gutsche Date: Sat, 4 Jan 2025 15:46:47 +0000 Subject: [PATCH 12/65] Ignore additional easyinstall/setup.py deprecation warnings When using the colcon `--symlink-install` flag (as we usually do), one gets shown the following huge warning for every Python-package: ``` /usr/lib/python3/dist-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated. !! ******************************************************************************** Please avoid running ``setup.py`` and ``easy_install``. Instead, use pypa/build, pypa/installer or other standards-based tools. See https://github.com/pypa/setuptools/issues/917 for details. ******************************************************************************** !! easy_install.initialize_options(self) --- ``` Has been solved by: https://github.com/ros2/ros2/issues/1577#issuecomment-2463209581 --- .devcontainer/zshrc | 2 +- .../docs/manual/tutorials/install_software_ros2.rst | 2 +- scripts/setup.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.devcontainer/zshrc b/.devcontainer/zshrc index 2a59d4548..70e5cf296 100644 --- a/.devcontainer/zshrc +++ b/.devcontainer/zshrc @@ -55,7 +55,7 @@ export PROMPT="%K{black} 🐋 %K{blue}%F{black} %~ %f%k%F{blue}%f " # Pre # >>> bit-bots initialize >>> # Ignore some deprecation warnings -export PYTHONWARNINGS=ignore:::setuptools.command.install,ignore:::setuptools.command.easy_install,ignore:::pkg_resources +export PYTHONWARNINGS="ignore:::setuptools.command.install,ignore:::setuptools.command.easy_install,ignore:::pkg_resources,ignore:easy_install command is deprecated,ignore:setup.py install is deprecated" # Limit ROS 2 communication to localhost (can be overridden when needed) export ROS_DOMAIN_ID=24 diff --git a/bitbots_misc/bitbots_docs/docs/manual/tutorials/install_software_ros2.rst b/bitbots_misc/bitbots_docs/docs/manual/tutorials/install_software_ros2.rst index 26b7fb244..747016526 100644 --- a/bitbots_misc/bitbots_docs/docs/manual/tutorials/install_software_ros2.rst +++ b/bitbots_misc/bitbots_docs/docs/manual/tutorials/install_software_ros2.rst @@ -109,7 +109,7 @@ In case you are not using the bash shell, replace ``~/.bashrc`` and ``bash`` wit # >>> bit-bots initialize >>> # Ignore some deprecation warnings - export PYTHONWARNINGS=ignore:::setuptools.command.install,ignore:::setuptools.command.easy_install,ignore:::pkg_resources + export PYTHONWARNINGS="ignore:::setuptools.command.install,ignore:::setuptools.command.easy_install,ignore:::pkg_resources,ignore:easy_install command is deprecated,ignore:setup.py install is deprecated" # Limit ROS 2 communication to localhost (can be overridden when needed) export ROS_DOMAIN_ID=24 diff --git a/scripts/setup.sh b/scripts/setup.sh index 56154692e..7eefc037d 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -11,7 +11,7 @@ SHELL_CONFIG="$(cat <>> bit-bots initialize >>> # Ignore some deprecation warnings -export PYTHONWARNINGS=ignore:::setuptools.command.install,ignore:::setuptools.command.easy_install,ignore:::pkg_resources +export PYTHONWARNINGS="ignore:::setuptools.command.install,ignore:::setuptools.command.easy_install,ignore:::pkg_resources,ignore:easy_install command is deprecated,ignore:setup.py install is deprecated" # Limit ROS 2 communication to localhost (can be overridden when needed) export ROS_DOMAIN_ID=24 From ddb12cdf54352c07899f31108a47330ebf31e52a Mon Sep 17 00:00:00 2001 From: Jan Gutsche Date: Sat, 4 Jan 2025 17:00:59 +0000 Subject: [PATCH 13/65] Resolve cmake warning from lto-wrapper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This resolves the following cmake warning, that seems to appear when pybind is in use: ``` lto-wrapper: warning: using serial compilation of 2 LTRANS jobs lto-wrapper: note: see the ‘-flto’ option documentation for more information ``` --- bitbots_misc/bitbots_tf_buffer/CMakeLists.txt | 13 ++++++++++++- bitbots_motion/bitbots_dynup/CMakeLists.txt | 13 ++++++++++++- .../bitbots_moveit_bindings/CMakeLists.txt | 13 ++++++++++++- bitbots_motion/bitbots_quintic_walk/CMakeLists.txt | 13 ++++++++++++- 4 files changed, 48 insertions(+), 4 deletions(-) diff --git a/bitbots_misc/bitbots_tf_buffer/CMakeLists.txt b/bitbots_misc/bitbots_tf_buffer/CMakeLists.txt index 501ca675d..b4922e8d6 100644 --- a/bitbots_misc/bitbots_tf_buffer/CMakeLists.txt +++ b/bitbots_misc/bitbots_tf_buffer/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.9) project(bitbots_tf_buffer) # Add support for C++17 @@ -6,6 +6,17 @@ if(NOT CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 17) endif() +# Include CheckIPOSupported module +include(CheckIPOSupported) + +# Check if IPO is supported +check_ipo_supported(RESULT ipo_supported) +if(ipo_supported) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) + # Set the number of parallel LTO jobs + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto=4") +endif() + set(PYBIND11_PYTHON_VERSION 3) set(PYBIND11_FINDPYTHON ON) find_package(ament_cmake REQUIRED) diff --git a/bitbots_motion/bitbots_dynup/CMakeLists.txt b/bitbots_motion/bitbots_dynup/CMakeLists.txt index cc6b28526..92d14d9f4 100644 --- a/bitbots_motion/bitbots_dynup/CMakeLists.txt +++ b/bitbots_motion/bitbots_dynup/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.9) project(bitbots_dynup) # Add support for C++20 @@ -6,6 +6,17 @@ if(NOT CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 20) endif() +# Include CheckIPOSupported module +include(CheckIPOSupported) + +# Check if IPO is supported +check_ipo_supported(RESULT ipo_supported) +if(ipo_supported) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) + # Set the number of parallel LTO jobs + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto=4") +endif() + set(PYBIND11_PYTHON_VERSION 3) set(PYBIND11_FINDPYTHON ON) diff --git a/bitbots_motion/bitbots_moveit_bindings/CMakeLists.txt b/bitbots_motion/bitbots_moveit_bindings/CMakeLists.txt index 08708a75c..539624b94 100644 --- a/bitbots_motion/bitbots_moveit_bindings/CMakeLists.txt +++ b/bitbots_motion/bitbots_moveit_bindings/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.9) project(bitbots_moveit_bindings) # Add support for C++17 @@ -6,6 +6,17 @@ if(NOT CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 17) endif() +# Include CheckIPOSupported module +include(CheckIPOSupported) + +# Check if IPO is supported +check_ipo_supported(RESULT ipo_supported) +if(ipo_supported) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) + # Set the number of parallel LTO jobs + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto=4") +endif() + set(PYBIND11_PYTHON_VERSION 3) set(PYBIND11_FINDPYTHON ON) find_package(bitbots_docs REQUIRED) diff --git a/bitbots_motion/bitbots_quintic_walk/CMakeLists.txt b/bitbots_motion/bitbots_quintic_walk/CMakeLists.txt index b8c458792..b44cae840 100644 --- a/bitbots_motion/bitbots_quintic_walk/CMakeLists.txt +++ b/bitbots_motion/bitbots_quintic_walk/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.9) project(bitbots_quintic_walk) # Add support for C++20 @@ -6,6 +6,17 @@ if(NOT CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 20) endif() +# Include CheckIPOSupported module +include(CheckIPOSupported) + +# Check if IPO is supported +check_ipo_supported(RESULT ipo_supported) +if(ipo_supported) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) + # Set the number of parallel LTO jobs + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto=4") +endif() + set(PYBIND11_PYTHON_VERSION 3) set(PYBIND11_FINDPYTHON ON) From 6291acf8b773ae2ecc4dbb092de06b096540722a Mon Sep 17 00:00:00 2001 From: Jan Gutsche Date: Sat, 4 Jan 2025 17:01:36 +0000 Subject: [PATCH 14/65] Remove outdated comment --- bitbots_motion/bitbots_head_mover/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/bitbots_motion/bitbots_head_mover/CMakeLists.txt b/bitbots_motion/bitbots_head_mover/CMakeLists.txt index 3fa26761b..73fa0c3e6 100644 --- a/bitbots_motion/bitbots_head_mover/CMakeLists.txt +++ b/bitbots_motion/bitbots_head_mover/CMakeLists.txt @@ -25,8 +25,6 @@ find_package(tf2_ros REQUIRED) set(CMAKE_BUILD_TYPE Debug) -# uncomment the following section in order to fill in further dependencies -# manually. find_package( REQUIRED) generate_parameter_library( head_parameters # cmake target name for the parameter library config/head_config.yml) From b3a27cd9b4469d1c78df18a366f8c854beb5dfa2 Mon Sep 17 00:00:00 2001 From: Jan Gutsche Date: Sat, 4 Jan 2025 18:37:30 +0000 Subject: [PATCH 15/65] Resolve bitbots_webots_sim warning ``` --- stderr: bitbots_webots_sim CMake Warning at /opt/ros/jazzy/share/gazebo_msgs/cmake/gazebo_msgs-extras.cmake:6 (message): This gazebo_msgs package hosts messages designed initially for Gazebo Classic which is not available on ROS 2 Jazzy which is unavailable on ROS 2 Jazzy. The new Gazebo uses the ros_gz bridge message vailable at:https://github.com/gazebosim/ros_gz/tree/ros2/ros_gz_bridge#bridge-communication-between-ros-and-gazebo To avoid this warning and use this Gazebo Classic messages anyway you can use flag -DIGNORE_GAZEBO_MSGS_WARNING Call Stack (most recent call first): /opt/ros/jazzy/share/gazebo_msgs/cmake/gazebo_msgsConfig.cmake:41 (include) CMakeLists.txt:18 (find_package) ``` --- bitbots_simulation/bitbots_webots_sim/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bitbots_simulation/bitbots_webots_sim/CMakeLists.txt b/bitbots_simulation/bitbots_webots_sim/CMakeLists.txt index 2562bc709..4600ee5c2 100644 --- a/bitbots_simulation/bitbots_webots_sim/CMakeLists.txt +++ b/bitbots_simulation/bitbots_webots_sim/CMakeLists.txt @@ -6,6 +6,8 @@ if(NOT CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 17) endif() +set(IGNORE_GAZEBO_MSGS_WARNING ON) + find_package(bitbots_msgs REQUIRED) find_package(rosgraph_msgs REQUIRED) find_package(std_msgs REQUIRED) From 5a9f7015f84da21d12c17ea3687282ce05d43006 Mon Sep 17 00:00:00 2001 From: Jan Gutsche Date: Sat, 4 Jan 2025 19:37:17 +0000 Subject: [PATCH 16/65] Cleanup --- .gitignore | 4 +--- .vscode/settings.json | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 1d019f1b1..456656d14 100644 --- a/.gitignore +++ b/.gitignore @@ -97,8 +97,6 @@ qtcreator-* # Emacs .#* -# Catkin custom files -CATKIN_IGNORE ### Python template # Byte-compiled / optimized / DLL files __pycache__/ @@ -220,7 +218,7 @@ doku/* # library subdirectories /lib/ -# Path to the protocol buffer definitions, which are a diffrerent repository and managed by vcstool +# Path to the protocol buffer definitions, which are a different repository and managed by vcstool /bitbots_team_communication/bitbots_team_communication/bitbots_team_communication/RobocupProtocol # Protobuf generated file /bitbots_team_communication/bitbots_team_communication/bitbots_team_communication/robocup_extension_pb2.py diff --git a/.vscode/settings.json b/.vscode/settings.json index c2b7564bb..ad9463f11 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -117,6 +117,7 @@ "unpenalize", "unpenalized", "urdf", + "vcstool", "walkready", "wandb", "webots", From 5e1ff700ed4504ba8e0e26f749a917bce56431da Mon Sep 17 00:00:00 2001 From: Jan Gutsche Date: Sat, 4 Jan 2025 19:38:29 +0000 Subject: [PATCH 17/65] Remove unused `realtime_tools` and `control_msgs` dependencies --- bitbots_lowlevel/bitbots_ros_control/CMakeLists.txt | 4 ---- bitbots_lowlevel/bitbots_ros_control/package.xml | 1 - bitbots_motion/bitbots_dynamic_kick/CMakeLists.txt | 4 +--- bitbots_motion/bitbots_dynup/CMakeLists.txt | 3 --- bitbots_motion/bitbots_quintic_walk/CMakeLists.txt | 3 --- 5 files changed, 1 insertion(+), 14 deletions(-) diff --git a/bitbots_lowlevel/bitbots_ros_control/CMakeLists.txt b/bitbots_lowlevel/bitbots_ros_control/CMakeLists.txt index a3fe26da8..ddace516b 100644 --- a/bitbots_lowlevel/bitbots_ros_control/CMakeLists.txt +++ b/bitbots_lowlevel/bitbots_ros_control/CMakeLists.txt @@ -20,7 +20,6 @@ find_package(moveit_core REQUIRED) find_package(moveit_ros_planning REQUIRED) find_package(pluginlib REQUIRED) find_package(rclcpp REQUIRED) -find_package(realtime_tools REQUIRED) find_package(rosidl_typesupport_cpp REQUIRED) find_package(std_msgs REQUIRED) find_package(std_srvs REQUIRED) @@ -66,7 +65,6 @@ ament_target_dependencies( moveit_ros_planning pluginlib rclcpp - realtime_tools rosidl_typesupport_cpp std_msgs std_srvs @@ -89,7 +87,6 @@ ament_target_dependencies( hardware_interface pluginlib rclcpp - realtime_tools rosidl_typesupport_cpp std_msgs std_srvs @@ -107,7 +104,6 @@ ament_export_dependencies(controller_manager) ament_export_dependencies(dynamixel_workbench_toolbox) ament_export_dependencies(hardware_interface) ament_export_dependencies(pluginlib) -ament_export_dependencies(realtime_tools) ament_export_dependencies(std_msgs) ament_export_dependencies(tf2_ros) ament_export_dependencies(transmission_interface) diff --git a/bitbots_lowlevel/bitbots_ros_control/package.xml b/bitbots_lowlevel/bitbots_ros_control/package.xml index 23abbeb60..cefc2a52b 100644 --- a/bitbots_lowlevel/bitbots_ros_control/package.xml +++ b/bitbots_lowlevel/bitbots_ros_control/package.xml @@ -31,7 +31,6 @@ bitbots_tts pluginlib rclcpp - realtime_tools std_msgs system_monitor transmission_interface diff --git a/bitbots_motion/bitbots_dynamic_kick/CMakeLists.txt b/bitbots_motion/bitbots_dynamic_kick/CMakeLists.txt index aa638fc99..98717aa45 100644 --- a/bitbots_motion/bitbots_dynamic_kick/CMakeLists.txt +++ b/bitbots_motion/bitbots_dynamic_kick/CMakeLists.txt @@ -11,7 +11,6 @@ find_package(bitbots_docs REQUIRED) find_package(biped_interfaces REQUIRED) find_package(bitbots_msgs REQUIRED) find_package(bitbots_splines REQUIRED) -find_package(control_msgs REQUIRED) find_package(control_toolbox REQUIRED) find_package(Eigen3 REQUIRED) find_package(geometry_msgs REQUIRED) @@ -48,7 +47,6 @@ ament_target_dependencies( biped_interfaces bitbots_msgs bitbots_splines - control_msgs control_toolbox geometry_msgs moveit_ros_planning_interface @@ -71,7 +69,7 @@ target_link_libraries(KickNode "${cpp_typesupport_target}") # pybind11_add_module(py_dynamic_kick SHARED src/walk_pywrapper.cpp ${SOURCES}) # ament_target_dependencies(py_dynamic_kick PUBLIC ament_cmake biped_interfaces -# bitbots_msgs bitbots_splines control_msgs control_toolbox geometry_msgs +# bitbots_msgs bitbots_splines control_toolbox geometry_msgs # moveit_ros_planning_interface rclcpp ros2_python_extension rot_conv # sensor_msgs std_msgs tf2 tf2_eigen tf2_geometry_msgs tf2_ros) # target_link_libraries(py_dynamic_kick PRIVATE "${cpp_typesupport_target}") diff --git a/bitbots_motion/bitbots_dynup/CMakeLists.txt b/bitbots_motion/bitbots_dynup/CMakeLists.txt index 92d14d9f4..53ad50b19 100644 --- a/bitbots_motion/bitbots_dynup/CMakeLists.txt +++ b/bitbots_motion/bitbots_dynup/CMakeLists.txt @@ -26,7 +26,6 @@ find_package(bio_ik REQUIRED) find_package(bitbots_msgs REQUIRED) find_package(bitbots_splines REQUIRED) find_package(bitbots_utils REQUIRED) -find_package(control_msgs REQUIRED) find_package(control_toolbox REQUIRED) find_package(Eigen3 REQUIRED) find_package(generate_parameter_library REQUIRED) @@ -80,7 +79,6 @@ ament_target_dependencies( bitbots_msgs bitbots_splines bitbots_utils - control_msgs control_toolbox generate_parameter_library geometry_msgs @@ -111,7 +109,6 @@ ament_target_dependencies( bitbots_msgs bitbots_splines bitbots_utils - control_msgs control_toolbox geometry_msgs moveit_ros_planning_interface diff --git a/bitbots_motion/bitbots_quintic_walk/CMakeLists.txt b/bitbots_motion/bitbots_quintic_walk/CMakeLists.txt index b44cae840..84f4a707f 100644 --- a/bitbots_motion/bitbots_quintic_walk/CMakeLists.txt +++ b/bitbots_motion/bitbots_quintic_walk/CMakeLists.txt @@ -25,7 +25,6 @@ find_package(backward_ros REQUIRED) find_package(biped_interfaces REQUIRED) find_package(bitbots_msgs REQUIRED) find_package(bitbots_splines REQUIRED) -find_package(control_msgs REQUIRED) find_package(control_toolbox REQUIRED) find_package(generate_parameter_library REQUIRED) find_package(geometry_msgs REQUIRED) @@ -68,7 +67,6 @@ ament_target_dependencies( biped_interfaces bitbots_msgs bitbots_splines - control_msgs control_toolbox geometry_msgs moveit_ros_planning_interface @@ -97,7 +95,6 @@ ament_target_dependencies( biped_interfaces bitbots_msgs bitbots_splines - control_msgs control_toolbox geometry_msgs moveit_ros_planning_interface From 394c6e09f1c8f24dc1d0df638350511ce8c4f943 Mon Sep 17 00:00:00 2001 From: Jan Gutsche Date: Sat, 4 Jan 2025 22:48:32 +0000 Subject: [PATCH 18/65] Update pre-commit versions --- .github/workflows/pre-commit.yml | 4 ++-- .pre-commit-config.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index bb6848037..bb80c075f 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -7,10 +7,10 @@ on: jobs: pre-commit: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 - name: Install cppcheck run: sudo apt install cppcheck -y - - uses: pre-commit/action@v3.0.0 + - uses: pre-commit/action@v3.0.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 06f738c8b..5aa99cc34 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,7 +27,7 @@ repos: - id: cmake-format - id: cmake-lint - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v5.0.0 hooks: - id: check-merge-conflict - id: check-toml From ac3a4671834e079ed5733e58c3aa592b4ef9d871 Mon Sep 17 00:00:00 2001 From: Jan Gutsche Date: Sat, 4 Jan 2025 22:52:12 +0000 Subject: [PATCH 19/65] Fixes changed headers from the `particle_filter` library --- .../include/bitbots_ros_control/hardware_interface.hpp | 6 +++--- .../bitbots_ros_control/src/pressure_converter.cpp | 3 +-- .../include/bitbots_localization/MotionModel.hpp | 7 +++---- .../include/bitbots_localization/ObservationModel.hpp | 3 +-- .../include/bitbots_localization/Resampling.hpp | 7 +++---- .../include/bitbots_localization/RobotState.hpp | 2 +- .../include/bitbots_localization/StateDistribution.hpp | 5 ++--- .../include/bitbots_localization/localization.hpp | 6 +++--- .../include/bitbots_localization/map.hpp | 2 +- 9 files changed, 18 insertions(+), 23 deletions(-) diff --git a/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/hardware_interface.hpp b/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/hardware_interface.hpp index cc59c3041..499222df5 100644 --- a/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/hardware_interface.hpp +++ b/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/hardware_interface.hpp @@ -12,11 +12,11 @@ class HardwareInterface { public: virtual bool init() = 0; - virtual void read(const rclcpp::Time &t, const rclcpp::Duration &dt){}; + virtual void read(const rclcpp::Time &t, const rclcpp::Duration &dt) {}; - virtual void write(const rclcpp::Time &t, const rclcpp::Duration &dt){}; + virtual void write(const rclcpp::Time &t, const rclcpp::Duration &dt) {}; - virtual void restoreAfterPowerCycle(){}; + virtual void restoreAfterPowerCycle() {}; virtual ~HardwareInterface(){}; }; diff --git a/bitbots_lowlevel/bitbots_ros_control/src/pressure_converter.cpp b/bitbots_lowlevel/bitbots_ros_control/src/pressure_converter.cpp index 7cdc9f597..0dff0ae2e 100644 --- a/bitbots_lowlevel/bitbots_ros_control/src/pressure_converter.cpp +++ b/bitbots_lowlevel/bitbots_ros_control/src/pressure_converter.cpp @@ -76,8 +76,7 @@ PressureConverter::PressureConverter(rclcpp::Node::SharedPtr nh, char side) { } for (int i = 0; i < 4; i++) { std::stringstream single_wrench_frame; - single_wrench_frame << side << "_" - << "cleat_" << wrench_topics[i]; + single_wrench_frame << side << "_" << "cleat_" << wrench_topics[i]; wrench_frames_.push_back(single_wrench_frame.str()); } diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/MotionModel.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/MotionModel.hpp index d767c4edc..b91480c6f 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/MotionModel.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/MotionModel.hpp @@ -5,14 +5,13 @@ #ifndef BITBOTS_LOCALIZATION_MOTIONMODEL_H #define BITBOTS_LOCALIZATION_MOTIONMODEL_H -#include -#include - #include #include #include #include #include +#include +#include namespace bitbots_localization { /** @@ -61,5 +60,5 @@ class RobotMotionModel : public particle_filter::MovementModel { double sample(double b) const; }; -}; // namespace bitbots_localization +}; // namespace bitbots_localization #endif // BITBOTS_LOCALIZATION_MOTIONMODEL_H diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/ObservationModel.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/ObservationModel.hpp index 0819c2e19..50631ad56 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/ObservationModel.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/ObservationModel.hpp @@ -5,12 +5,11 @@ #ifndef BITBOTS_LOCALIZATION_OBSERVATIONMODEL_H #define BITBOTS_LOCALIZATION_OBSERVATIONMODEL_H -#include - #include #include #include #include +#include #include #include #include diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/Resampling.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/Resampling.hpp index b52b03e98..2b3d6e554 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/Resampling.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/Resampling.hpp @@ -5,10 +5,9 @@ #ifndef IMPORTANCERESAMPLINGWE_H #define IMPORTANCERESAMPLINGWE_H -#include -#include - #include +#include +#include namespace bitbots_localization { // ImportanceResampling with explorers @@ -97,5 +96,5 @@ void ImportanceResamplingWE::resample(const ParticleList &sourceList, // template // void ParticleFilter::drawAllFromDistribution(const // std::shared_ptr>& distribution) { -}; // namespace bitbots_localization +}; // namespace bitbots_localization #endif // IMPORTANCERESAMPLINGWE_H diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/RobotState.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/RobotState.hpp index aaab084fb..6595a42ac 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/RobotState.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/RobotState.hpp @@ -5,12 +5,12 @@ #ifndef BITBOTS_LOCALIZATION_ROBOTSTATE_H #define BITBOTS_LOCALIZATION_ROBOTSTATE_H -#include #include #include #include #include +#include #include namespace bitbots_localization { diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/StateDistribution.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/StateDistribution.hpp index ca564ad80..8e5b9b02a 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/StateDistribution.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/StateDistribution.hpp @@ -5,10 +5,9 @@ #ifndef BITBOTS_LOCALIZATION_STATEDISTRIBUTION_H #define BITBOTS_LOCALIZATION_STATEDISTRIBUTION_H -#include -#include - #include +#include +#include #include #include diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/localization.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/localization.hpp index 819187560..6c00a434d 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/localization.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/localization.hpp @@ -6,9 +6,6 @@ #define BITBOTS_LOCALIZATION_LOCALIZATION_H #include -#include -#include -#include #include #include #include @@ -45,6 +42,9 @@ #include #include #include +#include +#include +#include #include #include #include diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/map.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/map.hpp index 5acb8e9a5..44839346d 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/map.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/map.hpp @@ -53,5 +53,5 @@ class Map { private: double out_of_map_value_; }; -}; // namespace bitbots_localization +}; // namespace bitbots_localization #endif // BITBOTS_LOCALIZATION_MAP_H From 630b313ba202cadc63153cacec61d9e1341fb19d Mon Sep 17 00:00:00 2001 From: Jan Gutsche Date: Sat, 4 Jan 2025 23:30:32 +0000 Subject: [PATCH 20/65] hcm: Fix compile warning: ``` CMake Warning (dev) at CMakeLists.txt:15 (find_package): Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules are removed. Run "cmake --help-policy CMP0148" for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it. ``` --- bitbots_motion/bitbots_hcm/CMakeLists.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bitbots_motion/bitbots_hcm/CMakeLists.txt b/bitbots_motion/bitbots_hcm/CMakeLists.txt index 9e427ccae..2c24196eb 100644 --- a/bitbots_motion/bitbots_hcm/CMakeLists.txt +++ b/bitbots_motion/bitbots_hcm/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.12) project(bitbots_hcm) set(PYBIND11_PYTHON_VERSION 3) @@ -11,8 +11,7 @@ find_package(bitbots_msgs REQUIRED) find_package(builtin_interfaces REQUIRED) find_package(geometry_msgs REQUIRED) find_package(pybind11 REQUIRED) -find_package(Python3 REQUIRED) -find_package(PythonLibs REQUIRED) +find_package(Python3 REQUIRED COMPONENTS Interpreter Development) find_package(rclpy REQUIRED) find_package(ros2_python_extension REQUIRED) find_package(sensor_msgs REQUIRED) @@ -39,7 +38,7 @@ ament_target_dependencies( sensor_msgs std_msgs) -target_link_libraries(HCM ${PYTHON_LIBRARIES}) +target_link_libraries(HCM Python3::Python) enable_bitbots_docs() From acab50ee7f8489ae06ac46c2b03ff2cd8ceb03fc Mon Sep 17 00:00:00 2001 From: Jan Gutsche Date: Sat, 4 Jan 2025 23:32:53 +0000 Subject: [PATCH 21/65] Reformatting --- .../include/bitbots_ros_control/hardware_interface.hpp | 6 +++--- .../bitbots_ros_control/src/pressure_converter.cpp | 3 +-- .../include/bitbots_localization/MotionModel.hpp | 2 +- .../include/bitbots_localization/Resampling.hpp | 2 +- .../include/bitbots_localization/map.hpp | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/hardware_interface.hpp b/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/hardware_interface.hpp index cc59c3041..499222df5 100644 --- a/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/hardware_interface.hpp +++ b/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/hardware_interface.hpp @@ -12,11 +12,11 @@ class HardwareInterface { public: virtual bool init() = 0; - virtual void read(const rclcpp::Time &t, const rclcpp::Duration &dt){}; + virtual void read(const rclcpp::Time &t, const rclcpp::Duration &dt) {}; - virtual void write(const rclcpp::Time &t, const rclcpp::Duration &dt){}; + virtual void write(const rclcpp::Time &t, const rclcpp::Duration &dt) {}; - virtual void restoreAfterPowerCycle(){}; + virtual void restoreAfterPowerCycle() {}; virtual ~HardwareInterface(){}; }; diff --git a/bitbots_lowlevel/bitbots_ros_control/src/pressure_converter.cpp b/bitbots_lowlevel/bitbots_ros_control/src/pressure_converter.cpp index 7cdc9f597..0dff0ae2e 100644 --- a/bitbots_lowlevel/bitbots_ros_control/src/pressure_converter.cpp +++ b/bitbots_lowlevel/bitbots_ros_control/src/pressure_converter.cpp @@ -76,8 +76,7 @@ PressureConverter::PressureConverter(rclcpp::Node::SharedPtr nh, char side) { } for (int i = 0; i < 4; i++) { std::stringstream single_wrench_frame; - single_wrench_frame << side << "_" - << "cleat_" << wrench_topics[i]; + single_wrench_frame << side << "_" << "cleat_" << wrench_topics[i]; wrench_frames_.push_back(single_wrench_frame.str()); } diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/MotionModel.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/MotionModel.hpp index d767c4edc..0c26f5139 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/MotionModel.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/MotionModel.hpp @@ -61,5 +61,5 @@ class RobotMotionModel : public particle_filter::MovementModel { double sample(double b) const; }; -}; // namespace bitbots_localization +}; // namespace bitbots_localization #endif // BITBOTS_LOCALIZATION_MOTIONMODEL_H diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/Resampling.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/Resampling.hpp index b52b03e98..5fa085c8e 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/Resampling.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/Resampling.hpp @@ -97,5 +97,5 @@ void ImportanceResamplingWE::resample(const ParticleList &sourceList, // template // void ParticleFilter::drawAllFromDistribution(const // std::shared_ptr>& distribution) { -}; // namespace bitbots_localization +}; // namespace bitbots_localization #endif // IMPORTANCERESAMPLINGWE_H diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/map.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/map.hpp index 5acb8e9a5..44839346d 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/map.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/map.hpp @@ -53,5 +53,5 @@ class Map { private: double out_of_map_value_; }; -}; // namespace bitbots_localization +}; // namespace bitbots_localization #endif // BITBOTS_LOCALIZATION_MAP_H From 65d0099c4944a88e53ca3a76cb857602c2ee21c9 Mon Sep 17 00:00:00 2001 From: Jan Gutsche Date: Sun, 5 Jan 2025 14:25:01 +0000 Subject: [PATCH 22/65] TMP: Turn off warnings as errors --- bitbots_motion/bitbots_dynamic_kick/CMakeLists.txt | 2 +- bitbots_motion/bitbots_dynup/CMakeLists.txt | 2 +- bitbots_motion/bitbots_quintic_walk/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bitbots_motion/bitbots_dynamic_kick/CMakeLists.txt b/bitbots_motion/bitbots_dynamic_kick/CMakeLists.txt index 98717aa45..2abd77f49 100644 --- a/bitbots_motion/bitbots_dynamic_kick/CMakeLists.txt +++ b/bitbots_motion/bitbots_dynamic_kick/CMakeLists.txt @@ -34,7 +34,7 @@ rosidl_generate_interfaces(${PROJECT_NAME} "msg/KickDebug.msg" DEPENDENCIES set(INCLUDE_DIRS include ${PYTHON_INCLUDE_DIRS}) include_directories(${INCLUDE_DIRS}) -add_compile_options(-Wall -Werror -Wno-unused) +add_compile_options(-Wall -Wno-unused) set(SOURCES src/kick_node.cpp src/kick_engine.cpp src/stabilizer.cpp src/visualizer.cpp src/kick_ik.cpp) diff --git a/bitbots_motion/bitbots_dynup/CMakeLists.txt b/bitbots_motion/bitbots_dynup/CMakeLists.txt index 53ad50b19..86939496c 100644 --- a/bitbots_motion/bitbots_dynup/CMakeLists.txt +++ b/bitbots_motion/bitbots_dynup/CMakeLists.txt @@ -59,7 +59,7 @@ rosidl_generate_interfaces( include_directories(include ${PYTHON_INCLUDE_DIRS}) -add_compile_options(-Wall -Werror -Wno-unused -fPIC) +add_compile_options(-Wall -Wno-unused -fPIC) set(SOURCES src/dynup_engine.cpp diff --git a/bitbots_motion/bitbots_quintic_walk/CMakeLists.txt b/bitbots_motion/bitbots_quintic_walk/CMakeLists.txt index 84f4a707f..eb0f003e7 100644 --- a/bitbots_motion/bitbots_quintic_walk/CMakeLists.txt +++ b/bitbots_motion/bitbots_quintic_walk/CMakeLists.txt @@ -53,7 +53,7 @@ rosidl_generate_interfaces( include_directories(include ${PYTHON_INCLUDE_DIRS}) -add_compile_options(-Wall -Werror -Wno-unused -Wextra -Wpedantic) +add_compile_options(-Wall -Wno-unused -Wextra -Wpedantic) set(SOURCES src/walk_visualizer.cpp src/walk_engine.cpp src/walk_stabilizer.cpp src/walk_ik.cpp src/walk_node.cpp) From 109a8e10eb5c65bdfa1965c51df8f9fbf11d73ec Mon Sep 17 00:00:00 2001 From: Jan Gutsche Date: Sun, 5 Jan 2025 14:31:28 +0000 Subject: [PATCH 23/65] Replace imu_tools lib --- bitbots_lowlevel/bitbots_ros_control/package.xml | 1 + sync_includes_wolfgang_nuc.yaml | 1 - workspace.repos | 4 ---- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/bitbots_lowlevel/bitbots_ros_control/package.xml b/bitbots_lowlevel/bitbots_ros_control/package.xml index cefc2a52b..ac969f877 100644 --- a/bitbots_lowlevel/bitbots_ros_control/package.xml +++ b/bitbots_lowlevel/bitbots_ros_control/package.xml @@ -37,6 +37,7 @@ yaml-cpp imu_complementary_filter + rviz_imu_plugin diff --git a/sync_includes_wolfgang_nuc.yaml b/sync_includes_wolfgang_nuc.yaml index d3b11f678..b07e22d3f 100644 --- a/sync_includes_wolfgang_nuc.yaml +++ b/sync_includes_wolfgang_nuc.yaml @@ -58,7 +58,6 @@ include: - game_controller_hl - game_controller_hl_interfaces - humanoid_base_footprint - - imu_tools - ipm - particle_filter - ros2_numpy diff --git a/workspace.repos b/workspace.repos index 016250be6..8fdcc13fe 100644 --- a/workspace.repos +++ b/workspace.repos @@ -51,10 +51,6 @@ repositories: type: git url: git@github.com:ros-sports/humanoid_base_footprint.git version: master - lib/imu_tools: - type: git - url: git@github.com:ccny-ros-pkg/imu_tools.git - version: rolling lib/ipm: type: git url: git@github.com:ros-sports/ipm.git From 5faea533d14f7e48de86129a0c0a5002a62cf66e Mon Sep 17 00:00:00 2001 From: Jan Gutsche Date: Sun, 5 Jan 2025 14:34:25 +0000 Subject: [PATCH 24/65] sort workspace.repos --- workspace.repos | 60 ++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/workspace.repos b/workspace.repos index 8fdcc13fe..0a36b7d8c 100644 --- a/workspace.repos +++ b/workspace.repos @@ -3,18 +3,26 @@ repositories: type: git url: git@github.com:bit-bots/RobocupProtocol.git version: master - lib/dynamic_stack_decider: + lib/audio_common: type: git - url: git@github.com:bit-bots/dynamic_stack_decider.git - version: master - lib/udp_bridge: + url: git@github.com:bit-bots/audio_common.git + version: ros2 + lib/bio_ik: type: git - url: git@github.com:bit-bots/udp_bridge.git - version: master + url: git@github.com:bit-bots/bio_ik.git + version: ros2 lib/bio_ik_msgs: type: git url: git@github.com:bit-bots/bio_ik_msgs.git version: master + lib/biped_interfaces: + type: git + url: git@github.com:ros-sports/biped_interfaces.git + version: rolling + lib/dynamic_stack_decider: + type: git + url: git@github.com:bit-bots/dynamic_stack_decider.git + version: master lib/DynamixelSDK: type: git url: git@github.com:bit-bots/DynamixelSDK.git @@ -23,26 +31,10 @@ repositories: type: git url: git@github.com:bit-bots/dynamixel-workbench.git version: master - lib/particle_filter: - type: git - url: git@github.com:bit-bots/particle_filter.git - version: master - lib/ros2_python_extension: - type: git - url: git@github.com:bit-bots/ros2_python_extension.git - version: main - lib/audio_common: - type: git - url: git@github.com:bit-bots/audio_common.git - version: ros2 - lib/biped_interfaces: + lib/game_controller_hl: type: git - url: git@github.com:ros-sports/biped_interfaces.git + url: git@github.com:ros-sports/game_controller_hl.git version: rolling - lib/bio_ik: - type: git - url: git@github.com:bit-bots/bio_ik.git - version: ros2 lib/hlvs_player: type: git url: git@github.com:ros-sports/hlvs_player.git @@ -55,19 +47,27 @@ repositories: type: git url: git@github.com:ros-sports/ipm.git version: rolling + lib/particle_filter: + type: git + url: git@github.com:bit-bots/particle_filter.git + version: master lib/ros2_numpy: type: git - url: git@github.com:Bit-Bots/ros2_numpy.git + url: git@github.com:bit-bots/ros2_numpy.git version: rolling - lib/soccer_ipm: + lib/ros2_python_extension: type: git - url: git@github.com:ros-sports/soccer_ipm.git - version: rolling + url: git@github.com:bit-bots/ros2_python_extension.git + version: main lib/soccer_field_map_generator: type: git url: git@github.com:ros-sports/soccer_field_map_generator.git version: rolling - lib/game_controller_hl: + lib/soccer_ipm: type: git - url: git@github.com:ros-sports/game_controller_hl.git + url: git@github.com:ros-sports/soccer_ipm.git version: rolling + lib/udp_bridge: + type: git + url: git@github.com:bit-bots/udp_bridge.git + version: master From c8f304f82eac79e4c4e1c7eefd8c03d77cf56259 Mon Sep 17 00:00:00 2001 From: Jan Gutsche Date: Sun, 5 Jan 2025 15:29:42 +0000 Subject: [PATCH 25/65] Migrate header .h to .hpp (where available) --- .../src/dynamixel_servo_hardware_interface.cpp | 4 ++-- .../src/extrinsic_calibration.cpp | 2 +- .../include/bitbots_dynamic_kick/kick_engine.hpp | 6 +++--- .../include/bitbots_dynamic_kick/kick_ik.hpp | 4 ++-- .../include/bitbots_dynamic_kick/kick_node.hpp | 2 +- .../bitbots_dynamic_kick/kick_pywrapper.hpp | 2 +- .../include/bitbots_dynamic_kick/stabilizer.hpp | 2 +- .../include/bitbots_dynamic_kick/visualizer.hpp | 6 +++--- .../include/bitbots_dynup/dynup_engine.hpp | 2 +- .../include/bitbots_dynup/dynup_ik.hpp | 8 ++++---- .../include/bitbots_dynup/dynup_node.hpp | 14 +++++++------- .../include/bitbots_dynup/dynup_utils.hpp | 2 +- .../include/bitbots_dynup/visualizer.hpp | 6 +++--- .../bitbots_head_mover/src/move_head.cpp | 12 ++++++------ .../src/bitbots_moveit_bindings.cpp | 12 ++++++------ .../include/bitbots_quintic_walk/walk_engine.hpp | 4 ++-- .../include/bitbots_quintic_walk/walk_ik.hpp | 2 +- .../include/bitbots_quintic_walk/walk_node.hpp | 14 +++++++------- .../bitbots_quintic_walk/walk_visualizer.hpp | 10 +++++----- .../include/bitbots_splines/abstract_ik.hpp | 2 +- .../bitbots_splines/abstract_visualizer.hpp | 2 +- .../include/bitbots_splines/pose_spline.hpp | 6 +++--- .../include/bitbots_splines/position_spline.hpp | 2 +- .../include/bitbots_localization/RobotState.hpp | 2 +- .../include/bitbots_localization/localization.hpp | 10 +++++----- .../include/bitbots_odometry/motion_odometry.hpp | 2 +- .../bitbots_odometry/src/odometry_fuser.cpp | 10 +++++----- 27 files changed, 75 insertions(+), 75 deletions(-) diff --git a/bitbots_lowlevel/bitbots_ros_control/src/dynamixel_servo_hardware_interface.cpp b/bitbots_lowlevel/bitbots_ros_control/src/dynamixel_servo_hardware_interface.cpp index 57c1cf389..e6744fbc6 100644 --- a/bitbots_lowlevel/bitbots_ros_control/src/dynamixel_servo_hardware_interface.cpp +++ b/bitbots_lowlevel/bitbots_ros_control/src/dynamixel_servo_hardware_interface.cpp @@ -1,5 +1,5 @@ -#include -#include +#include +#include #include #include diff --git a/bitbots_misc/bitbots_extrinsic_calibration/src/extrinsic_calibration.cpp b/bitbots_misc/bitbots_extrinsic_calibration/src/extrinsic_calibration.cpp index 1530622d4..91a575737 100644 --- a/bitbots_misc/bitbots_extrinsic_calibration/src/extrinsic_calibration.cpp +++ b/bitbots_misc/bitbots_extrinsic_calibration/src/extrinsic_calibration.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include diff --git a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_engine.hpp b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_engine.hpp index b9d9c1e50..b5aa8d0b3 100644 --- a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_engine.hpp +++ b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_engine.hpp @@ -2,9 +2,9 @@ #define BITBOTS_DYNAMIC_KICK_INCLUDE_BITBOTS_DYNAMIC_KICK_KICK_ENGINE_H_ #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_ik.hpp b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_ik.hpp index 1b999222c..25c89adfa 100644 --- a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_ik.hpp +++ b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_ik.hpp @@ -1,8 +1,8 @@ #ifndef BITBOTS_DYNAMIC_KICK_INCLUDE_BITBOTS_DYNAMIC_KICK_KICK_IK_H_ #define BITBOTS_DYNAMIC_KICK_INCLUDE_BITBOTS_DYNAMIC_KICK_KICK_IK_H_ -#include -#include +#include +#include #include #include diff --git a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_node.hpp b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_node.hpp index 926c23a90..783adc62c 100644 --- a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_node.hpp +++ b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_node.hpp @@ -1,7 +1,7 @@ #ifndef BITBOTS_DYNAMIC_KICK_INCLUDE_BITBOTS_DYNAMIC_KICK_KICK_NODE_H_ #define BITBOTS_DYNAMIC_KICK_INCLUDE_BITBOTS_DYNAMIC_KICK_KICK_NODE_H_ -#include +#include #include #include diff --git a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_pywrapper.hpp b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_pywrapper.hpp index 5336cb7b5..bb7ec4de7 100644 --- a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_pywrapper.hpp +++ b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_pywrapper.hpp @@ -2,7 +2,7 @@ #define BITBOTS_DYNAMIC_KICK_INCLUDE_BITBOTS_DYNAMIC_KICK_KICK_PYWRAPPER_H_ #include -#include +#include #include #include diff --git a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/stabilizer.hpp b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/stabilizer.hpp index 2878dc286..86eb4ba2b 100644 --- a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/stabilizer.hpp +++ b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/stabilizer.hpp @@ -1,7 +1,7 @@ #ifndef BITBOTS_DYNAMIC_KICK_INCLUDE_BITBOTS_DYNAMIC_KICK_STABILIZER_H_ #define BITBOTS_DYNAMIC_KICK_INCLUDE_BITBOTS_DYNAMIC_KICK_STABILIZER_H_ -#include +#include #include #include diff --git a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/visualizer.hpp b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/visualizer.hpp index 5471d9b91..9813916a0 100644 --- a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/visualizer.hpp +++ b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/visualizer.hpp @@ -5,9 +5,9 @@ #ifndef BITBOTS_DYNAMIC_KICK_INCLUDE_BITBOTS_DYNAMIC_KICK_VISUALIZER_H_ #define BITBOTS_DYNAMIC_KICK_INCLUDE_BITBOTS_DYNAMIC_KICK_VISUALIZER_H_ -#include -#include -#include +#include +#include +#include #include #include diff --git a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_engine.hpp b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_engine.hpp index a2f05f9b3..7fd41039a 100644 --- a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_engine.hpp +++ b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_engine.hpp @@ -1,7 +1,7 @@ #ifndef BITBOTS_DYNUP_INCLUDE_BITBOTS_DYNUP_DYNUP_ENGINE_H_ #define BITBOTS_DYNUP_INCLUDE_BITBOTS_DYNUP_DYNUP_ENGINE_H_ -#include +#include #include #include diff --git a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_ik.hpp b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_ik.hpp index 31774ebc8..82166149d 100644 --- a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_ik.hpp +++ b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_ik.hpp @@ -1,10 +1,10 @@ #ifndef BITBOTS_DYNUP_INCLUDE_BITBOTS_DYNUP_DYNUP_IK_H_ #define BITBOTS_DYNUP_INCLUDE_BITBOTS_DYNUP_DYNUP_IK_H_ -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_node.hpp b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_node.hpp index 2ea86bdcf..eafedf64a 100644 --- a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_node.hpp +++ b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_node.hpp @@ -1,13 +1,13 @@ #ifndef BITBOTS_DYNUP_INCLUDE_BITBOTS_DYNUP_DYNUP_NODE_H_ #define BITBOTS_DYNUP_INCLUDE_BITBOTS_DYNUP_DYNUP_NODE_H_ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_utils.hpp b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_utils.hpp index 595c6568c..5b6888657 100644 --- a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_utils.hpp +++ b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_utils.hpp @@ -1,7 +1,7 @@ #ifndef BITBOTS_DYNUP_INCLUDE_BITBOTS_DYNUP_DYNUP_UTILS_H_ #define BITBOTS_DYNUP_INCLUDE_BITBOTS_DYNUP_DYNUP_UTILS_H_ -#include +#include #include #include diff --git a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/visualizer.hpp b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/visualizer.hpp index 621c0a7cb..7513d00e7 100644 --- a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/visualizer.hpp +++ b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/visualizer.hpp @@ -1,9 +1,9 @@ #ifndef BITBOTS_DYNUP_INCLUDE_BITBOTS_DYNUP_VISUALIZER_H_ #define BITBOTS_DYNUP_INCLUDE_BITBOTS_DYNUP_VISUALIZER_H_ -#include -#include -#include +#include +#include +#include #include #include diff --git a/bitbots_motion/bitbots_head_mover/src/move_head.cpp b/bitbots_motion/bitbots_head_mover/src/move_head.cpp index c28bda1f5..8f70a2cfd 100644 --- a/bitbots_motion/bitbots_head_mover/src/move_head.cpp +++ b/bitbots_motion/bitbots_head_mover/src/move_head.cpp @@ -1,9 +1,9 @@ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/bitbots_motion/bitbots_moveit_bindings/src/bitbots_moveit_bindings.cpp b/bitbots_motion/bitbots_moveit_bindings/src/bitbots_moveit_bindings.cpp index c467a2467..a7282de23 100644 --- a/bitbots_motion/bitbots_moveit_bindings/src/bitbots_moveit_bindings.cpp +++ b/bitbots_motion/bitbots_moveit_bindings/src/bitbots_moveit_bindings.cpp @@ -1,11 +1,11 @@ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include -#include +#include #include #include diff --git a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_engine.hpp b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_engine.hpp index 064209cde..bfe40d6f3 100644 --- a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_engine.hpp +++ b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_engine.hpp @@ -6,8 +6,8 @@ The original files can be found at: #ifndef BITBOTS_QUINTIC_WALK_INCLUDE_BITBOTS_QUINTIC_WALK_WALK_ENGINE_H_ #define BITBOTS_QUINTIC_WALK_INCLUDE_BITBOTS_QUINTIC_WALK_WALK_ENGINE_H_ -#include -#include +#include +#include #include #include diff --git a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_ik.hpp b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_ik.hpp index a64dd3113..2c1e6c28d 100644 --- a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_ik.hpp +++ b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_ik.hpp @@ -1,6 +1,6 @@ #ifndef BITBOTS_QUINTIC_WALK_INCLUDE_BITBOTS_QUINTIC_WALK_WALK_IK_H_ #define BITBOTS_QUINTIC_WALK_INCLUDE_BITBOTS_QUINTIC_WALK_WALK_IK_H_ -#include +#include #include #include diff --git a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_node.hpp b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_node.hpp index 62040bb1c..12a477cb2 100644 --- a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_node.hpp +++ b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_node.hpp @@ -6,13 +6,13 @@ The original files can be found at: #ifndef BITBOTS_QUINTIC_WALK_INCLUDE_BITBOTS_QUINTIC_WALK_WALK_NODE_H_ #define BITBOTS_QUINTIC_WALK_INCLUDE_BITBOTS_QUINTIC_WALK_WALK_NODE_H_ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_visualizer.hpp b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_visualizer.hpp index 55dff00cb..bce3da1c4 100644 --- a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_visualizer.hpp +++ b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_visualizer.hpp @@ -1,11 +1,11 @@ #ifndef BITBOTS_QUINTIC_WALK_INCLUDE_BITBOTS_QUINTIC_WALK_WALK_VISUALIZER_H_ #define BITBOTS_QUINTIC_WALK_INCLUDE_BITBOTS_QUINTIC_WALK_WALK_VISUALIZER_H_ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include diff --git a/bitbots_motion/bitbots_splines/include/bitbots_splines/abstract_ik.hpp b/bitbots_motion/bitbots_splines/include/bitbots_splines/abstract_ik.hpp index 3be7d2bed..40994a6e7 100644 --- a/bitbots_motion/bitbots_splines/include/bitbots_splines/abstract_ik.hpp +++ b/bitbots_motion/bitbots_splines/include/bitbots_splines/abstract_ik.hpp @@ -2,7 +2,7 @@ #ifndef BITBOTS_SPLINES_INCLUDE_BITBOTS_SPLINES_ABSTRACT_IK_H_ #define BITBOTS_SPLINES_INCLUDE_BITBOTS_SPLINES_ABSTRACT_IK_H_ -#include +#include #include #include diff --git a/bitbots_motion/bitbots_splines/include/bitbots_splines/abstract_visualizer.hpp b/bitbots_motion/bitbots_splines/include/bitbots_splines/abstract_visualizer.hpp index 0a64c73fc..a82d0cf43 100644 --- a/bitbots_motion/bitbots_splines/include/bitbots_splines/abstract_visualizer.hpp +++ b/bitbots_motion/bitbots_splines/include/bitbots_splines/abstract_visualizer.hpp @@ -1,7 +1,7 @@ #ifndef BITBOTS_SPLINES_INCLUDE_BITBOTS_SPLINES_ABSTRACT_VISUALIZER_H_ #define BITBOTS_SPLINES_INCLUDE_BITBOTS_SPLINES_ABSTRACT_VISUALIZER_H_ -#include +#include #include #include diff --git a/bitbots_motion/bitbots_splines/include/bitbots_splines/pose_spline.hpp b/bitbots_motion/bitbots_splines/include/bitbots_splines/pose_spline.hpp index 3056d72b5..3f3f42aa1 100644 --- a/bitbots_motion/bitbots_splines/include/bitbots_splines/pose_spline.hpp +++ b/bitbots_motion/bitbots_splines/include/bitbots_splines/pose_spline.hpp @@ -1,9 +1,9 @@ #ifndef BITBOTS_SPLINES_INCLUDE_BITBOTS_SPLINES_POSE_SPLINE_H_ #define BITBOTS_SPLINES_INCLUDE_BITBOTS_SPLINES_POSE_SPLINE_H_ -#include -#include -#include +#include +#include +#include #include #include diff --git a/bitbots_motion/bitbots_splines/include/bitbots_splines/position_spline.hpp b/bitbots_motion/bitbots_splines/include/bitbots_splines/position_spline.hpp index 73a04587d..3c85e9a1a 100644 --- a/bitbots_motion/bitbots_splines/include/bitbots_splines/position_spline.hpp +++ b/bitbots_motion/bitbots_splines/include/bitbots_splines/position_spline.hpp @@ -1,7 +1,7 @@ #ifndef BITBOTS_SPLINES_INCLUDE_BITBOTS_SPLINES_POSITION_SPLINE_H_ #define BITBOTS_SPLINES_INCLUDE_BITBOTS_SPLINES_POSITION_SPLINE_H_ -#include +#include #include #include diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/RobotState.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/RobotState.hpp index 6595a42ac..3b260f60e 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/RobotState.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/RobotState.hpp @@ -5,7 +5,7 @@ #ifndef BITBOTS_LOCALIZATION_ROBOTSTATE_H #define BITBOTS_LOCALIZATION_ROBOTSTATE_H -#include +#include #include #include diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/localization.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/localization.hpp index 6c00a434d..84e359882 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/localization.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/localization.hpp @@ -6,11 +6,11 @@ #define BITBOTS_LOCALIZATION_LOCALIZATION_H #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include diff --git a/bitbots_navigation/bitbots_odometry/include/bitbots_odometry/motion_odometry.hpp b/bitbots_navigation/bitbots_odometry/include/bitbots_odometry/motion_odometry.hpp index e0b3fffc5..b25a4a931 100644 --- a/bitbots_navigation/bitbots_odometry/include/bitbots_odometry/motion_odometry.hpp +++ b/bitbots_navigation/bitbots_odometry/include/bitbots_odometry/motion_odometry.hpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/bitbots_navigation/bitbots_odometry/src/odometry_fuser.cpp b/bitbots_navigation/bitbots_odometry/src/odometry_fuser.cpp index 48d85f40b..0b80666ee 100644 --- a/bitbots_navigation/bitbots_odometry/src/odometry_fuser.cpp +++ b/bitbots_navigation/bitbots_odometry/src/odometry_fuser.cpp @@ -12,11 +12,11 @@ imu (rX, rY) #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include From cd3280273363807e1b5df2ade0138d48178cb06b Mon Sep 17 00:00:00 2001 From: Jan Gutsche Date: Sun, 5 Jan 2025 15:32:06 +0000 Subject: [PATCH 26/65] Apply formatting --- .../src/dynamixel_servo_hardware_interface.cpp | 5 ++--- .../src/extrinsic_calibration.cpp | 2 +- .../include/bitbots_dynamic_kick/kick_engine.hpp | 6 +++--- .../include/bitbots_dynamic_kick/kick_ik.hpp | 5 ++--- .../include/bitbots_dynamic_kick/kick_node.hpp | 2 +- .../bitbots_dynamic_kick/kick_pywrapper.hpp | 2 +- .../include/bitbots_dynamic_kick/stabilizer.hpp | 2 +- .../include/bitbots_dynamic_kick/visualizer.hpp | 7 +++---- .../include/bitbots_dynup/dynup_engine.hpp | 3 +-- .../include/bitbots_dynup/dynup_ik.hpp | 7 +++---- .../include/bitbots_dynup/dynup_node.hpp | 14 +++++++------- .../include/bitbots_dynup/dynup_utils.hpp | 3 +-- .../include/bitbots_dynup/visualizer.hpp | 7 +++---- .../bitbots_head_mover/src/move_head.cpp | 12 ++++++------ .../src/bitbots_moveit_bindings.cpp | 12 ++++++------ .../include/bitbots_quintic_walk/walk_engine.hpp | 5 ++--- .../include/bitbots_quintic_walk/walk_ik.hpp | 3 +-- .../include/bitbots_quintic_walk/walk_node.hpp | 14 +++++++------- .../bitbots_quintic_walk/walk_visualizer.hpp | 11 +++++------ .../include/bitbots_splines/abstract_ik.hpp | 1 - .../bitbots_splines/abstract_visualizer.hpp | 3 +-- .../include/bitbots_splines/pose_spline.hpp | 7 +++---- .../include/bitbots_splines/position_spline.hpp | 3 +-- .../include/bitbots_localization/RobotState.hpp | 3 +-- .../include/bitbots_localization/localization.hpp | 10 +++++----- .../include/bitbots_odometry/motion_odometry.hpp | 2 +- .../bitbots_odometry/src/odometry_fuser.cpp | 10 +++++----- 27 files changed, 73 insertions(+), 88 deletions(-) diff --git a/bitbots_lowlevel/bitbots_ros_control/src/dynamixel_servo_hardware_interface.cpp b/bitbots_lowlevel/bitbots_ros_control/src/dynamixel_servo_hardware_interface.cpp index e6744fbc6..81371b754 100644 --- a/bitbots_lowlevel/bitbots_ros_control/src/dynamixel_servo_hardware_interface.cpp +++ b/bitbots_lowlevel/bitbots_ros_control/src/dynamixel_servo_hardware_interface.cpp @@ -1,8 +1,7 @@ -#include -#include - #include #include +#include +#include #include namespace bitbots_ros_control { diff --git a/bitbots_misc/bitbots_extrinsic_calibration/src/extrinsic_calibration.cpp b/bitbots_misc/bitbots_extrinsic_calibration/src/extrinsic_calibration.cpp index 91a575737..ba668a025 100644 --- a/bitbots_misc/bitbots_extrinsic_calibration/src/extrinsic_calibration.cpp +++ b/bitbots_misc/bitbots_extrinsic_calibration/src/extrinsic_calibration.cpp @@ -1,5 +1,4 @@ #include -#include #include #include @@ -7,6 +6,7 @@ #include #include #include +#include #include using std::placeholders::_1; diff --git a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_engine.hpp b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_engine.hpp index b5aa8d0b3..87dd56cd4 100644 --- a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_engine.hpp +++ b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_engine.hpp @@ -2,9 +2,6 @@ #define BITBOTS_DYNAMIC_KICK_INCLUDE_BITBOTS_DYNAMIC_KICK_KICK_ENGINE_H_ #include -#include -#include -#include #include #include @@ -13,6 +10,9 @@ #include #include #include +#include +#include +#include #include #include diff --git a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_ik.hpp b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_ik.hpp index 25c89adfa..1cd86bacc 100644 --- a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_ik.hpp +++ b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_ik.hpp @@ -1,12 +1,11 @@ #ifndef BITBOTS_DYNAMIC_KICK_INCLUDE_BITBOTS_DYNAMIC_KICK_KICK_IK_H_ #define BITBOTS_DYNAMIC_KICK_INCLUDE_BITBOTS_DYNAMIC_KICK_KICK_IK_H_ -#include -#include - #include #include #include +#include +#include namespace bitbots_dynamic_kick { diff --git a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_node.hpp b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_node.hpp index 783adc62c..70214945c 100644 --- a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_node.hpp +++ b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_node.hpp @@ -1,7 +1,6 @@ #ifndef BITBOTS_DYNAMIC_KICK_INCLUDE_BITBOTS_DYNAMIC_KICK_KICK_NODE_H_ #define BITBOTS_DYNAMIC_KICK_INCLUDE_BITBOTS_DYNAMIC_KICK_KICK_NODE_H_ -#include #include #include @@ -20,6 +19,7 @@ #include #include #include +#include #include namespace bitbots_dynamic_kick { diff --git a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_pywrapper.hpp b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_pywrapper.hpp index bb7ec4de7..1cc5083a3 100644 --- a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_pywrapper.hpp +++ b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/kick_pywrapper.hpp @@ -2,13 +2,13 @@ #define BITBOTS_DYNAMIC_KICK_INCLUDE_BITBOTS_DYNAMIC_KICK_KICK_PYWRAPPER_H_ #include -#include #include #include #include #include #include +#include #include #include diff --git a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/stabilizer.hpp b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/stabilizer.hpp index 86eb4ba2b..3eac1d78a 100644 --- a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/stabilizer.hpp +++ b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/stabilizer.hpp @@ -1,12 +1,12 @@ #ifndef BITBOTS_DYNAMIC_KICK_INCLUDE_BITBOTS_DYNAMIC_KICK_STABILIZER_H_ #define BITBOTS_DYNAMIC_KICK_INCLUDE_BITBOTS_DYNAMIC_KICK_STABILIZER_H_ -#include #include #include #include #include +#include #include #include "kick_utils.hpp" diff --git a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/visualizer.hpp b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/visualizer.hpp index 9813916a0..7f0170fef 100644 --- a/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/visualizer.hpp +++ b/bitbots_motion/bitbots_dynamic_kick/include/bitbots_dynamic_kick/visualizer.hpp @@ -5,10 +5,6 @@ #ifndef BITBOTS_DYNAMIC_KICK_INCLUDE_BITBOTS_DYNAMIC_KICK_VISUALIZER_H_ #define BITBOTS_DYNAMIC_KICK_INCLUDE_BITBOTS_DYNAMIC_KICK_VISUALIZER_H_ -#include -#include -#include - #include #include #include @@ -16,8 +12,11 @@ #include #include #include +#include #include #include +#include +#include #include #include diff --git a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_engine.hpp b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_engine.hpp index 7fd41039a..a5a67e9af 100644 --- a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_engine.hpp +++ b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_engine.hpp @@ -1,8 +1,6 @@ #ifndef BITBOTS_DYNUP_INCLUDE_BITBOTS_DYNUP_DYNUP_ENGINE_H_ #define BITBOTS_DYNUP_INCLUDE_BITBOTS_DYNUP_DYNUP_ENGINE_H_ -#include - #include #include #include @@ -13,6 +11,7 @@ #include #include #include +#include #include #include diff --git a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_ik.hpp b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_ik.hpp index 82166149d..745c496dc 100644 --- a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_ik.hpp +++ b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_ik.hpp @@ -2,13 +2,12 @@ #define BITBOTS_DYNUP_INCLUDE_BITBOTS_DYNUP_DYNUP_IK_H_ #include -#include -#include -#include - #include #include +#include +#include #include +#include #include #include "dynup_utils.hpp" diff --git a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_node.hpp b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_node.hpp index eafedf64a..6909337a9 100644 --- a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_node.hpp +++ b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_node.hpp @@ -1,13 +1,6 @@ #ifndef BITBOTS_DYNUP_INCLUDE_BITBOTS_DYNUP_DYNUP_NODE_H_ #define BITBOTS_DYNUP_INCLUDE_BITBOTS_DYNUP_DYNUP_NODE_H_ -#include -#include -#include -#include -#include -#include -#include #include #include @@ -24,6 +17,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -31,6 +27,10 @@ #include #include #include +#include +#include +#include +#include #include #include diff --git a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_utils.hpp b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_utils.hpp index 5b6888657..3bc1d00df 100644 --- a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_utils.hpp +++ b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_utils.hpp @@ -1,11 +1,10 @@ #ifndef BITBOTS_DYNUP_INCLUDE_BITBOTS_DYNUP_DYNUP_UTILS_H_ #define BITBOTS_DYNUP_INCLUDE_BITBOTS_DYNUP_DYNUP_UTILS_H_ -#include - #include #include #include +#include namespace bitbots_dynup { diff --git a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/visualizer.hpp b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/visualizer.hpp index 7513d00e7..571757923 100644 --- a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/visualizer.hpp +++ b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/visualizer.hpp @@ -1,10 +1,6 @@ #ifndef BITBOTS_DYNUP_INCLUDE_BITBOTS_DYNUP_VISUALIZER_H_ #define BITBOTS_DYNUP_INCLUDE_BITBOTS_DYNUP_VISUALIZER_H_ -#include -#include -#include - #include #include #include @@ -13,8 +9,11 @@ #include #include #include +#include +#include #include #include +#include #include #include diff --git a/bitbots_motion/bitbots_head_mover/src/move_head.cpp b/bitbots_motion/bitbots_head_mover/src/move_head.cpp index 8f70a2cfd..0c5425217 100644 --- a/bitbots_motion/bitbots_head_mover/src/move_head.cpp +++ b/bitbots_motion/bitbots_head_mover/src/move_head.cpp @@ -1,12 +1,7 @@ -#include -#include -#include -#include -#include -#include #include #include +#include #include #include #include @@ -18,6 +13,10 @@ #include #include #include +#include +#include +#include +#include #include #include #include @@ -27,6 +26,7 @@ #include #include #include +#include #include #include diff --git a/bitbots_motion/bitbots_moveit_bindings/src/bitbots_moveit_bindings.cpp b/bitbots_motion/bitbots_moveit_bindings/src/bitbots_moveit_bindings.cpp index a7282de23..3507e0d16 100644 --- a/bitbots_motion/bitbots_moveit_bindings/src/bitbots_moveit_bindings.cpp +++ b/bitbots_motion/bitbots_moveit_bindings/src/bitbots_moveit_bindings.cpp @@ -1,14 +1,13 @@ -#include -#include -#include -#include -#include #include #include -#include +#include #include #include +#include +#include +#include +#include #include #include #include @@ -19,6 +18,7 @@ #include #include #include +#include #include namespace py = pybind11; using namespace std::chrono_literals; diff --git a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_engine.hpp b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_engine.hpp index bfe40d6f3..afc46b373 100644 --- a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_engine.hpp +++ b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_engine.hpp @@ -6,15 +6,14 @@ The original files can be found at: #ifndef BITBOTS_QUINTIC_WALK_INCLUDE_BITBOTS_QUINTIC_WALK_WALK_ENGINE_H_ #define BITBOTS_QUINTIC_WALK_INCLUDE_BITBOTS_QUINTIC_WALK_WALK_ENGINE_H_ -#include -#include - #include #include #include #include #include #include +#include +#include namespace bitbots_quintic_walk { diff --git a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_ik.hpp b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_ik.hpp index 2c1e6c28d..c71d492e9 100644 --- a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_ik.hpp +++ b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_ik.hpp @@ -1,10 +1,9 @@ #ifndef BITBOTS_QUINTIC_WALK_INCLUDE_BITBOTS_QUINTIC_WALK_WALK_IK_H_ #define BITBOTS_QUINTIC_WALK_INCLUDE_BITBOTS_QUINTIC_WALK_WALK_IK_H_ -#include - #include #include #include +#include #include namespace bitbots_quintic_walk { diff --git a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_node.hpp b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_node.hpp index 12a477cb2..02945b294 100644 --- a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_node.hpp +++ b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_node.hpp @@ -6,13 +6,6 @@ The original files can be found at: #ifndef BITBOTS_QUINTIC_WALK_INCLUDE_BITBOTS_QUINTIC_WALK_WALK_NODE_H_ #define BITBOTS_QUINTIC_WALK_INCLUDE_BITBOTS_QUINTIC_WALK_WALK_NODE_H_ -#include -#include -#include -#include -#include -#include -#include #include #include @@ -34,6 +27,9 @@ The original files can be found at: #include #include #include +#include +#include +#include #include #include #include @@ -45,6 +41,10 @@ The original files can be found at: #include #include #include +#include +#include +#include +#include #include #include diff --git a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_visualizer.hpp b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_visualizer.hpp index bce3da1c4..df7f38cbe 100644 --- a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_visualizer.hpp +++ b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_visualizer.hpp @@ -1,21 +1,20 @@ #ifndef BITBOTS_QUINTIC_WALK_INCLUDE_BITBOTS_QUINTIC_WALK_WALK_VISUALIZER_H_ #define BITBOTS_QUINTIC_WALK_INCLUDE_BITBOTS_QUINTIC_WALK_WALK_VISUALIZER_H_ -#include -#include -#include -#include -#include - #include #include #include #include #include #include +#include #include #include #include +#include +#include +#include +#include #include #include diff --git a/bitbots_motion/bitbots_splines/include/bitbots_splines/abstract_ik.hpp b/bitbots_motion/bitbots_splines/include/bitbots_splines/abstract_ik.hpp index 40994a6e7..93b8fac25 100644 --- a/bitbots_motion/bitbots_splines/include/bitbots_splines/abstract_ik.hpp +++ b/bitbots_motion/bitbots_splines/include/bitbots_splines/abstract_ik.hpp @@ -3,7 +3,6 @@ #define BITBOTS_SPLINES_INCLUDE_BITBOTS_SPLINES_ABSTRACT_IK_H_ #include - #include #include #include diff --git a/bitbots_motion/bitbots_splines/include/bitbots_splines/abstract_visualizer.hpp b/bitbots_motion/bitbots_splines/include/bitbots_splines/abstract_visualizer.hpp index a82d0cf43..49fb8c159 100644 --- a/bitbots_motion/bitbots_splines/include/bitbots_splines/abstract_visualizer.hpp +++ b/bitbots_motion/bitbots_splines/include/bitbots_splines/abstract_visualizer.hpp @@ -1,9 +1,8 @@ #ifndef BITBOTS_SPLINES_INCLUDE_BITBOTS_SPLINES_ABSTRACT_VISUALIZER_H_ #define BITBOTS_SPLINES_INCLUDE_BITBOTS_SPLINES_ABSTRACT_VISUALIZER_H_ -#include - #include +#include #include #include diff --git a/bitbots_motion/bitbots_splines/include/bitbots_splines/pose_spline.hpp b/bitbots_motion/bitbots_splines/include/bitbots_splines/pose_spline.hpp index 3f3f42aa1..e1fce694f 100644 --- a/bitbots_motion/bitbots_splines/include/bitbots_splines/pose_spline.hpp +++ b/bitbots_motion/bitbots_splines/include/bitbots_splines/pose_spline.hpp @@ -1,15 +1,14 @@ #ifndef BITBOTS_SPLINES_INCLUDE_BITBOTS_SPLINES_POSE_SPLINE_H_ #define BITBOTS_SPLINES_INCLUDE_BITBOTS_SPLINES_POSE_SPLINE_H_ -#include -#include -#include - #include #include #include #include #include +#include +#include +#include #include namespace bitbots_splines { diff --git a/bitbots_motion/bitbots_splines/include/bitbots_splines/position_spline.hpp b/bitbots_motion/bitbots_splines/include/bitbots_splines/position_spline.hpp index 3c85e9a1a..7f07740bc 100644 --- a/bitbots_motion/bitbots_splines/include/bitbots_splines/position_spline.hpp +++ b/bitbots_motion/bitbots_splines/include/bitbots_splines/position_spline.hpp @@ -1,11 +1,10 @@ #ifndef BITBOTS_SPLINES_INCLUDE_BITBOTS_SPLINES_POSITION_SPLINE_H_ #define BITBOTS_SPLINES_INCLUDE_BITBOTS_SPLINES_POSITION_SPLINE_H_ -#include - #include #include #include +#include namespace bitbots_splines { diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/RobotState.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/RobotState.hpp index 3b260f60e..34391a1ac 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/RobotState.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/RobotState.hpp @@ -5,12 +5,11 @@ #ifndef BITBOTS_LOCALIZATION_ROBOTSTATE_H #define BITBOTS_LOCALIZATION_ROBOTSTATE_H -#include - #include #include #include #include +#include #include namespace bitbots_localization { diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/localization.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/localization.hpp index 84e359882..643f3147b 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/localization.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/localization.hpp @@ -6,11 +6,6 @@ #define BITBOTS_LOCALIZATION_LOCALIZATION_H #include -#include -#include -#include -#include -#include #include #include #include @@ -52,6 +47,11 @@ #include #include #include +#include +#include +#include +#include +#include #include #include #include diff --git a/bitbots_navigation/bitbots_odometry/include/bitbots_odometry/motion_odometry.hpp b/bitbots_navigation/bitbots_odometry/include/bitbots_odometry/motion_odometry.hpp index b25a4a931..1819c4d9b 100644 --- a/bitbots_navigation/bitbots_odometry/include/bitbots_odometry/motion_odometry.hpp +++ b/bitbots_navigation/bitbots_odometry/include/bitbots_odometry/motion_odometry.hpp @@ -1,4 +1,3 @@ -#include #include #include #include @@ -12,6 +11,7 @@ #include #include #include +#include #include using std::placeholders::_1; diff --git a/bitbots_navigation/bitbots_odometry/src/odometry_fuser.cpp b/bitbots_navigation/bitbots_odometry/src/odometry_fuser.cpp index 0b80666ee..694495d9c 100644 --- a/bitbots_navigation/bitbots_odometry/src/odometry_fuser.cpp +++ b/bitbots_navigation/bitbots_odometry/src/odometry_fuser.cpp @@ -12,11 +12,6 @@ imu (rX, rY) #include #include #include -#include -#include -#include -#include -#include #include #include #include @@ -32,6 +27,11 @@ imu (rX, rY) #include #include #include +#include +#include +#include +#include +#include #include #include From acdd582d9f062158a04d2fc940a4a83c2f68c100 Mon Sep 17 00:00:00 2001 From: Jan Gutsche Date: Sun, 5 Jan 2025 15:32:40 +0000 Subject: [PATCH 27/65] blame ignore formatting --- .git-blame-ignore-revs | 1 + 1 file changed, 1 insertion(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index d5bb2ab71..7baa3225b 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -11,3 +11,4 @@ f29fb619aef9f416cbbdc74ec77c23423dcefe07 3b9f322183bed2cb271bf6bd07d803a93c398c3e ae9fbef74c50ba1e462d1b76da16779c76aa0d5b 476e75e3f3d17c35ac89b17f513d93078687d613 +cd3280273363807e1b5df2ade0138d48178cb06b From 354024f604d814e1b45efbaf8fa4ef7d3dda07bf Mon Sep 17 00:00:00 2001 From: Florian Vahl Date: Sun, 5 Jan 2025 17:26:11 +0100 Subject: [PATCH 28/65] Build control_toolbox from source. Revert after new version is released --- workspace.repos | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/workspace.repos b/workspace.repos index 0a36b7d8c..31eb2c056 100644 --- a/workspace.repos +++ b/workspace.repos @@ -19,6 +19,10 @@ repositories: type: git url: git@github.com:ros-sports/biped_interfaces.git version: rolling + lib/control_toolbox: + type: git + url: git@github.com:ros-controls/control_toolbox.git + version: ros2-master lib/dynamic_stack_decider: type: git url: git@github.com:bit-bots/dynamic_stack_decider.git From aa37e65ee109579782729d116cae2afd452bc200 Mon Sep 17 00:00:00 2001 From: Florian Vahl Date: Sun, 5 Jan 2025 17:28:08 +0100 Subject: [PATCH 29/65] Revert "TMP: Turn off warnings as errors" This reverts commit 65d0099c4944a88e53ca3a76cb857602c2ee21c9. --- bitbots_motion/bitbots_dynamic_kick/CMakeLists.txt | 2 +- bitbots_motion/bitbots_dynup/CMakeLists.txt | 2 +- bitbots_motion/bitbots_quintic_walk/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bitbots_motion/bitbots_dynamic_kick/CMakeLists.txt b/bitbots_motion/bitbots_dynamic_kick/CMakeLists.txt index 2abd77f49..98717aa45 100644 --- a/bitbots_motion/bitbots_dynamic_kick/CMakeLists.txt +++ b/bitbots_motion/bitbots_dynamic_kick/CMakeLists.txt @@ -34,7 +34,7 @@ rosidl_generate_interfaces(${PROJECT_NAME} "msg/KickDebug.msg" DEPENDENCIES set(INCLUDE_DIRS include ${PYTHON_INCLUDE_DIRS}) include_directories(${INCLUDE_DIRS}) -add_compile_options(-Wall -Wno-unused) +add_compile_options(-Wall -Werror -Wno-unused) set(SOURCES src/kick_node.cpp src/kick_engine.cpp src/stabilizer.cpp src/visualizer.cpp src/kick_ik.cpp) diff --git a/bitbots_motion/bitbots_dynup/CMakeLists.txt b/bitbots_motion/bitbots_dynup/CMakeLists.txt index 86939496c..53ad50b19 100644 --- a/bitbots_motion/bitbots_dynup/CMakeLists.txt +++ b/bitbots_motion/bitbots_dynup/CMakeLists.txt @@ -59,7 +59,7 @@ rosidl_generate_interfaces( include_directories(include ${PYTHON_INCLUDE_DIRS}) -add_compile_options(-Wall -Wno-unused -fPIC) +add_compile_options(-Wall -Werror -Wno-unused -fPIC) set(SOURCES src/dynup_engine.cpp diff --git a/bitbots_motion/bitbots_quintic_walk/CMakeLists.txt b/bitbots_motion/bitbots_quintic_walk/CMakeLists.txt index eb0f003e7..84f4a707f 100644 --- a/bitbots_motion/bitbots_quintic_walk/CMakeLists.txt +++ b/bitbots_motion/bitbots_quintic_walk/CMakeLists.txt @@ -53,7 +53,7 @@ rosidl_generate_interfaces( include_directories(include ${PYTHON_INCLUDE_DIRS}) -add_compile_options(-Wall -Wno-unused -Wextra -Wpedantic) +add_compile_options(-Wall -Werror -Wno-unused -Wextra -Wpedantic) set(SOURCES src/walk_visualizer.cpp src/walk_engine.cpp src/walk_stabilizer.cpp src/walk_ik.cpp src/walk_node.cpp) From 1e99b6756c8715eff3b8ac0c6416cf069f90c160 Mon Sep 17 00:00:00 2001 From: Florian Vahl Date: Sun, 5 Jan 2025 21:12:20 +0100 Subject: [PATCH 30/65] Merge with main --- .../.gitignore | 2 - .../__init__.py | 0 .../bitbots_technical_challenge_vision.py | 183 ------------------ .../config/range.yaml | 118 ----------- .../launch/vision.launch | 8 - .../package.xml | 27 --- .../bitbots_technical_challenge_vision | 0 .../setup.cfg | 4 - .../setup.py | 35 ---- .../bitbots_teleop/scripts/teleop_keyboard.py | 48 ++++- bitbots_msgs/CMakeLists.txt | 1 + bitbots_msgs/srv/SimulatorPush.srv | 4 + .../webots_supervisor_controller.py | 9 +- sync_includes_wolfgang_nuc.yaml | 1 - 14 files changed, 60 insertions(+), 380 deletions(-) delete mode 100644 bitbots_misc/bitbots_technical_challenge_vision/bitbots_technical_challenge_vision/.gitignore delete mode 100644 bitbots_misc/bitbots_technical_challenge_vision/bitbots_technical_challenge_vision/__init__.py delete mode 100755 bitbots_misc/bitbots_technical_challenge_vision/bitbots_technical_challenge_vision/bitbots_technical_challenge_vision.py delete mode 100644 bitbots_misc/bitbots_technical_challenge_vision/config/range.yaml delete mode 100644 bitbots_misc/bitbots_technical_challenge_vision/launch/vision.launch delete mode 100644 bitbots_misc/bitbots_technical_challenge_vision/package.xml delete mode 100644 bitbots_misc/bitbots_technical_challenge_vision/resource/bitbots_technical_challenge_vision delete mode 100644 bitbots_misc/bitbots_technical_challenge_vision/setup.cfg delete mode 100644 bitbots_misc/bitbots_technical_challenge_vision/setup.py create mode 100644 bitbots_msgs/srv/SimulatorPush.srv diff --git a/bitbots_misc/bitbots_technical_challenge_vision/bitbots_technical_challenge_vision/.gitignore b/bitbots_misc/bitbots_technical_challenge_vision/bitbots_technical_challenge_vision/.gitignore deleted file mode 100644 index ab08e78d3..000000000 --- a/bitbots_misc/bitbots_technical_challenge_vision/bitbots_technical_challenge_vision/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore generate parameter library build artifacts -bitbots_technical_challenge_vision_params.py diff --git a/bitbots_misc/bitbots_technical_challenge_vision/bitbots_technical_challenge_vision/__init__.py b/bitbots_misc/bitbots_technical_challenge_vision/bitbots_technical_challenge_vision/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/bitbots_misc/bitbots_technical_challenge_vision/bitbots_technical_challenge_vision/bitbots_technical_challenge_vision.py b/bitbots_misc/bitbots_technical_challenge_vision/bitbots_technical_challenge_vision/bitbots_technical_challenge_vision.py deleted file mode 100755 index 7c7957aad..000000000 --- a/bitbots_misc/bitbots_technical_challenge_vision/bitbots_technical_challenge_vision/bitbots_technical_challenge_vision.py +++ /dev/null @@ -1,183 +0,0 @@ -from typing import Optional, Tuple - -import cv2 -import numpy as np -import rclpy -import rclpy.logging -from ament_index_python.packages import get_package_share_directory -from cv_bridge import CvBridge -from rclpy.node import Node -from sensor_msgs.msg import Image -from soccer_vision_2d_msgs.msg import Robot, RobotArray - -from bitbots_technical_challenge_vision.bitbots_technical_challenge_vision_params import ( - bitbots_technical_challenge_vision, -) - - -class TechnicalChallengeVision(Node): - def __init__(self): - super().__init__("bitbots_technical_challenge_vision") - - self._package_path = get_package_share_directory("bitbots_technical_challenge_vision") - self._cv_bridge = CvBridge() - self._annotations_pub = self.create_publisher(RobotArray, "/robots_in_image", 10) - self._debug_img_pub = self.create_publisher(Image, "/bitbots_technical_challenge_vision_debug_img", 10) - self._debug_clrmp_pub_blue = self.create_publisher( - Image, "/bitbots_technical_challenge_vision_debug_clrmp_blue", 10 - ) - self._debug_clrmp_pub_red = self.create_publisher( - Image, "/bitbots_technical_challenge_vision_debug_clrmp_red", 10 - ) - self._img_sub = self.create_subscription(Image, "/camera/image_proc", self.image_callback, 10) - self._param_listener = bitbots_technical_challenge_vision.ParamListener(self) - self._params = self._param_listener.get_params() - - def create_robot_msg(self, x: int, y: int, w: int, h: int, t: int) -> Robot: - """ - Creates a Robot message from a robots bounding box data and its color. - - :param x: bb top left x - :param y: bb top left y - :param w: bb width - :param h: bb height - :param t: robot team - :return: robot message for that robot - """ - robot = Robot() - - robot.bb.center.position.x = float(x + (w / 2)) - robot.bb.center.position.y = float(y + (h / 2)) - robot.bb.size_x = float(w) - robot.bb.size_y = float(h) - robot.attributes.team = t - - return robot - - def process_image( - self, img: np.ndarray, debug_img: np.ndarray, arg - ) -> Tuple[list[Robot], list[Robot], np.ndarray, np.ndarray]: - """ - gets annotations from the camera image - - :param img: ndarray containing the camera image - :param debug_img: copy of img debug annotations should be drawn here - :param arg: __RosParameters object containing the dynamic parameters - :return: [[blue_robots], [red_robots], clrmp_blue, clrmp_red] - """ - # convert img to hsv to isolate colors better - img = cv2.cvtColor(img, cv2.COLOR_BGR2HSV) - - # get color maps - blue_map = cv2.inRange( - img, - (arg.blue_lower_h, arg.blue_lower_s, arg.blue_lower_v), - (arg.blue_upper_h, arg.blue_upper_s, arg.blue_upper_v), - ) - - red_map = cv2.inRange( - img, - (arg.red_lower_h, arg.red_lower_s, arg.red_lower_v), - (arg.red_upper_h, arg.red_upper_s, arg.red_upper_v), - ) - - # get contours in color maps - blue_contours, _ = cv2.findContours(blue_map, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE) - red_contours, _ = cv2.findContours(red_map, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE) - - # get lists of bounding boxes - blue_robots = [] - red_robots = [] - - def annotate(x, y, w, h, c) -> Optional[np.ndarray]: - if not arg.debug_mode: - return None - return cv2.rectangle( - debug_img, - (x, y), - (x + w, y + h), - c, - 2, - ) - - for cnt in blue_contours: - x, y, w, h = cv2.boundingRect(cnt) - if min(w, h) >= arg.min_size and max(h, w) <= arg.max_size: - # draw bb on debug img - annotate(x, y, w, h, (255, 0, 0)) - - # TODO I think 1 is for the blue team? - blue_robots.append(self.create_robot_msg(x, y, w, h, 1)) - - for cnt in red_contours: - x, y, w, h = cv2.boundingRect(cnt) - if min(w, h) >= arg.min_size and max(h, w) <= arg.max_size: - # draw bb on debug img - annotate(x, y, w, h, (0, 0, 255)) - - red_robots.append(self.create_robot_msg(x, y, w, h, 2)) - - return blue_robots, red_robots, blue_map, red_map, debug_img - - def image_callback(self, msg: Image): - # get dynamic parameters - if self._param_listener.is_old(self._params): - self._param_listener.refresh_dynamic_parameters() - self._params = self._param_listener.get_params() - - arg = self._params - - # set variables - img = self._cv_bridge.imgmsg_to_cv2(img_msg=msg, desired_encoding="bgr8") - header = msg.header - - if arg.debug_mode: - debug_img = np.copy(img) - else: - debug_img = None - - # get annotations - blue_robots, red_robots, blue_map, red_map, debug_img = self.process_image(img, debug_img, arg) - robots = [] - robots.extend(blue_robots) - robots.extend(red_robots) - - # make output message - robot_array_message = RobotArray() - robot_array_message.header = header - robot_array_message.robots = robots - - # publish output message - self._annotations_pub.publish(robot_array_message) - - if arg.debug_mode: - # make debug image message - debug_img_msg = self._cv_bridge.cv2_to_imgmsg(cvim=debug_img, encoding="bgr8", header=header) - - # publish debug image - self._debug_img_pub.publish(debug_img_msg) - - # make color map messages - clrmp_blue_img = cv2.cvtColor(blue_map, cv2.COLOR_GRAY2BGR) - clrmp_blue_msg = self._cv_bridge.cv2_to_imgmsg(cvim=clrmp_blue_img, encoding="bgr8", header=header) - - clrmp_red_img = cv2.cvtColor(red_map, cv2.COLOR_GRAY2BGR) - clrmp_red_msg = self._cv_bridge.cv2_to_imgmsg(clrmp_red_img, encoding="bgr8", header=header) - - # publish color map messages - self._debug_clrmp_pub_blue.publish(clrmp_blue_msg) - self._debug_clrmp_pub_red.publish(clrmp_red_msg) - - -def main(args=None): - rclpy.init(args=args) - node = TechnicalChallengeVision() - try: - rclpy.spin(node) - except KeyboardInterrupt: - pass - node.destroy_node() - - -if __name__ == "__main__": - main() diff --git a/bitbots_misc/bitbots_technical_challenge_vision/config/range.yaml b/bitbots_misc/bitbots_technical_challenge_vision/config/range.yaml deleted file mode 100644 index 6716d55af..000000000 --- a/bitbots_misc/bitbots_technical_challenge_vision/config/range.yaml +++ /dev/null @@ -1,118 +0,0 @@ -bitbots_technical_challenge_vision: - blue_lower_h: { - type: int, - default_value: 92, - description: "hue value of the lower boundary for blue obstacles", - validation: { - bounds<>: [0, 179] - } - } - blue_upper_h: { - type: int, - default_value: 110, - description: "hue value of the upper boundary for blue obstacles", - validation: { - bounds<>: [0, 179] - } - } - blue_lower_s: { - type: int, - default_value: 90, - description: "separation value of the lower boundary for blue obstacles", - validation: { - bounds<>: [0, 255] - } - } - blue_upper_s: { - type: int, - default_value: 236, - description: "separation value of the upper boundary for blue obstacles", - validation: { - bounds<>: [0, 255] - } - } - blue_lower_v: { - type: int, - default_value: 0, - description: "value value of the lower boundary for blue obstacles", - validation: { - bounds<>: [0, 255] - } - } - blue_upper_v: { - type: int, - default_value: 255, - description: "value value of the upper boundary for blue obstacles", - validation: { - bounds<>: [0, 255] - } - } - red_lower_h: { - type: int, - default_value: 138, - description: "hue value of the lower boundary for red obstacles", - validation: { - bounds<>: [0, 179] - } - } - red_upper_h: { - type: int, - default_value: 179, - description: "hue value of the upper boundary for red obstacles", - validation: { - bounds<>: [0, 179] - } - } - red_lower_s: { - type: int, - default_value: 78, - description: "separation value of the lower boundary for red obstacles", - validation: { - bounds<>: [0, 255] - } - } - red_upper_s: { - type: int, - default_value: 255, - description: "separation value of the upper boundary for red obstacles", - validation: { - bounds<>: [0, 255] - } - } - red_lower_v: { - type: int, - default_value: 0, - description: "value value of the lower boundary for red obstacles", - validation: { - bounds<>: [0, 255] - } - } - red_upper_v: { - type: int, - default_value: 255, - description: "value value of the upper boundary for red obstacles", - validation: { - bounds<>: [0, 255] - } - } - min_size: { - type: int, - default_value: 20, - description: "minimum size of an obstacle to be considered", - validation: { - gt_eq<>: 0 - } - } - max_size: { - type: int, - default_value: 400, - description: "maximum size of an obstacle to be considered", - validation: { - gt_eq<>: 0 - } - } - debug_mode: { - type: bool, - default_value: false, - description: "set true if debug images should be drawn and published", - } diff --git a/bitbots_misc/bitbots_technical_challenge_vision/launch/vision.launch b/bitbots_misc/bitbots_technical_challenge_vision/launch/vision.launch deleted file mode 100644 index 1d36dc25f..000000000 --- a/bitbots_misc/bitbots_technical_challenge_vision/launch/vision.launch +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/bitbots_misc/bitbots_technical_challenge_vision/package.xml b/bitbots_misc/bitbots_technical_challenge_vision/package.xml deleted file mode 100644 index 9c0a53d6e..000000000 --- a/bitbots_misc/bitbots_technical_challenge_vision/package.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - bitbots_technical_challenge_vision - 0.0.0 - TODO: Package description - par - TODO: License declaration - - rclpy - python3-opencv - python3-numpy - cv_bridge - sensor_msgs - soccer_vision_2d_msgs - - generate_parameter_library - - ament_copyright - ament_flake8 - ament_pep257 - python3-pytest - - - ament_python - - diff --git a/bitbots_misc/bitbots_technical_challenge_vision/resource/bitbots_technical_challenge_vision b/bitbots_misc/bitbots_technical_challenge_vision/resource/bitbots_technical_challenge_vision deleted file mode 100644 index e69de29bb..000000000 diff --git a/bitbots_misc/bitbots_technical_challenge_vision/setup.cfg b/bitbots_misc/bitbots_technical_challenge_vision/setup.cfg deleted file mode 100644 index 34ccaf1e9..000000000 --- a/bitbots_misc/bitbots_technical_challenge_vision/setup.cfg +++ /dev/null @@ -1,4 +0,0 @@ -[develop] -script_dir=$base/lib/bitbots_technical_challenge_vision -[install] -install_scripts=$base/lib/bitbots_technical_challenge_vision diff --git a/bitbots_misc/bitbots_technical_challenge_vision/setup.py b/bitbots_misc/bitbots_technical_challenge_vision/setup.py deleted file mode 100644 index cfe0915aa..000000000 --- a/bitbots_misc/bitbots_technical_challenge_vision/setup.py +++ /dev/null @@ -1,35 +0,0 @@ -import glob - -from generate_parameter_library_py.setup_helper import generate_parameter_module -from setuptools import find_packages, setup - -package_name = "bitbots_technical_challenge_vision" - -setup( - name=package_name, - version="0.0.0", - packages=find_packages(exclude=["test"]), - data_files=[ - ("share/ament_index/resource_index/packages", ["resource/" + package_name]), - ("share/" + package_name, ["package.xml"]), - ("share/" + package_name + "/config", glob.glob("config/*.yaml")), - ("share/" + package_name + "/launch", glob.glob("launch/*.launch")), - ], - install_requires=["setuptools"], - tests_require=["pytest"], - zip_safe=True, - maintainer="par", - maintainer_email="paer-wiegmann@gmx.de", - description="This Package provides a simple vision to detect the obstacles for the obstacle avoidance challenge.", - license="MIT", - entry_points={ - "console_scripts": [ - "bitbots_technical_challenge_vision = bitbots_technical_challenge_vision.bitbots_technical_challenge_vision:main", - ], - }, -) - -generate_parameter_module( - "bitbots_technical_challenge_vision_params", - "config/range.yaml", -) diff --git a/bitbots_misc/bitbots_teleop/scripts/teleop_keyboard.py b/bitbots_misc/bitbots_teleop/scripts/teleop_keyboard.py index 885df006e..341518df0 100755 --- a/bitbots_misc/bitbots_teleop/scripts/teleop_keyboard.py +++ b/bitbots_misc/bitbots_teleop/scripts/teleop_keyboard.py @@ -20,6 +20,7 @@ from bitbots_msgs.action import Dynup, Kick from bitbots_msgs.msg import HeadMode, JointCommand +from bitbots_msgs.srv import SimulatorPush msg = """ BitBots Teleop @@ -57,6 +58,13 @@ 4: Ball Mode adapted for Penalty Kick 5: Do a pattern which only looks in front of the robot +Pushing: +p: execute Push +Shift-p: reset Power to 0 +ü/ä: increase/decrease power forward (x axis) ++/#: increase/decrease power left (y axis) +SHIFT increases/decreases with factor 10 + CTRL-C to quit @@ -121,6 +129,9 @@ def __init__(self): self.th = 0 self.status = 0 + self.push_force_x = 0.0 + self.push_force_y = 0.0 + # Head Part self.create_subscription(JointState, "joint_states", self.joint_state_cb, 1) self.head_mode_pub = self.create_publisher(HeadMode, "head_mode", 1) @@ -145,6 +156,7 @@ def __init__(self): self.reset_robot = self.create_client(Empty, "/reset_pose") self.reset_ball = self.create_client(Empty, "/reset_ball") + self.simulator_push = self.create_client(SimulatorPush, "/simulator_push") self.frame_prefix = "" if os.environ.get("ROS_NAMESPACE") is None else os.environ.get("ROS_NAMESPACE") + "/" @@ -308,6 +320,32 @@ def loop(self): self.z = 0 self.a_x = -1 self.th = 0 + elif key == "p": + # push robot in simulation + push_request = SimulatorPush.Request() + push_request.force.x = self.push_force_x + push_request.force.y = self.push_force_y + push_request.relative = True + self.simulator_push.call_async(push_request) + elif key == "P": + self.push_force_x = 0.0 + self.push_force_y = 0.0 + elif key == "ü": + self.push_force_x += 1 + elif key == "Ü": + self.push_force_x += 10 + elif key == "ä": + self.push_force_x -= 1 + elif key == "Ä": + self.push_force_x -= 10 + elif key == "+": + self.push_force_y += 1 + elif key == "*": + self.push_force_y += 10 + elif key == "#": + self.push_force_y -= 1 + elif key == "'": + self.push_force_y -= 10 else: self.x = 0 self.y = 0 @@ -324,7 +362,15 @@ def loop(self): twist.linear = Vector3(x=float(self.x), y=float(self.y), z=0.0) twist.angular = Vector3(x=float(self.a_x), y=0.0, z=float(self.th)) self.pub.publish(twist) - state_str = f"x: {self.x} \ny: {self.y} \nturn: {self.th} \nhead mode: {self.head_mode_msg.head_mode} \n" + state_str = ( + f"x: {self.x} \n" + f"y: {self.y} \n" + f"turn: {self.th} \n" + f"head mode: {self.head_mode_msg.head_mode} \n" + f"push force x (+forward/-back): {self.push_force_x} \n" + f"push force y (+left/-right): {self.push_force_y} " + ) + for _ in range(state_str.count("\n") + 1): sys.stdout.write("\x1b[A") print(state_str) diff --git a/bitbots_msgs/CMakeLists.txt b/bitbots_msgs/CMakeLists.txt index 61884419f..74c50a259 100644 --- a/bitbots_msgs/CMakeLists.txt +++ b/bitbots_msgs/CMakeLists.txt @@ -50,6 +50,7 @@ rosidl_generate_interfaces( "srv/SetObjectPose.srv" "srv/SetObjectPosition.srv" "srv/SetTeachingMode.srv" + "srv/SimulatorPush.srv" DEPENDENCIES action_msgs geometry_msgs diff --git a/bitbots_msgs/srv/SimulatorPush.srv b/bitbots_msgs/srv/SimulatorPush.srv new file mode 100644 index 000000000..db5f753f7 --- /dev/null +++ b/bitbots_msgs/srv/SimulatorPush.srv @@ -0,0 +1,4 @@ +geometry_msgs/Vector3 force +bool relative +string robot "amy" +--- diff --git a/bitbots_simulation/bitbots_webots_sim/bitbots_webots_sim/webots_supervisor_controller.py b/bitbots_simulation/bitbots_webots_sim/bitbots_webots_sim/webots_supervisor_controller.py index 40211b63d..e2b51cb70 100644 --- a/bitbots_simulation/bitbots_webots_sim/bitbots_webots_sim/webots_supervisor_controller.py +++ b/bitbots_simulation/bitbots_webots_sim/bitbots_webots_sim/webots_supervisor_controller.py @@ -8,7 +8,7 @@ from rosgraph_msgs.msg import Clock from std_srvs.srv import Empty -from bitbots_msgs.srv import SetObjectPose, SetObjectPosition +from bitbots_msgs.srv import SetObjectPose, SetObjectPosition, SimulatorPush G = 9.81 @@ -117,6 +117,9 @@ def __init__( self.set_ball_position_service = self.ros_node.create_service( SetObjectPosition, base_ns + "set_ball_position", self.ball_pos_callback ) + self.simulator_push_service = self.ros_node.create_service( + SimulatorPush, base_ns + "simulator_push", self.simulator_push + ) self.world_info = self.supervisor.getFromDef("world_info") self.ball = self.supervisor.getFromDef("ball") @@ -240,6 +243,10 @@ def robot_pose_callback(self, request=None, response=None): ) return response or SetObjectPose.Response() + def simulator_push(self, request=None, response=None): + self.robot_nodes[request.robot].addForce([request.force.x, request.force.y, request.force.z], request.relative) + return response or Empty.Response() + def reset_ball(self, request=None, response=None): self.ball.getField("translation").setSFVec3f([0, 0, 0.0772]) self.ball.getField("rotation").setSFRotation([0, 0, 1, 0]) diff --git a/sync_includes_wolfgang_nuc.yaml b/sync_includes_wolfgang_nuc.yaml index b07e22d3f..024bb81bb 100644 --- a/sync_includes_wolfgang_nuc.yaml +++ b/sync_includes_wolfgang_nuc.yaml @@ -14,7 +14,6 @@ include: - bitbots_ipm - bitbots_parameter_blackboard - bitbots_robot_description - - bitbots_technical_challenge_vision - bitbots_teleop - bitbots_tf_buffer - bitbots_tts From 573a19218a32cec0af0b89aa9f3395c8c809b993 Mon Sep 17 00:00:00 2001 From: Florian Vahl Date: Mon, 20 Jan 2025 20:14:54 +0100 Subject: [PATCH 31/65] Fix duplicated key from auto merge --- bitbots_motion/bitbots_animation_rqt/setup.py | 1 - bitbots_motion/bitbots_animation_server/setup.py | 1 - bitbots_team_communication/bitbots_team_data_sim_rqt/setup.py | 1 - bitbots_vision/setup.py | 1 - bitbots_world_model/bitbots_ball_filter/setup.py | 1 - 5 files changed, 5 deletions(-) diff --git a/bitbots_motion/bitbots_animation_rqt/setup.py b/bitbots_motion/bitbots_animation_rqt/setup.py index d672f0aed..639dc194a 100644 --- a/bitbots_motion/bitbots_animation_rqt/setup.py +++ b/bitbots_motion/bitbots_animation_rqt/setup.py @@ -14,7 +14,6 @@ install_requires=["setuptools"], tests_require=["pytest"], zip_safe=True, - tests_require=["pytest"], entry_points={ "console_scripts": [ "animation_gui = " + package_name + ".record_ui:main", diff --git a/bitbots_motion/bitbots_animation_server/setup.py b/bitbots_motion/bitbots_animation_server/setup.py index 3b52c7026..c41689c5f 100644 --- a/bitbots_motion/bitbots_animation_server/setup.py +++ b/bitbots_motion/bitbots_animation_server/setup.py @@ -22,7 +22,6 @@ zip_safe=True, keywords=["ROS"], license="MIT", - tests_require=["pytest"], entry_points={ "console_scripts": [ "animation_node = bitbots_animation_server.animation_node:main", diff --git a/bitbots_team_communication/bitbots_team_data_sim_rqt/setup.py b/bitbots_team_communication/bitbots_team_data_sim_rqt/setup.py index c8298277f..65fc7a504 100644 --- a/bitbots_team_communication/bitbots_team_data_sim_rqt/setup.py +++ b/bitbots_team_communication/bitbots_team_data_sim_rqt/setup.py @@ -14,7 +14,6 @@ install_requires=["setuptools"], tests_require=["pytest"], zip_safe=True, - tests_require=["pytest"], entry_points={ "console_scripts": [ "team_data_sim_gui = " + package_name + ".team_data_ui:main", diff --git a/bitbots_vision/setup.py b/bitbots_vision/setup.py index 6c563954c..96b053d04 100755 --- a/bitbots_vision/setup.py +++ b/bitbots_vision/setup.py @@ -27,7 +27,6 @@ zip_safe=True, keywords=["ROS"], license="MIT", - tests_require=["pytest"], entry_points={ "console_scripts": [ "vision = bitbots_vision.vision:main", diff --git a/bitbots_world_model/bitbots_ball_filter/setup.py b/bitbots_world_model/bitbots_ball_filter/setup.py index 4080aaa35..c98cbb296 100644 --- a/bitbots_world_model/bitbots_ball_filter/setup.py +++ b/bitbots_world_model/bitbots_ball_filter/setup.py @@ -28,7 +28,6 @@ zip_safe=True, keywords=["ROS"], license="MIT", - tests_require=["pytest"], entry_points={ "console_scripts": [ "ball_filter = bitbots_ball_filter.ball_filter:main", From 4640f9ec5979406665013ae06a965f794c9c2ad9 Mon Sep 17 00:00:00 2001 From: Jan Gutsche Date: Sat, 1 Feb 2025 00:19:17 +0100 Subject: [PATCH 32/65] Update and fix ros2 install docs --- .../tutorials/install_software_ros2.rst | 31 +++++++------------ requirements/common.txt | 3 ++ 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/bitbots_misc/bitbots_docs/docs/manual/tutorials/install_software_ros2.rst b/bitbots_misc/bitbots_docs/docs/manual/tutorials/install_software_ros2.rst index 747016526..eb4799502 100644 --- a/bitbots_misc/bitbots_docs/docs/manual/tutorials/install_software_ros2.rst +++ b/bitbots_misc/bitbots_docs/docs/manual/tutorials/install_software_ros2.rst @@ -46,29 +46,14 @@ Alternatively you can use a devcontainer :doc:`vscode-dev-container`, with a pre python3-pip \ python3-rosdep \ python3-vcstool \ - ros-iron-plotjuggler-ros \ - ros-iron-rmw-cyclonedds-cpp \ - ros-iron-rqt-robot-monitor \ - ros-iron-rqt-runtime-monitor + ros-jazzy-plotjuggler-ros \ + ros-jazzy-rmw-cyclonedds-cpp \ + ros-jazzy-rqt-robot-monitor \ + ros-jazzy-rqt-runtime-monitor - Run ``sudo rosdep init`` to initialize ``rosdep``, a tool that helps you install system dependencies for ROS packages. -- Optionally, to get nice colored output from colcon, you can install the following pip packages: -.. code-block:: bash - - python3 -m pip install \ - git+https://github.com/ruffsl/colcon-clean \ - git+https://github.com/timonegk/colcon-core.git@colors \ - git+https://github.com/timonegk/colcon-notification.git@colors \ - git+https://github.com/timonegk/colcon-output.git@colors - -**2. Install Webots** - -Webots is a robot simulator, which we use to simulate our robots and test our software. -It is not strictly necessary to install it, but it is very useful for development and testing. -If you want to install it, you can do so by running ``make webots`` in the bitbots_main repository. - -**3. Download our software** +**2. Download our software (if not already done)** - Create a GitHub account, if not already done (see `here `_ for further information) - Add your SSH key to GitHub to access and sync our repositories @@ -86,6 +71,12 @@ If you want to install it, you can do so by running ``make webots`` in the bitbo This will take a while, as it downloads all the code and other files from our repositories and additionally installs all missing dependencies (using rosdep and pip). Finally, it will register pre-commit hooks (automatic code-formatting and warnings), which will be run every time you commit code to our repositories. +**3. Install Webots** + +Webots is a robot simulator, which we use to simulate our robots and test our software. +It is not strictly necessary to install it, but it is very useful for development and testing. +If you want to install it, you can do so by running ``make webots`` in the bitbots_main repository. + **4. Setup colcon workspace** `Colcon `_ is the tool provided by ROS 2 to build and install our ROS packages, so that they can be launched later. diff --git a/requirements/common.txt b/requirements/common.txt index 046b3efa4..cca5f64b2 100644 --- a/requirements/common.txt +++ b/requirements/common.txt @@ -3,6 +3,9 @@ pip transforms3d==0.4.1 git+https://github.com/Flova/pyastar2d git+https://github.com/bit-bots/YOEO +git+https://github.com/timonegk/colcon-core.git@colors +git+https://github.com/timonegk/colcon-notification.git@colors +git+https://github.com/timonegk/colcon-output.git@colors simpleeval beartype jaxtyping From ba1dafa5990354fba698ca4f5d5275debd6e99f0 Mon Sep 17 00:00:00 2001 From: Jan Gutsche Date: Sat, 1 Feb 2025 12:23:45 +0100 Subject: [PATCH 33/65] Fix deprecation warning --- bitbots_misc/bitbots_basler_camera/src/basler_camera.cpp | 2 +- .../bitbots_dynup/include/bitbots_dynup/dynup_engine.hpp | 2 +- bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_ik.hpp | 2 +- .../bitbots_dynup/include/bitbots_dynup/dynup_node.hpp | 2 +- .../bitbots_dynup/include/bitbots_dynup/dynup_stabilizer.hpp | 2 +- .../bitbots_dynup/include/bitbots_dynup/visualizer.hpp | 2 +- bitbots_motion/bitbots_head_mover/src/move_head.cpp | 2 +- .../include/bitbots_quintic_walk/walk_engine.hpp | 2 +- .../include/bitbots_quintic_walk/walk_ik.hpp | 2 +- .../include/bitbots_quintic_walk/walk_node.hpp | 2 +- .../include/bitbots_localization/ObservationModel.hpp | 2 +- .../include/bitbots_localization/localization.hpp | 2 +- .../include/bitbots_odometry/motion_odometry.hpp | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/bitbots_misc/bitbots_basler_camera/src/basler_camera.cpp b/bitbots_misc/bitbots_basler_camera/src/basler_camera.cpp index b1587a0a2..eaaec5993 100644 --- a/bitbots_misc/bitbots_basler_camera/src/basler_camera.cpp +++ b/bitbots_misc/bitbots_basler_camera/src/basler_camera.cpp @@ -3,6 +3,7 @@ #include #include +#include #include #include #include @@ -12,7 +13,6 @@ #include #include #include -#include #include #include #include diff --git a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_engine.hpp b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_engine.hpp index a5a67e9af..5a04b90d7 100644 --- a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_engine.hpp +++ b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_engine.hpp @@ -1,13 +1,13 @@ #ifndef BITBOTS_DYNUP_INCLUDE_BITBOTS_DYNUP_DYNUP_ENGINE_H_ #define BITBOTS_DYNUP_INCLUDE_BITBOTS_DYNUP_DYNUP_ENGINE_H_ +#include #include #include #include #include #include #include -#include #include #include #include diff --git a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_ik.hpp b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_ik.hpp index 745c496dc..f14e95c86 100644 --- a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_ik.hpp +++ b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_ik.hpp @@ -2,8 +2,8 @@ #define BITBOTS_DYNUP_INCLUDE_BITBOTS_DYNUP_DYNUP_IK_H_ #include +#include #include -#include #include #include #include diff --git a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_node.hpp b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_node.hpp index ae214c2ec..028b35f43 100644 --- a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_node.hpp +++ b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_node.hpp @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -13,7 +14,6 @@ #include #include #include -#include #include #include #include diff --git a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_stabilizer.hpp b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_stabilizer.hpp index 684474572..d4d2b861f 100644 --- a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_stabilizer.hpp +++ b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/dynup_stabilizer.hpp @@ -4,9 +4,9 @@ #include #include +#include #include #include -#include #include #include #include diff --git a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/visualizer.hpp b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/visualizer.hpp index 571757923..35a8195dd 100644 --- a/bitbots_motion/bitbots_dynup/include/bitbots_dynup/visualizer.hpp +++ b/bitbots_motion/bitbots_dynup/include/bitbots_dynup/visualizer.hpp @@ -1,13 +1,13 @@ #ifndef BITBOTS_DYNUP_INCLUDE_BITBOTS_DYNUP_VISUALIZER_H_ #define BITBOTS_DYNUP_INCLUDE_BITBOTS_DYNUP_VISUALIZER_H_ +#include #include #include #include #include #include #include -#include #include #include #include diff --git a/bitbots_motion/bitbots_head_mover/src/move_head.cpp b/bitbots_motion/bitbots_head_mover/src/move_head.cpp index 47f24d05c..01758e2eb 100644 --- a/bitbots_motion/bitbots_head_mover/src/move_head.cpp +++ b/bitbots_motion/bitbots_head_mover/src/move_head.cpp @@ -3,6 +3,7 @@ #include #include +#include #include #include #include @@ -10,7 +11,6 @@ #include #include #include -#include #include #include #include diff --git a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_engine.hpp b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_engine.hpp index afc46b373..5b9cf96cd 100644 --- a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_engine.hpp +++ b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_engine.hpp @@ -6,8 +6,8 @@ The original files can be found at: #ifndef BITBOTS_QUINTIC_WALK_INCLUDE_BITBOTS_QUINTIC_WALK_WALK_ENGINE_H_ #define BITBOTS_QUINTIC_WALK_INCLUDE_BITBOTS_QUINTIC_WALK_WALK_ENGINE_H_ +#include #include -#include #include #include #include diff --git a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_ik.hpp b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_ik.hpp index c71d492e9..20da32c54 100644 --- a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_ik.hpp +++ b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_ik.hpp @@ -1,7 +1,7 @@ #ifndef BITBOTS_QUINTIC_WALK_INCLUDE_BITBOTS_QUINTIC_WALK_WALK_IK_H_ #define BITBOTS_QUINTIC_WALK_INCLUDE_BITBOTS_QUINTIC_WALK_WALK_IK_H_ +#include #include -#include #include #include #include diff --git a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_node.hpp b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_node.hpp index 02945b294..9b847ba28 100644 --- a/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_node.hpp +++ b/bitbots_motion/bitbots_quintic_walk/include/bitbots_quintic_walk/walk_node.hpp @@ -14,11 +14,11 @@ The original files can be found at: #include #include #include +#include #include #include #include #include -#include #include #include #include diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/ObservationModel.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/ObservationModel.hpp index 30ecaf993..f6c53a97b 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/ObservationModel.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/ObservationModel.hpp @@ -8,9 +8,9 @@ #include #include +#include #include #include -#include #include #include #include diff --git a/bitbots_navigation/bitbots_localization/include/bitbots_localization/localization.hpp b/bitbots_navigation/bitbots_localization/include/bitbots_localization/localization.hpp index 95f3521a1..b0309060b 100644 --- a/bitbots_navigation/bitbots_localization/include/bitbots_localization/localization.hpp +++ b/bitbots_navigation/bitbots_localization/include/bitbots_localization/localization.hpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -35,7 +36,6 @@ #include #include #include -#include #include #include #include diff --git a/bitbots_navigation/bitbots_odometry/include/bitbots_odometry/motion_odometry.hpp b/bitbots_navigation/bitbots_odometry/include/bitbots_odometry/motion_odometry.hpp index 1819c4d9b..82cc247ed 100644 --- a/bitbots_navigation/bitbots_odometry/include/bitbots_odometry/motion_odometry.hpp +++ b/bitbots_navigation/bitbots_odometry/include/bitbots_odometry/motion_odometry.hpp @@ -4,9 +4,9 @@ #include #include +#include #include #include -#include #include #include #include From 971885dea748692d504a4ed6d832209163d47e25 Mon Sep 17 00:00:00 2001 From: Jan Gutsche Date: Sat, 1 Feb 2025 12:24:19 +0100 Subject: [PATCH 34/65] Some vscode settings --- .vscode/settings.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.vscode/settings.json b/.vscode/settings.json index aac9f7c1b..0fc7265f9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -238,4 +238,8 @@ "[json]": { "editor.defaultFormatter": "vscode.json-language-features" }, + "makefile.configureOnOpen": true, + "[jsonc]": { + "editor.defaultFormatter": "vscode.json-language-features" + }, } From 7334239b3aac6de64f8aee321dd971444e1fbc43 Mon Sep 17 00:00:00 2001 From: Jan Gutsche Date: Sat, 1 Feb 2025 12:24:46 +0100 Subject: [PATCH 35/65] CI: ignore setuptools warnings --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7882645e9..a3af0498b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,9 @@ on: - cron: '0 0 * * *' push: +env: + PYTHONWARNINGS: "ignore:::setuptools.command.install,ignore:::setuptools.command.easy_install,ignore:::pkg_resources,ignore:easy_install command is deprecated,ignore:setup.py install is deprecated" + jobs: build: runs-on: ubuntu-latest From e04c0a2f4523348fcc1affbc3ff6b92068bc6efa Mon Sep 17 00:00:00 2001 From: Jan Gutsche Date: Sat, 1 Feb 2025 12:24:58 +0100 Subject: [PATCH 36/65] Revert "Build control_toolbox from source. Revert after new version is released" This reverts commit 354024f604d814e1b45efbaf8fa4ef7d3dda07bf. --- workspace.repos | 4 ---- 1 file changed, 4 deletions(-) diff --git a/workspace.repos b/workspace.repos index 6b0e3aa45..672de0f73 100644 --- a/workspace.repos +++ b/workspace.repos @@ -23,10 +23,6 @@ repositories: type: git url: git@github.com:ros-sports/biped_interfaces.git version: rolling - lib/control_toolbox: - type: git - url: git@github.com:ros-controls/control_toolbox.git - version: ros2-master lib/dynamic_stack_decider: type: git url: git@github.com:bit-bots/dynamic_stack_decider.git From 931ed7bc814ada4c6b9368d59f7617b950da4b44 Mon Sep 17 00:00:00 2001 From: Florian Vahl <7vahl@informatik.uni-hamburg.de> Date: Thu, 6 Feb 2025 17:58:55 +0100 Subject: [PATCH 37/65] Fix mypy issues --- .../bitbots_animation_rqt/bitbots_animation_rqt/utils.py | 4 ++-- .../bitbots_webots_sim/webots_robot_controller.py | 8 ++++---- .../bitbots_webots_sim/webots_supervisor_controller.py | 2 +- .../bitbots_team_communication/mypy.ini | 1 + .../bitbots_ball_filter/ball_filter.py | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/bitbots_motion/bitbots_animation_rqt/bitbots_animation_rqt/utils.py b/bitbots_motion/bitbots_animation_rqt/bitbots_animation_rqt/utils.py index 6217bed78..688a2c8be 100644 --- a/bitbots_motion/bitbots_animation_rqt/bitbots_animation_rqt/utils.py +++ b/bitbots_motion/bitbots_animation_rqt/bitbots_animation_rqt/utils.py @@ -21,8 +21,8 @@ def dropEvent(self, e): # noqa: N802 # fmt: on super().dropEvent(e) items = [] - for i in range(0, self.count()): - items.append(self.item(i).text()) + for i in range(self.count()): + items.append(self.item(i).text()) # type: ignore[union-attr] self.frame_order_callback(items) # fmt: off diff --git a/bitbots_simulation/bitbots_webots_sim/bitbots_webots_sim/webots_robot_controller.py b/bitbots_simulation/bitbots_webots_sim/bitbots_webots_sim/webots_robot_controller.py index a16c6e99a..c158cb940 100644 --- a/bitbots_simulation/bitbots_webots_sim/bitbots_webots_sim/webots_robot_controller.py +++ b/bitbots_simulation/bitbots_webots_sim/bitbots_webots_sim/webots_robot_controller.py @@ -779,7 +779,7 @@ def get_joint_values(self, used_joint_names, scaled=False): def get_joint_state_msg(self): js = JointState() js.name = [] - js.header.stamp = Time(seconds=int(self.time), nanoseconds=self.time % 1 * 1e9).to_msg() + js.header.stamp = Time(seconds=int(self.time), nanoseconds=int(self.time % 1 * 1e9)).to_msg() js.position = [] js.effort = [] for joint_name in self.external_motor_names: @@ -796,7 +796,7 @@ def publish_joint_states(self): def get_imu_msg(self, head=False): msg = Imu() - msg.header.stamp = Time(seconds=int(self.time), nanoseconds=self.time % 1 * 1e9).to_msg() + msg.header.stamp = Time(seconds=int(self.time), nanoseconds=int(self.time % 1 * 1e9)).to_msg() if head: msg.header.frame_id = self.head_imu_frame else: @@ -841,7 +841,7 @@ def publish_imu(self): def publish_camera(self): img_msg = Image() - img_msg.header.stamp = Time(seconds=int(self.time), nanoseconds=self.time % 1 * 1e9).to_msg() + img_msg.header.stamp = Time(seconds=int(self.time), nanoseconds=int(self.time % 1 * 1e9)).to_msg() img_msg.header.frame_id = self.camera_optical_frame img_msg.height = self.camera.getHeight() img_msg.width = self.camera.getWidth() @@ -917,7 +917,7 @@ def get_image(self): return self.camera.getImage() def get_pressure_message(self): - current_time = Time(seconds=int(self.time), nanoseconds=self.time % 1 * 1e9).to_msg() + current_time = Time(seconds=int(self.time), nanoseconds=int(self.time % 1 * 1e9)).to_msg() if not self.foot_sensors_active or self.pressure_sensors is None: cop_r = PointStamped() cop_r.header.frame_id = self.r_sole_frame diff --git a/bitbots_simulation/bitbots_webots_sim/bitbots_webots_sim/webots_supervisor_controller.py b/bitbots_simulation/bitbots_webots_sim/bitbots_webots_sim/webots_supervisor_controller.py index cce9a575f..8ab69da26 100644 --- a/bitbots_simulation/bitbots_webots_sim/bitbots_webots_sim/webots_supervisor_controller.py +++ b/bitbots_simulation/bitbots_webots_sim/bitbots_webots_sim/webots_supervisor_controller.py @@ -193,7 +193,7 @@ def handle_gui(self): return key def publish_clock(self): - self.clock_msg.clock = Time(seconds=int(self.time), nanoseconds=self.time % 1 * 1e9).to_msg() + self.clock_msg.clock = Time(seconds=int(self.time), nanoseconds=int(self.time % 1 * 1e9)).to_msg() self.clock_publisher.publish(self.clock_msg) def set_gravity(self, active): diff --git a/bitbots_team_communication/bitbots_team_communication/mypy.ini b/bitbots_team_communication/bitbots_team_communication/mypy.ini index 6b19e8374..c5e6c4394 100644 --- a/bitbots_team_communication/bitbots_team_communication/mypy.ini +++ b/bitbots_team_communication/bitbots_team_communication/mypy.ini @@ -3,3 +3,4 @@ [mypy] check_untyped_defs = True ignore_missing_imports = True +exclude = .*_pb2\.py diff --git a/bitbots_world_model/bitbots_ball_filter/bitbots_ball_filter/ball_filter.py b/bitbots_world_model/bitbots_ball_filter/bitbots_ball_filter/ball_filter.py index f91316ab8..8d9a5e66c 100755 --- a/bitbots_world_model/bitbots_ball_filter/bitbots_ball_filter/ball_filter.py +++ b/bitbots_world_model/bitbots_ball_filter/bitbots_ball_filter/ball_filter.py @@ -206,7 +206,7 @@ def is_estimate_in_fov(self, header: Header) -> bool: # Transform to camera frame try: ball_in_camera_optical_frame = self.tf_buffer.transform( - ball_pose, self.camera_info.header.frame_id, timeout=Duration(nanoseconds=0.5 * (10**9)) + ball_pose, self.camera_info.header.frame_id, timeout=Duration(nanoseconds=int(0.5 * 1e9)) ) except (tf2.ConnectivityException, tf2.LookupException, tf2.ExtrapolationException) as e: self.logger.warning(str(e)) From d6bc1d6890c97658ca0b5cdd93837521a104b564 Mon Sep 17 00:00:00 2001 From: Florian Vahl <7vahl@informatik.uni-hamburg.de> Date: Thu, 6 Feb 2025 21:43:28 +0100 Subject: [PATCH 38/65] Fix mypy protobuf in team com --- .gitignore | 1 + .../bitbots_team_communication/CMakeLists.txt | 48 +++++++++++++----- .../converter/robocup_protocol_converter.py | 50 +++++++++---------- .../converter/state_to_message_converter.py | 4 +- .../bitbots_team_communication/mypy.ini | 4 +- .../test_message_to_team_data_converter.py | 10 ++-- .../test_robocup_protocol_converter.py | 6 +-- .../test_state_to_message_converter.py | 25 +++++----- 8 files changed, 88 insertions(+), 60 deletions(-) diff --git a/.gitignore b/.gitignore index 456656d14..86622ba02 100644 --- a/.gitignore +++ b/.gitignore @@ -222,6 +222,7 @@ doku/* /bitbots_team_communication/bitbots_team_communication/bitbots_team_communication/RobocupProtocol # Protobuf generated file /bitbots_team_communication/bitbots_team_communication/bitbots_team_communication/robocup_extension_pb2.py +/bitbots_team_communication/bitbots_team_communication/bitbots_team_communication/robocup_extension_pb2.pyi # Workspace git status file from the deploy tool **/workspace_status.json diff --git a/bitbots_team_communication/bitbots_team_communication/CMakeLists.txt b/bitbots_team_communication/bitbots_team_communication/CMakeLists.txt index 93f0dece8..6667b009b 100644 --- a/bitbots_team_communication/bitbots_team_communication/CMakeLists.txt +++ b/bitbots_team_communication/bitbots_team_communication/CMakeLists.txt @@ -6,19 +6,16 @@ find_package(ament_cmake_python REQUIRED) find_package(bitbots_docs REQUIRED) find_package(Protobuf REQUIRED) -protobuf_generate_python( - PROTO_PY bitbots_team_communication/RobocupProtocol/robocup_extension.proto) +add_custom_target(${PROJECT_NAME}_generate_proto ALL) -add_custom_target( - bitbots_team_communication ALL - DEPENDS ${PROTO_PY} - COMMENT "Generating protobuf") add_custom_command( - TARGET bitbots_team_communication - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${PROTO_PY} - ${CMAKE_SOURCE_DIR}/bitbots_team_communication - COMMENT "Copying protobuf to source dir") + TARGET ${PROJECT_NAME}_generate_proto + COMMAND protoc + --pyi_out ${CMAKE_SOURCE_DIR}/bitbots_team_communication/ + --python_out ${CMAKE_SOURCE_DIR}/bitbots_team_communication/ + --proto_path ${CMAKE_SOURCE_DIR}/bitbots_team_communication/RobocupProtocol + ${CMAKE_SOURCE_DIR}/bitbots_team_communication/RobocupProtocol/robocup_extension.proto + COMMENT "Generating protobuf python interface including stubs") enable_bitbots_docs() ament_python_install_package(${PROJECT_NAME}) @@ -50,7 +47,34 @@ if(BUILD_TESTING) endforeach() find_package(ament_cmake_mypy REQUIRED) - ament_mypy(CONFIG_FILE "${CMAKE_CURRENT_LIST_DIR}/mypy.ini") + + + # The following logic for manually filtering out the files can be removed if + # https://github.com/ament/ament_lint/pull/516 is merged and released in our ROS distro + + # Collect all .py and .pyi files + file(GLOB_RECURSE PY_FILES "${CMAKE_CURRENT_LIST_DIR}/**/*.py") + file(GLOB_RECURSE PYI_FILES "${CMAKE_CURRENT_LIST_DIR}/**/*.pyi") + + # Filter out .py files if a corresponding .pyi file exists + foreach(py_file IN LISTS PY_FILES) + # Get the directory and basename (without extension) + get_filename_component(py_dir "${py_file}" DIRECTORY) + get_filename_component(py_basename "${py_file}" NAME_WE) + + # Construct the corresponding .pyi file path + set(pyi_file "${py_dir}/${py_basename}.pyi") + + # If a corresponding .pyi file exists, remove the .py file from the list + if(EXISTS "${pyi_file}") + list(REMOVE_ITEM PY_FILES "${py_file}") + endif() + endforeach() + + ament_mypy( + CONFIG_FILE "${CMAKE_CURRENT_LIST_DIR}/mypy.ini" + ${PY_FILES} ${PYI_FILES} + ) endif() ament_package() diff --git a/bitbots_team_communication/bitbots_team_communication/bitbots_team_communication/converter/robocup_protocol_converter.py b/bitbots_team_communication/bitbots_team_communication/bitbots_team_communication/converter/robocup_protocol_converter.py index 68cb2eb3d..b3ca448c7 100644 --- a/bitbots_team_communication/bitbots_team_communication/bitbots_team_communication/converter/robocup_protocol_converter.py +++ b/bitbots_team_communication/bitbots_team_communication/bitbots_team_communication/converter/robocup_protocol_converter.py @@ -16,40 +16,40 @@ class TeamColor(IntEnum): class RobocupProtocolConverter: def __init__(self, own_team_color: TeamColor): self.role_mapping = ( - (Proto.Role.ROLE_UNDEFINED, Strategy.ROLE_UNDEFINED), - (Proto.Role.ROLE_IDLING, Strategy.ROLE_IDLING), - (Proto.Role.ROLE_OTHER, Strategy.ROLE_OTHER), - (Proto.Role.ROLE_STRIKER, Strategy.ROLE_STRIKER), - (Proto.Role.ROLE_SUPPORTER, Strategy.ROLE_SUPPORTER), - (Proto.Role.ROLE_DEFENDER, Strategy.ROLE_DEFENDER), - (Proto.Role.ROLE_GOALIE, Strategy.ROLE_GOALIE), + (Proto.ROLE_UNDEFINED, Strategy.ROLE_UNDEFINED), + (Proto.ROLE_IDLING, Strategy.ROLE_IDLING), + (Proto.ROLE_OTHER, Strategy.ROLE_OTHER), + (Proto.ROLE_STRIKER, Strategy.ROLE_STRIKER), + (Proto.ROLE_SUPPORTER, Strategy.ROLE_SUPPORTER), + (Proto.ROLE_DEFENDER, Strategy.ROLE_DEFENDER), + (Proto.ROLE_GOALIE, Strategy.ROLE_GOALIE), ) self.action_mapping = ( - (Proto.Action.ACTION_UNDEFINED, Strategy.ACTION_UNDEFINED), - (Proto.Action.ACTION_POSITIONING, Strategy.ACTION_POSITIONING), - (Proto.Action.ACTION_GOING_TO_BALL, Strategy.ACTION_GOING_TO_BALL), - (Proto.Action.ACTION_TRYING_TO_SCORE, Strategy.ACTION_TRYING_TO_SCORE), - (Proto.Action.ACTION_WAITING, Strategy.ACTION_WAITING), - (Proto.Action.ACTION_KICKING, Strategy.ACTION_KICKING), - (Proto.Action.ACTION_SEARCHING, Strategy.ACTION_SEARCHING), - (Proto.Action.ACTION_LOCALIZING, Strategy.ACTION_LOCALIZING), + (Proto.ACTION_UNDEFINED, Strategy.ACTION_UNDEFINED), + (Proto.ACTION_POSITIONING, Strategy.ACTION_POSITIONING), + (Proto.ACTION_GOING_TO_BALL, Strategy.ACTION_GOING_TO_BALL), + (Proto.ACTION_TRYING_TO_SCORE, Strategy.ACTION_TRYING_TO_SCORE), + (Proto.ACTION_WAITING, Strategy.ACTION_WAITING), + (Proto.ACTION_KICKING, Strategy.ACTION_KICKING), + (Proto.ACTION_SEARCHING, Strategy.ACTION_SEARCHING), + (Proto.ACTION_LOCALIZING, Strategy.ACTION_LOCALIZING), ) self.side_mapping = ( - (Proto.OffensiveSide.SIDE_UNDEFINED, Strategy.SIDE_UNDEFINED), - (Proto.OffensiveSide.SIDE_LEFT, Strategy.SIDE_LEFT), - (Proto.OffensiveSide.SIDE_MIDDLE, Strategy.SIDE_MIDDLE), - (Proto.OffensiveSide.SIDE_RIGHT, Strategy.SIDE_RIGHT), + (Proto.SIDE_UNDEFINED, Strategy.SIDE_UNDEFINED), + (Proto.SIDE_LEFT, Strategy.SIDE_LEFT), + (Proto.SIDE_MIDDLE, Strategy.SIDE_MIDDLE), + (Proto.SIDE_RIGHT, Strategy.SIDE_RIGHT), ) self.proto_to_team_data_team_mapping = { - Proto.Team.UNKNOWN_TEAM: RobotRelative.ROBOT_UNDEFINED, - Proto.Team.BLUE: RobotRelative.ROBOT_BLUE, - Proto.Team.RED: RobotRelative.ROBOT_RED, + Proto.UNKNOWN_TEAM: RobotRelative.ROBOT_UNDEFINED, + Proto.BLUE: RobotRelative.ROBOT_BLUE, + Proto.RED: RobotRelative.ROBOT_RED, } self.state_to_proto_team_mapping = { - RobotAttributes.TEAM_OWN: Proto.Team.RED if own_team_color == TeamColor.RED else Proto.Team.BLUE, - RobotAttributes.TEAM_OPPONENT: Proto.Team.BLUE if own_team_color == TeamColor.RED else Proto.Team.RED, - RobotAttributes.TEAM_UNKNOWN: Proto.Team.UNKNOWN_TEAM, + RobotAttributes.TEAM_OWN: Proto.RED if own_team_color == TeamColor.RED else Proto.BLUE, + RobotAttributes.TEAM_OPPONENT: Proto.BLUE if own_team_color == TeamColor.RED else Proto.RED, + RobotAttributes.TEAM_UNKNOWN: Proto.UNKNOWN_TEAM, } proto_to_team_data_mappings = { diff --git a/bitbots_team_communication/bitbots_team_communication/bitbots_team_communication/converter/state_to_message_converter.py b/bitbots_team_communication/bitbots_team_communication/bitbots_team_communication/converter/state_to_message_converter.py index e41d2e9a0..41ea6a62e 100644 --- a/bitbots_team_communication/bitbots_team_communication/bitbots_team_communication/converter/state_to_message_converter.py +++ b/bitbots_team_communication/bitbots_team_communication/bitbots_team_communication/converter/state_to_message_converter.py @@ -25,9 +25,9 @@ def convert( ) -> Proto.Message: def convert_gamestate(gamestate: Optional[GameState], message: Proto.Message): if gamestate is not None and is_still_valid_checker(gamestate.header.stamp): - message.state = Proto.State.PENALISED if gamestate.penalized else Proto.State.UNPENALISED + message.state = Proto.PENALISED if gamestate.penalized else Proto.UNPENALISED else: - message.state = Proto.State.UNKNOWN_STATE + message.state = Proto.UNKNOWN_STATE return message diff --git a/bitbots_team_communication/bitbots_team_communication/mypy.ini b/bitbots_team_communication/bitbots_team_communication/mypy.ini index c5e6c4394..6f30984fe 100644 --- a/bitbots_team_communication/bitbots_team_communication/mypy.ini +++ b/bitbots_team_communication/bitbots_team_communication/mypy.ini @@ -3,4 +3,6 @@ [mypy] check_untyped_defs = True ignore_missing_imports = True -exclude = .*_pb2\.py + +# Ignore var-annotations because it is in autogenerated code from protobuf +disable_error_code = var-annotated diff --git a/bitbots_team_communication/bitbots_team_communication/test/converter/test_message_to_team_data_converter.py b/bitbots_team_communication/bitbots_team_communication/test/converter/test_message_to_team_data_converter.py index e98bedd7c..31c606c37 100644 --- a/bitbots_team_communication/bitbots_team_communication/test/converter/test_message_to_team_data_converter.py +++ b/bitbots_team_communication/bitbots_team_communication/test/converter/test_message_to_team_data_converter.py @@ -60,9 +60,9 @@ def convert_from_message(message: Proto.Message, team_data: TeamData | None = No @pytest.fixture def message_with_strategy(message) -> Proto.Message: - message.role = Proto.Role.ROLE_STRIKER - message.action = Proto.Action.ACTION_KICKING - message.offensive_side = Proto.OffensiveSide.SIDE_RIGHT + message.role = Proto.ROLE_STRIKER + message.action = Proto.ACTION_KICKING + message.offensive_side = Proto.SIDE_RIGHT return message @@ -111,9 +111,9 @@ def message() -> Proto.Message: def robot_message(player_id, is_own_team): robot = Proto.Robot() robot.player_id = player_id - robot.team = own_team_id + robot.team = own_team_id # type: ignore[assignment] if not is_own_team: - robot.team = own_team_id + 1 + robot.team = own_team_id + 1 # type: ignore[assignment] set_position(robot.position) set_covariance_matrix(robot.covariance) diff --git a/bitbots_team_communication/bitbots_team_communication/test/converter/test_robocup_protocol_converter.py b/bitbots_team_communication/bitbots_team_communication/test/converter/test_robocup_protocol_converter.py index c776238f4..59e5b83e8 100644 --- a/bitbots_team_communication/bitbots_team_communication/test/converter/test_robocup_protocol_converter.py +++ b/bitbots_team_communication/bitbots_team_communication/test/converter/test_robocup_protocol_converter.py @@ -20,9 +20,9 @@ def test_setup_of_mappings(snapshot): def test_setup_of_team_color_mapping(snapshot): converter = protocol_converter() - assert converter.state_to_proto_team_mapping[RobotAttributes.TEAM_OWN] == Proto.Team.BLUE - assert converter.state_to_proto_team_mapping[RobotAttributes.TEAM_OPPONENT] == Proto.Team.RED - assert converter.state_to_proto_team_mapping[RobotAttributes.TEAM_UNKNOWN] == Proto.Team.UNKNOWN_TEAM + assert converter.state_to_proto_team_mapping[RobotAttributes.TEAM_OWN] == Proto.BLUE + assert converter.state_to_proto_team_mapping[RobotAttributes.TEAM_OPPONENT] == Proto.RED + assert converter.state_to_proto_team_mapping[RobotAttributes.TEAM_UNKNOWN] == Proto.UNKNOWN_TEAM assert converter.proto_to_team_data_team_mapping == snapshot diff --git a/bitbots_team_communication/bitbots_team_communication/test/converter/test_state_to_message_converter.py b/bitbots_team_communication/bitbots_team_communication/test/converter/test_state_to_message_converter.py index b3513245a..16d8511f7 100644 --- a/bitbots_team_communication/bitbots_team_communication/test/converter/test_state_to_message_converter.py +++ b/bitbots_team_communication/bitbots_team_communication/test/converter/test_state_to_message_converter.py @@ -1,3 +1,4 @@ +from typing import Optional from unittest.mock import Mock import numpy @@ -44,11 +45,11 @@ def test_convert_gamestate(state_with_gamestate): gamestate.penalized = False result = convert_to_message(state_with_gamestate) - assert result.state == Proto.State.UNPENALISED + assert result.state == Proto.UNPENALISED gamestate.penalized = True result = convert_to_message(state_with_gamestate) - assert result.state == Proto.State.PENALISED + assert result.state == Proto.PENALISED assert validity_checker_valid.call_count == 2 validity_checker_valid.assert_called_with(gamestate.header.stamp) @@ -56,11 +57,11 @@ def test_convert_gamestate(state_with_gamestate): def test_convert_gamestate_expired_headers(state_with_gamestate): message = Proto.Message() - message.state = Proto.State.UNPENALISED + message.state = Proto.UNPENALISED result = convert_to_message(state_with_gamestate, message, is_state_expired=True) - assert result.state == Proto.State.UNKNOWN_STATE + assert result.state == Proto.UNKNOWN_STATE def test_convert_current_pose(snapshot, state_with_current_pose): @@ -164,22 +165,22 @@ def test_convert_obstacles_to_robots_expired_headers(state_with_seen_robots): def test_convert_strategy(state_with_strategy): result = convert_to_message(state_with_strategy) - assert result.role == Proto.Role.ROLE_STRIKER - assert result.action == Proto.Action.ACTION_KICKING - assert result.offensive_side == Proto.OffensiveSide.SIDE_RIGHT + assert result.role == Proto.ROLE_STRIKER + assert result.action == Proto.ACTION_KICKING + assert result.offensive_side == Proto.SIDE_RIGHT validity_checker_valid.assert_called_with(state_with_strategy.strategy_time) def test_convert_strategy_expired_headers(state_with_strategy): message = Proto.Message() - message.role = Proto.Role.ROLE_DEFENDER + message.role = Proto.ROLE_DEFENDER result = convert_to_message(state_with_strategy, message, is_state_expired=True) - assert result.role == Proto.Role.ROLE_DEFENDER - assert result.action == Proto.Action.ACTION_UNDEFINED - assert result.offensive_side == Proto.OffensiveSide.SIDE_UNDEFINED + assert result.role == Proto.ROLE_DEFENDER + assert result.action == Proto.ACTION_UNDEFINED + assert result.offensive_side == Proto.SIDE_UNDEFINED def test_convert_time_to_ball(state_with_time_to_ball): @@ -208,7 +209,7 @@ def test_convert_time_to_ball_expired_headers(state_with_time_to_ball): assert pytest.approx(result.time_to_ball) == 9999.0 -def convert_to_message(team_data_state, message: Proto.Message = None, is_state_expired=False): +def convert_to_message(team_data_state, message: Optional[Proto.Message] = None, is_state_expired=False): message = message if message else Proto.Message() validity_checker = validity_checker_expired if is_state_expired else validity_checker_valid return RobocupProtocolConverter(own_team_color).convert_to_message(team_data_state, message, validity_checker) From d6338e8095ada0bdb3c6b113f25bdfb365cf1f60 Mon Sep 17 00:00:00 2001 From: Florian Vahl <7vahl@informatik.uni-hamburg.de> Date: Thu, 6 Feb 2025 21:44:27 +0100 Subject: [PATCH 39/65] Fix cmake formatting --- .../bitbots_team_communication/CMakeLists.txt | 51 ++++++++++--------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/bitbots_team_communication/bitbots_team_communication/CMakeLists.txt b/bitbots_team_communication/bitbots_team_communication/CMakeLists.txt index 6667b009b..7066585ea 100644 --- a/bitbots_team_communication/bitbots_team_communication/CMakeLists.txt +++ b/bitbots_team_communication/bitbots_team_communication/CMakeLists.txt @@ -6,15 +6,20 @@ find_package(ament_cmake_python REQUIRED) find_package(bitbots_docs REQUIRED) find_package(Protobuf REQUIRED) -add_custom_target(${PROJECT_NAME}_generate_proto ALL) +add_custom_target( + ${PROJECT_NAME}_generate_proto ALL + COMMENT "Generating protobuf python interface including stubs") + +set(PROTO_FILES + bitbots_team_communication/RobocupProtocol/robocup_extension.proto) add_custom_command( TARGET ${PROJECT_NAME}_generate_proto - COMMAND protoc - --pyi_out ${CMAKE_SOURCE_DIR}/bitbots_team_communication/ - --python_out ${CMAKE_SOURCE_DIR}/bitbots_team_communication/ - --proto_path ${CMAKE_SOURCE_DIR}/bitbots_team_communication/RobocupProtocol - ${CMAKE_SOURCE_DIR}/bitbots_team_communication/RobocupProtocol/robocup_extension.proto + COMMAND + protoc --pyi_out ${CMAKE_SOURCE_DIR}/bitbots_team_communication/ + --python_out ${CMAKE_SOURCE_DIR}/bitbots_team_communication/ --proto_path + ${CMAKE_SOURCE_DIR}/bitbots_team_communication/RobocupProtocol + ${CMAKE_SOURCE_DIR}/${PROTO_FILES} COMMENT "Generating protobuf python interface including stubs") enable_bitbots_docs() @@ -48,33 +53,31 @@ if(BUILD_TESTING) find_package(ament_cmake_mypy REQUIRED) + # The following logic for manually filtering out the files can be removed if + # https://github.com/ament/ament_lint/pull/516 is merged and released in our + # ROS distro - # The following logic for manually filtering out the files can be removed if - # https://github.com/ament/ament_lint/pull/516 is merged and released in our ROS distro - # Collect all .py and .pyi files file(GLOB_RECURSE PY_FILES "${CMAKE_CURRENT_LIST_DIR}/**/*.py") file(GLOB_RECURSE PYI_FILES "${CMAKE_CURRENT_LIST_DIR}/**/*.pyi") # Filter out .py files if a corresponding .pyi file exists foreach(py_file IN LISTS PY_FILES) - # Get the directory and basename (without extension) - get_filename_component(py_dir "${py_file}" DIRECTORY) - get_filename_component(py_basename "${py_file}" NAME_WE) - - # Construct the corresponding .pyi file path - set(pyi_file "${py_dir}/${py_basename}.pyi") - - # If a corresponding .pyi file exists, remove the .py file from the list - if(EXISTS "${pyi_file}") - list(REMOVE_ITEM PY_FILES "${py_file}") - endif() + # Get the directory and basename (without extension) + get_filename_component(py_dir "${py_file}" DIRECTORY) + get_filename_component(py_basename "${py_file}" NAME_WE) + + # Construct the corresponding .pyi file path + set(PYI_FILE "${py_dir}/${py_basename}.pyi") + + # If a corresponding .pyi file exists, remove the .py file from the list + if(EXISTS "${PYI_FILE}") + list(REMOVE_ITEM PY_FILES "${py_file}") + endif() endforeach() - ament_mypy( - CONFIG_FILE "${CMAKE_CURRENT_LIST_DIR}/mypy.ini" - ${PY_FILES} ${PYI_FILES} - ) + ament_mypy(CONFIG_FILE "${CMAKE_CURRENT_LIST_DIR}/mypy.ini" ${PY_FILES} + ${PYI_FILES}) endif() ament_package() From 20845eb506753586e2cca73b412237959ed2556e Mon Sep 17 00:00:00 2001 From: texhnolyze Date: Thu, 13 Feb 2025 15:57:59 +0100 Subject: [PATCH 40/65] refactor(control_toolbox): fix deprecated PID methods after changes in ros-controls/control_toolbox#246 --- bitbots_motion/bitbots_dynamic_kick/src/stabilizer.cpp | 8 ++++---- bitbots_motion/bitbots_dynup/src/dynup_stabilizer.cpp | 8 ++++---- .../bitbots_quintic_walk/src/walk_stabilizer.cpp | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/bitbots_motion/bitbots_dynamic_kick/src/stabilizer.cpp b/bitbots_motion/bitbots_dynamic_kick/src/stabilizer.cpp index 84320bfaf..d74688364 100644 --- a/bitbots_motion/bitbots_dynamic_kick/src/stabilizer.cpp +++ b/bitbots_motion/bitbots_dynamic_kick/src/stabilizer.cpp @@ -23,8 +23,8 @@ Stabilizer::Stabilizer(std::string ns) { pid_trunk_fused_pitch_ = std::make_shared(pitch_node_, ""); pid_trunk_fused_roll_ = std::make_shared(roll_node_, ""); - pid_trunk_fused_pitch_->initPid(); - pid_trunk_fused_roll_->initPid(); + pid_trunk_fused_pitch_->initialize_from_ros_parameters(); + pid_trunk_fused_roll_->initialize_from_ros_parameters(); reset(); } @@ -51,8 +51,8 @@ KickPositions Stabilizer::stabilize(const KickPositions &positions, const rclcpp cop_x_error = cop_x - positions.trunk_pose.translation().x(); cop_y_error = cop_y - positions.trunk_pose.translation().y(); - double x_correction = pid_trunk_fused_roll_->computeCommand(cop_x_error, dt); - double y_correction = pid_trunk_fused_pitch_->computeCommand(cop_y_error, dt); + double x_correction = pid_trunk_fused_roll_->compute_command(cop_x_error, dt); + double y_correction = pid_trunk_fused_pitch_->compute_command(cop_y_error, dt); stabilized_positions.trunk_pose.translation().x() += x_correction; stabilized_positions.trunk_pose.translation().y() += y_correction; diff --git a/bitbots_motion/bitbots_dynup/src/dynup_stabilizer.cpp b/bitbots_motion/bitbots_dynup/src/dynup_stabilizer.cpp index a44f34d15..92cb29805 100644 --- a/bitbots_motion/bitbots_dynup/src/dynup_stabilizer.cpp +++ b/bitbots_motion/bitbots_dynup/src/dynup_stabilizer.cpp @@ -6,8 +6,8 @@ Stabilizer::Stabilizer(rclcpp::Node::SharedPtr node, bitbots_dynup::Params::Stab : params_(params), pid_trunk_pitch_(node, "stabilizer.trunk_pid.pitch"), pid_trunk_roll_(node, "stabilizer.trunk_pid.roll") { - pid_trunk_pitch_.initPid(); - pid_trunk_roll_.initPid(); + pid_trunk_pitch_.initialize_from_ros_parameters(); + pid_trunk_roll_.initialize_from_ros_parameters(); reset(); } @@ -43,8 +43,8 @@ DynupResponse Stabilizer::stabilize(const DynupResponse &ik_goals, const rclcpp: // Adapt trunk based on PID controller goal_fused.fusedPitch += - pid_trunk_pitch_.computeCommand(goal_fused.fusedPitch - current_orientation.fusedPitch, dt); - goal_fused.fusedRoll += pid_trunk_roll_.computeCommand(goal_fused.fusedRoll - current_orientation.fusedRoll, dt); + pid_trunk_pitch_.compute_command(goal_fused.fusedPitch - current_orientation.fusedPitch, dt); + goal_fused.fusedRoll += pid_trunk_roll_.compute_command(goal_fused.fusedRoll - current_orientation.fusedRoll, dt); // Check if the trunk is stable, meaning it isn't leaning too much // TODO it would be better to use the rotational velocity of the imu to determine stability diff --git a/bitbots_motion/bitbots_quintic_walk/src/walk_stabilizer.cpp b/bitbots_motion/bitbots_quintic_walk/src/walk_stabilizer.cpp index 7a54551a5..abf539ae1 100644 --- a/bitbots_motion/bitbots_quintic_walk/src/walk_stabilizer.cpp +++ b/bitbots_motion/bitbots_quintic_walk/src/walk_stabilizer.cpp @@ -4,8 +4,8 @@ namespace bitbots_quintic_walk { WalkStabilizer::WalkStabilizer(rclcpp::Node::SharedPtr node) : pid_trunk_fused_pitch_(node, "node.trunk_pid.pitch"), pid_trunk_fused_roll_(node, "node.trunk_pid.roll") { - pid_trunk_fused_pitch_.initPid(); - pid_trunk_fused_roll_.initPid(); + pid_trunk_fused_pitch_.initialize_from_ros_parameters(); + pid_trunk_fused_roll_.initialize_from_ros_parameters(); reset(); } @@ -29,9 +29,9 @@ WalkResponse WalkStabilizer::stabilize(const WalkResponse& response, const rclcp // adapt trunk values based on PID controllers double fused_roll_correction = - pid_trunk_fused_roll_.computeCommand(goal_fused.fusedRoll - response.current_fused_roll, dt); + pid_trunk_fused_roll_.compute_command(goal_fused.fusedRoll - response.current_fused_roll, dt); double fused_pitch_correction = - pid_trunk_fused_pitch_.computeCommand(goal_fused.fusedPitch - response.current_fused_pitch, dt); + pid_trunk_fused_pitch_.compute_command(goal_fused.fusedPitch - response.current_fused_pitch, dt); // Change trunk x offset (in the trunks frame of reference) based on the PID controllers WalkResponse stabilized_response{response}; From 3376aef2523c8f000009fe5e7a9881b222f5a904 Mon Sep 17 00:00:00 2001 From: texhnolyze Date: Thu, 13 Feb 2025 16:01:01 +0100 Subject: [PATCH 41/65] style(pre-commit): update repos and lint --- .pre-commit-config.yaml | 4 ++-- .../capsules/world_model_capsule.py | 9 +++------ .../bitbots_ros_control/scripts/pose_check.py | 2 +- bitbots_misc/bitbots_utils/bitbots_utils/utils.py | 2 +- .../scripts/motor_goals_viz_helper.py | 4 ++-- .../bitbots_animation_rqt/animation_recording.py | 8 ++++---- .../bitbots_hcm/hcm_dsd/actions/play_animation.py | 12 ++++++------ .../bitbots_hcm/hcm_dsd/actions/wait_for.py | 2 +- .../bitbots_hcm/hcm_dsd/decisions/animation.py | 6 +++--- .../bitbots_localization/CMakeLists.txt | 5 ++++- .../localization_dsd/localization_blackboard.py | 10 +++++----- .../bitbots_webots_sim/scripts/imu_lut_gen.py | 4 ++-- .../converter/message_to_team_data_converter.py | 2 +- .../bitbots_vision/vision_modules/debug.py | 3 ++- .../vision_modules/yoeo/detectors.py | 3 +-- .../vision_modules/yoeo/yoeo_handlers.py | 15 +++++++-------- bitbots_vision/scripts/extract_from_rosbag.py | 2 +- scripts/deploy/misc.py | 3 ++- scripts/deploy/tasks/check_repos.py | 4 ++-- scripts/deploy/tasks/install.py | 6 +++--- scripts/robot_compile.py | 7 +++---- 21 files changed, 56 insertions(+), 57 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5aa99cc34..8f6e20745 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.6 + rev: v0.9.6 hooks: - id: ruff args: @@ -22,7 +22,7 @@ repos: - "--suppress=unusedStructMember" - "--suppress=useStlAlgorithm" - repo: https://github.com/cheshirekow/cmake-format-precommit - rev: v0.6.10 + rev: v0.6.13 hooks: - id: cmake-format - id: cmake-lint diff --git a/bitbots_behavior/bitbots_blackboard/bitbots_blackboard/capsules/world_model_capsule.py b/bitbots_behavior/bitbots_blackboard/bitbots_blackboard/capsules/world_model_capsule.py index d1a9f47ab..caa4589c2 100644 --- a/bitbots_behavior/bitbots_blackboard/bitbots_blackboard/capsules/world_model_capsule.py +++ b/bitbots_behavior/bitbots_blackboard/bitbots_blackboard/capsules/world_model_capsule.py @@ -21,16 +21,13 @@ from bitbots_blackboard.capsules import AbstractBlackboardCapsule -class WorldModelTFError(Exception): - ... +class WorldModelTFError(Exception): ... -class WorldModelPositionTFError(WorldModelTFError): - ... +class WorldModelPositionTFError(WorldModelTFError): ... -class WorldModelBallTFError(WorldModelTFError): - ... +class WorldModelBallTFError(WorldModelTFError): ... class WorldModelCapsule(AbstractBlackboardCapsule): diff --git a/bitbots_lowlevel/bitbots_ros_control/scripts/pose_check.py b/bitbots_lowlevel/bitbots_ros_control/scripts/pose_check.py index 28e7ea4ec..01b3f34bb 100755 --- a/bitbots_lowlevel/bitbots_ros_control/scripts/pose_check.py +++ b/bitbots_lowlevel/bitbots_ros_control/scripts/pose_check.py @@ -44,7 +44,7 @@ def num_to_emoji(num: int) -> str: emoji_numbers = ["0️⃣", "1️⃣", "2️⃣", "3️⃣", "4️⃣", "5️⃣", "6️⃣", "7️⃣", "8️⃣", "9️⃣"] - return f'{"".join([emoji_numbers[int(digit)] for digit in str(num)])} ' + return f"{''.join([emoji_numbers[int(digit)] for digit in str(num)])} " def move_to_joint_position(publisher: Publisher, joint_goals: dict[str, float], offsets=True): diff --git a/bitbots_misc/bitbots_utils/bitbots_utils/utils.py b/bitbots_misc/bitbots_utils/bitbots_utils/utils.py index ac338987a..693a92ad0 100644 --- a/bitbots_misc/bitbots_utils/bitbots_utils/utils.py +++ b/bitbots_misc/bitbots_utils/bitbots_utils/utils.py @@ -56,7 +56,7 @@ def get_parameters_from_ros_yaml(node_name: str, parameter_file: str, use_wildca if param_keys == []: raise RuntimeError( - f"Param file does not contain parameters for {node_name}, " f" only for nodes: {param_file.keys()}" + f"Param file does not contain parameters for {node_name}, only for nodes: {param_file.keys()}" ) param_dict = {} for k in param_keys: diff --git a/bitbots_misc/bitbots_utils/scripts/motor_goals_viz_helper.py b/bitbots_misc/bitbots_utils/scripts/motor_goals_viz_helper.py index a8221e942..49d563501 100755 --- a/bitbots_misc/bitbots_utils/scripts/motor_goals_viz_helper.py +++ b/bitbots_misc/bitbots_utils/scripts/motor_goals_viz_helper.py @@ -68,11 +68,11 @@ def __init__(self): float(0), 0.7, float(-1), - float(-0.4), + -0.4, float(0), float(0), float(0), - float(-0.7), + -0.7, float(1), 0.4, float(0), diff --git a/bitbots_motion/bitbots_animation_rqt/bitbots_animation_rqt/animation_recording.py b/bitbots_motion/bitbots_animation_rqt/bitbots_animation_rqt/animation_recording.py index 075036004..24c5fe077 100644 --- a/bitbots_motion/bitbots_animation_rqt/bitbots_animation_rqt/animation_recording.py +++ b/bitbots_motion/bitbots_animation_rqt/bitbots_animation_rqt/animation_recording.py @@ -240,7 +240,7 @@ def save_animation(self, path: str, file_name: Optional[str] = None) -> str: with open(path, "w") as fp: json.dump(animation_dict, fp, sort_keys=True, indent=4) - return "Saving to '%s'" % path + ". Done." + return f"Saving to '{path}'. Done." def load_animation(self, path: str) -> Optional[str]: """Record command, load a animation '.json' file @@ -298,9 +298,9 @@ def play(self, from_frame: int = 0, until_frame: int = -1) -> tuple[str, bool]: else: # Check if the given frame id is in bounds assert until_frame > 0, "Upper bound must be positive" - assert until_frame <= len( - self.current_state.key_frames - ), "Upper bound must be less than or equal to the number of frames" + assert until_frame <= len(self.current_state.key_frames), ( + "Upper bound must be less than or equal to the number of frames" + ) assert from_frame >= 0, "Lower bound must be positive" # Create name for the temporary animation that is send to the animation server diff --git a/bitbots_motion/bitbots_hcm/bitbots_hcm/hcm_dsd/actions/play_animation.py b/bitbots_motion/bitbots_hcm/bitbots_hcm/hcm_dsd/actions/play_animation.py index 882ae4624..a9bc34640 100644 --- a/bitbots_motion/bitbots_hcm/bitbots_hcm/hcm_dsd/actions/play_animation.py +++ b/bitbots_motion/bitbots_hcm/bitbots_hcm/hcm_dsd/actions/play_animation.py @@ -88,9 +88,9 @@ def animation_feedback_cb(self, msg): self.publish_debug_data("Animation Percent Done", str(feedback.percent_done)) def animation_finished(self): - assert ( - self.blackboard.animation_action_current_goal is not None - ), "No animation action goal set, so we cannot check if it is finished" + assert self.blackboard.animation_action_current_goal is not None, ( + "No animation action goal set, so we cannot check if it is finished" + ) return ( self.blackboard.animation_action_current_goal.done() and self.blackboard.animation_action_current_goal.result().status @@ -248,9 +248,9 @@ def animation_feedback_cb(self, msg): self.publish_debug_data("Dynup Percent Done", str(feedback.percent_done)) def animation_finished(self): - assert ( - self.blackboard.dynup_action_current_goal is not None - ), "No dynup action goal set, so we cannot check if it is finished" + assert self.blackboard.dynup_action_current_goal is not None, ( + "No dynup action goal set, so we cannot check if it is finished" + ) return ( self.blackboard.dynup_action_current_goal.done() and self.blackboard.dynup_action_current_goal.result().status diff --git a/bitbots_motion/bitbots_hcm/bitbots_hcm/hcm_dsd/actions/wait_for.py b/bitbots_motion/bitbots_hcm/bitbots_hcm/hcm_dsd/actions/wait_for.py index 25705eac8..b8ddd4d91 100644 --- a/bitbots_motion/bitbots_hcm/bitbots_hcm/hcm_dsd/actions/wait_for.py +++ b/bitbots_motion/bitbots_hcm/bitbots_hcm/hcm_dsd/actions/wait_for.py @@ -52,6 +52,6 @@ class WaitForMotors(AbstractHCMActionElement): def perform(self, reevaluate=False): self.blackboard.node.get_logger().warn( - "HCM gets no data from the motors (/joint_states). Waiting for the motors to " "connect.", + "HCM gets no data from the motors (/joint_states). Waiting for the motors to connect.", throttle_duration_sec=10, ) diff --git a/bitbots_motion/bitbots_hcm/bitbots_hcm/hcm_dsd/decisions/animation.py b/bitbots_motion/bitbots_hcm/bitbots_hcm/hcm_dsd/decisions/animation.py index c7072a5c0..99d94e234 100644 --- a/bitbots_motion/bitbots_hcm/bitbots_hcm/hcm_dsd/decisions/animation.py +++ b/bitbots_motion/bitbots_hcm/bitbots_hcm/hcm_dsd/decisions/animation.py @@ -29,9 +29,9 @@ def perform(self, reevaluate=False): # We can safely assume that the last animation start time is set because the animation is running # Calculate time since last animation start - assert ( - self.blackboard.last_animation_start_time is not None - ), "Last animation start time is not set, this should be impossible" + assert self.blackboard.last_animation_start_time is not None, ( + "Last animation start time is not set, this should be impossible" + ) time_delta_since_last_animation_start = ( self.blackboard.node.get_clock().now().nanoseconds / 1e9 - self.blackboard.last_animation_start_time.nanoseconds / 1e9 diff --git a/bitbots_navigation/bitbots_localization/CMakeLists.txt b/bitbots_navigation/bitbots_localization/CMakeLists.txt index 4eadc1f07..595009865 100644 --- a/bitbots_navigation/bitbots_localization/CMakeLists.txt +++ b/bitbots_navigation/bitbots_localization/CMakeLists.txt @@ -15,7 +15,10 @@ find_package(ament_cmake REQUIRED) find_package(ament_index_cpp REQUIRED) find_package(backward_ros REQUIRED) find_package(bitbots_utils REQUIRED) -find_package(Boost COMPONENTS filesystem REQUIRED) +find_package( + Boost + COMPONENTS filesystem + REQUIRED) find_package(builtin_interfaces REQUIRED) find_package(cv_bridge REQUIRED) find_package(generate_parameter_library REQUIRED) diff --git a/bitbots_navigation/bitbots_localization_handler/bitbots_localization_handler/localization_dsd/localization_blackboard.py b/bitbots_navigation/bitbots_localization_handler/bitbots_localization_handler/localization_dsd/localization_blackboard.py index 5e9341c92..27d442cb9 100644 --- a/bitbots_navigation/bitbots_localization_handler/bitbots_localization_handler/localization_dsd/localization_blackboard.py +++ b/bitbots_navigation/bitbots_localization_handler/bitbots_localization_handler/localization_dsd/localization_blackboard.py @@ -1,4 +1,4 @@ -from typing import Optional, Type +from typing import Optional import numpy as np import tf2_ros as tf2 @@ -55,18 +55,18 @@ def __init__(self, node: Node): self.last_state_get_up = False # IMU - self.accel: Float[np.ndarray, "3"] = np.array([0.0, 0.0, 0.0]) + self.accel: Float[np.ndarray, 3] = np.array([0.0, 0.0, 0.0]) self.imu_orientation = Quaternion(w=1.0) # Falling odometry / imu interpolation during falls self.imu_yaw_before_fall: float = 0.0 # Picked up - self.pickup_accel_buffer: list[Float[np.ndarray, "3"]] = [] - self.pickup_accel_buffer_long: list[Float[np.ndarray, "3"]] = [] + self.pickup_accel_buffer: list[Float[np.ndarray, 3]] = [] + self.pickup_accel_buffer_long: list[Float[np.ndarray, 3]] = [] # Last init action - self.last_init_action_type: Optional[Type] = None + self.last_init_action_type: Optional[type] = None self.last_init_odom_transform: TransformStamped | None = None def _callback_pose(self, msg: PoseWithCovarianceStamped): diff --git a/bitbots_simulation/bitbots_webots_sim/scripts/imu_lut_gen.py b/bitbots_simulation/bitbots_webots_sim/scripts/imu_lut_gen.py index 65f98713b..bc594d1b3 100644 --- a/bitbots_simulation/bitbots_webots_sim/scripts/imu_lut_gen.py +++ b/bitbots_simulation/bitbots_webots_sim/scripts/imu_lut_gen.py @@ -4,13 +4,13 @@ def noise_table(my_min, noise, iters, indent): for i in range(iters): val = my_min / 2**i print(indent * " ", end="") - print(f" {val:f} {val:f} {noise/-val:f},") + print(f" {val:f} {val:f} {noise / -val:f},") print(indent * " ", end="") print(" 0 0 0") for i in range(iters): val = -my_min / 2 ** (iters - i - 1) print(indent * " ", end="") - print(f" {val:f} {val:f} {noise/val:f},") + print(f" {val:f} {val:f} {noise / val:f},") print(indent * " ", end="") print("]") diff --git a/bitbots_team_communication/bitbots_team_communication/bitbots_team_communication/converter/message_to_team_data_converter.py b/bitbots_team_communication/bitbots_team_communication/bitbots_team_communication/converter/message_to_team_data_converter.py index e08e22b4c..754385d54 100644 --- a/bitbots_team_communication/bitbots_team_communication/bitbots_team_communication/converter/message_to_team_data_converter.py +++ b/bitbots_team_communication/bitbots_team_communication/bitbots_team_communication/converter/message_to_team_data_converter.py @@ -1,4 +1,4 @@ -from typing import Iterable, Sequence +from collections.abc import Iterable, Sequence import numpy as np import transforms3d diff --git a/bitbots_vision/bitbots_vision/vision_modules/debug.py b/bitbots_vision/bitbots_vision/vision_modules/debug.py index df97333a7..63cda382d 100644 --- a/bitbots_vision/bitbots_vision/vision_modules/debug.py +++ b/bitbots_vision/bitbots_vision/vision_modules/debug.py @@ -1,4 +1,5 @@ -from typing import Callable, Optional, Sequence +from collections.abc import Sequence +from typing import Callable, Optional import cv2 import numpy as np diff --git a/bitbots_vision/bitbots_vision/vision_modules/yoeo/detectors.py b/bitbots_vision/bitbots_vision/vision_modules/yoeo/detectors.py index 50bcb623e..ccaa81b8e 100644 --- a/bitbots_vision/bitbots_vision/vision_modules/yoeo/detectors.py +++ b/bitbots_vision/bitbots_vision/vision_modules/yoeo/detectors.py @@ -179,8 +179,7 @@ def set_image(self, image) -> None: self._yoeo_handler.set_image(image) @abstractmethod - def get_mask(self): - ... + def get_mask(self): ... class BackgroundSegmentation(SegmentationTemplate): diff --git a/bitbots_vision/bitbots_vision/vision_modules/yoeo/yoeo_handlers.py b/bitbots_vision/bitbots_vision/vision_modules/yoeo/yoeo_handlers.py index a621fe7b7..9409dc3ea 100644 --- a/bitbots_vision/bitbots_vision/vision_modules/yoeo/yoeo_handlers.py +++ b/bitbots_vision/bitbots_vision/vision_modules/yoeo/yoeo_handlers.py @@ -131,9 +131,9 @@ def get_available_segmentation_class_names(self) -> list[str]: return self._seg_class_names def get_detection_candidates_for(self, class_name: str) -> list[Candidate]: - assert ( - class_name in self._det_class_names - ), f"Class '{class_name}' is not available for the current YOEO model (detection)" + assert class_name in self._det_class_names, ( + f"Class '{class_name}' is not available for the current YOEO model (detection)" + ) self.predict() @@ -143,9 +143,9 @@ def get_robot_class_ids(self) -> list[int]: return self._det_robot_class_ids def get_segmentation_mask_for(self, class_name: str): - assert ( - class_name in self._seg_class_names - ), f"Class '{class_name}' ist not available for the current YOEO model (segmentation)" + assert class_name in self._seg_class_names, ( + f"Class '{class_name}' ist not available for the current YOEO model (segmentation)" + ) self.predict() @@ -188,8 +188,7 @@ def _update_image(self, img: np.ndarray) -> None: @staticmethod @abstractmethod - def model_files_exist(model_directory: str) -> bool: - ... + def model_files_exist(model_directory: str) -> bool: ... @abstractmethod def _compute_new_prediction_for(self, image: np.ndarray) -> tuple[np.ndarray, np.ndarray]: diff --git a/bitbots_vision/scripts/extract_from_rosbag.py b/bitbots_vision/scripts/extract_from_rosbag.py index e3de043b1..941846dc5 100755 --- a/bitbots_vision/scripts/extract_from_rosbag.py +++ b/bitbots_vision/scripts/extract_from_rosbag.py @@ -119,7 +119,7 @@ def int_input(question, min_int=None, max_int=None): exit() elif len(image_topics_and_info) == 1: # 1 topic found print( - f"Found exactly one topic ({image_topics_and_info[0][0],}) of type sensor_msgs/Image with {image_topics_and_info[0][1].message_count} messages." + f"Found exactly one topic ({(image_topics_and_info[0][0],)}) of type sensor_msgs/Image with {image_topics_and_info[0][1].message_count} messages." ) if image_topics_and_info[0][0] == args.topic: chosen_set_num = 0 diff --git a/scripts/deploy/misc.py b/scripts/deploy/misc.py index 1e43758c3..50ead7e49 100644 --- a/scripts/deploy/misc.py +++ b/scripts/deploy/misc.py @@ -3,7 +3,8 @@ import os import subprocess import sys -from typing import Any, Iterable, Optional +from collections.abc import Iterable +from typing import Any, Optional import yaml from fabric import Connection, GroupResult, ThreadingGroup diff --git a/scripts/deploy/tasks/check_repos.py b/scripts/deploy/tasks/check_repos.py index c968684de..8c2bbc694 100644 --- a/scripts/deploy/tasks/check_repos.py +++ b/scripts/deploy/tasks/check_repos.py @@ -292,7 +292,7 @@ def failure( commit_name: str = self._get_friendly_name(commit_hash) warnings: str = "" for i, warning in enumerate(repo_warnings): - warnings += f"{i+1}. {warning}\n" + warnings += f"{i + 1}. {warning}\n" warning_table.add_row(repo_name, f"{commit_name} ({commit_hash[:8]})", warnings) print_warning( RichGroup( @@ -422,7 +422,7 @@ def _get_friendly_name(self, hash: str) -> str: "Zebra", ] - friendly_name: str = f"{friendly_adjectives[int(hash[:len(hash)//2], 16) % len(friendly_adjectives)]} {friendly_animals[int(hash[len(hash)//2:], 16) % len(friendly_animals)]}" + friendly_name: str = f"{friendly_adjectives[int(hash[: len(hash) // 2], 16) % len(friendly_adjectives)]} {friendly_animals[int(hash[len(hash) // 2 :], 16) % len(friendly_animals)]}" print_debug(f"Generated friendly commit name: '{friendly_name}'.") return friendly_name diff --git a/scripts/deploy/tasks/install.py b/scripts/deploy/tasks/install.py index 94bc6ca17..3f448cfd8 100644 --- a/scripts/deploy/tasks/install.py +++ b/scripts/deploy/tasks/install.py @@ -176,9 +176,9 @@ def _install_commands_on_single_host(connection: Connection, result: Result) -> apt_command_prefix = "sudo -H apt-get install -y " apt_packages: list[str] = [] - install_result: Optional[ - Result - ] = None # This collects the result of the last run install command, failed if exception occurred + install_result: Optional[Result] = ( + None # This collects the result of the last run install command, failed if exception occurred + ) for install_command in install_commands: if install_command.startswith(apt_command_prefix): # Remove prefix from command, as we collect all apt commands into one diff --git a/scripts/robot_compile.py b/scripts/robot_compile.py index 41321777e..bf70c7c24 100755 --- a/scripts/robot_compile.py +++ b/scripts/robot_compile.py @@ -162,13 +162,12 @@ def __init__(self, ip, ssh_target, hostname=None, robot_name=None): def parse_arguments(): parser = argparse.ArgumentParser( - description="Compile and configure software for the Wolfgang humanoid robot " "platform" + description="Compile and configure software for the Wolfgang humanoid robot platform" ) parser.add_argument( "target", type=str, - help="The target robot or computer you want to compile for. Multiple " - "targets can be specified seperated by ,", + help="The target robot or computer you want to compile for. Multiple targets can be specified seperated by ,", ) mode = parser.add_mutually_exclusive_group(required=False) @@ -190,7 +189,7 @@ def parse_arguments(): action="store_false", default=True, dest="install_rosdeps", - help="Don't install rosdeps on the target." "Might be useful when no internet connection is available.", + help="Don't install rosdeps on the target.Might be useful when no internet connection is available.", ) parser.add_argument("--print-bit-bot", action="store_true", default=False, help="Print our logo at script start") parser.add_argument("-v", "--verbose", action="count", default=0, help="More output") From 2aaf08e94dcc0743704a1cea7aed592a4b729c42 Mon Sep 17 00:00:00 2001 From: texhnolyze Date: Thu, 13 Feb 2025 20:31:16 +0100 Subject: [PATCH 42/65] fix(simulation): update container for jazzy robocup_api sim with https://github.com/bit-bots/hlvs_webots to run simulated games in containers either locally or distributed over multiple machines --- .../bitbots_containers/hlvs/Dockerfile | 281 ++++++++++++++---- .../bitbots_containers/hlvs/entrypoint.sh | 2 +- .../bitbots_containers/hlvs/sources.list | 4 - bitbots_misc/bitbots_containers/hlvs/sudoers | 7 - .../launch/robocup_teamplayer.launch | 2 +- 5 files changed, 223 insertions(+), 73 deletions(-) delete mode 100644 bitbots_misc/bitbots_containers/hlvs/sources.list delete mode 100644 bitbots_misc/bitbots_containers/hlvs/sudoers diff --git a/bitbots_misc/bitbots_containers/hlvs/Dockerfile b/bitbots_misc/bitbots_containers/hlvs/Dockerfile index 206b10d1e..891b78832 100644 --- a/bitbots_misc/bitbots_containers/hlvs/Dockerfile +++ b/bitbots_misc/bitbots_containers/hlvs/Dockerfile @@ -1,81 +1,242 @@ # Use upstream ubuntu images as base -FROM nvidia/cuda:11.8.0-devel-ubuntu22.04 -ENV DEBIAN_FRONTEND=noninteractive +FROM nvidia/cuda:12.8.0-devel-ubuntu24.04 + +ARG UID=150 +ARG ROS_DISTRO=jazzy +ARG BITBOTS_MAIN_BRANCH=feature/jazzy-ubuntu2404-devcontainer -# Install system dependencies -ADD sources.list /etc/apt/sources.list -RUN apt update -RUN apt install -y wget auto-apt-proxy apt-utils -RUN mkdir -p /usr/local/share/keyrings -RUN wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O /usr/local/share/keyrings/ros-archive-keyring.gpg -RUN echo "deb [arch=amd64 signed-by=/usr/local/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu jammy main" | tee /etc/apt/sources.list.d/ros2.list -RUN apt update +ENV DEBIAN_FRONTEND=noninteractive -# Install a lot of apt packages. They could also be installed with rosdep, but we want them to be cached -RUN apt install -y build-essential espeak git libjsoncpp-dev libprotobuf-dev libprotoc-dev locales protobuf-compiler python3-colcon-clean python3-colcon-common-extensions python3-colcon-core python3-construct python3-hypothesis python3-numpy python3-opencv python3-pip python3-protobuf python3-psutil python3-rosdep python3-rospkg python3-sklearn python3-sphinx-rtd-theme python3-transforms3d ros-iron-rmw-cyclonedds-cpp sudo xvfb && \ - apt clean && \ - rm -rf /var/lib/apt/lists/* +RUN apt update \ + && apt install -y wget auto-apt-proxy apt-utils \ + && mkdir -p /usr/local/share/keyrings \ + && wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O /usr/local/share/keyrings/ros-archive-keyring.gpg \ + && echo "deb [arch=amd64 signed-by=/usr/local/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu noble main" | tee /etc/apt/sources.list.d/ros2.list \ + && apt update + +# Install a lot of apt packages. +# They could also be installed with rosdep, but we want them to be cached. +RUN apt install -y \ + build-essential \ + espeak \ + ffmpeg \ + git \ + ipython3 \ + locales \ + protobuf-compiler \ + sudo \ + vcstool \ + gir1.2-gst-plugins-base-1.0 \ + gir1.2-gstreamer-1.0 \ + gstreamer1.0-alsa \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-ugly \ + gstreamer1.0-tools \ + libboost-all-dev \ + libeigen3-dev \ + libfmt-dev \ + libfreeimage-dev\ + libgstreamer-plugins-base1.0-0 \ + libgstreamer-plugins-base1.0-dev \ + libgstreamer1.0-0 \ + libgstreamer1.0-dev \ + libjsoncpp-dev \ + libopencv-dev \ + libprotobuf-dev \ + libprotoc-dev \ + librange-v3-dev \ + liburdfdom-dev \ + libyaml-cpp-dev \ + protobuf-compiler \ + pybind11-dev \ + pyqt5-dev \ + python3-breathe \ + python3-colcon-clean \ + python3-colcon-common-extensions \ + python3-construct \ + python3-coverage \ + python3-cryptography \ + python3-hypothesis \ + python3-matplotlib \ + python3-nose \ + python3-numpy \ + python3-opencv \ + python3-pil \ + python3-pip \ + python3-protobuf \ + python3-psutil \ + python3-pydot \ + python3-pyqt5 \ + python3-pyqt5.qtsvg \ + python3-pytest \ + python3-rosdep \ + python3-rospkg \ + python3-scipy \ + python3-sip-dev \ + python3-sphinx-rtd-theme \ + python3-tk \ + python3-transforms3d \ + python3-yaml \ + xvfb \ + ros-${ROS_DISTRO}-action-msgs \ + ros-${ROS_DISTRO}-ament-cmake \ + ros-${ROS_DISTRO}-ament-cmake-gtest \ + ros-${ROS_DISTRO}-ament-cmake-mypy \ + ros-${ROS_DISTRO}-ament-cmake-python \ + ros-${ROS_DISTRO}-ament-cmake-ros \ + ros-${ROS_DISTRO}-ament-copyright \ + ros-${ROS_DISTRO}-ament-flake8 \ + ros-${ROS_DISTRO}-ament-lint-auto \ + ros-${ROS_DISTRO}-ament-lint-common \ + ros-${ROS_DISTRO}-ament-mypy \ + ros-${ROS_DISTRO}-ament-pep257 \ + ros-${ROS_DISTRO}-apriltag-ros \ + ros-${ROS_DISTRO}-backward-ros \ + ros-${ROS_DISTRO}-builtin-interfaces \ + ros-${ROS_DISTRO}-camera-info-manager \ + ros-${ROS_DISTRO}-control-toolbox \ + ros-${ROS_DISTRO}-controller-interface \ + ros-${ROS_DISTRO}-controller-manager \ + ros-${ROS_DISTRO}-cv-bridge \ + ros-${ROS_DISTRO}-demo-nodes-cpp \ + ros-${ROS_DISTRO}-diagnostic-aggregator \ + ros-${ROS_DISTRO}-diagnostic-msgs \ + ros-${ROS_DISTRO}-foxglove-bridge \ + ros-${ROS_DISTRO}-gazebo-msgs \ + ros-${ROS_DISTRO}-generate-parameter-library \ + ros-${ROS_DISTRO}-geometry-msgs \ + ros-${ROS_DISTRO}-hardware-interface \ + ros-${ROS_DISTRO}-image-proc \ + ros-${ROS_DISTRO}-image-transport \ + ros-${ROS_DISTRO}-imu-complementary-filter \ + ros-${ROS_DISTRO}-joint-state-publisher \ + ros-${ROS_DISTRO}-joint-state-publisher-gui \ + ros-${ROS_DISTRO}-launch-xml \ + ros-${ROS_DISTRO}-message-filters \ + ros-${ROS_DISTRO}-moveit-core \ + ros-${ROS_DISTRO}-moveit-kinematics \ + ros-${ROS_DISTRO}-moveit-msgs \ + ros-${ROS_DISTRO}-moveit-planners-ompl \ + ros-${ROS_DISTRO}-moveit-ros \ + ros-${ROS_DISTRO}-moveit-ros-move-group \ + ros-${ROS_DISTRO}-moveit-ros-planning \ + ros-${ROS_DISTRO}-moveit-ros-planning-interface \ + ros-${ROS_DISTRO}-moveit-ros-robot-interaction \ + ros-${ROS_DISTRO}-moveit-ros-visualization \ + ros-${ROS_DISTRO}-moveit-setup-assistant \ + ros-${ROS_DISTRO}-moveit-simple-controller-manager \ + ros-${ROS_DISTRO}-nav-msgs \ + ros-${ROS_DISTRO}-plotjuggler \ + ros-${ROS_DISTRO}-plotjuggler \ + ros-${ROS_DISTRO}-pluginlib \ + ros-${ROS_DISTRO}-pybind11-vendor \ + ros-${ROS_DISTRO}-qt-dotgraph \ + ros-${ROS_DISTRO}-rcl \ + ros-${ROS_DISTRO}-rclcpp \ + ros-${ROS_DISTRO}-rclcpp-components \ + ros-${ROS_DISTRO}-rclpy \ + ros-${ROS_DISTRO}-rmw-cyclonedds-cpp \ + ros-${ROS_DISTRO}-robot-state-publisher \ + ros-${ROS_DISTRO}-ros2launch \ + ros-${ROS_DISTRO}-ros2trace \ + ros-${ROS_DISTRO}-rosbag2 \ + ros-${ROS_DISTRO}-rosgraph-msgs \ + ros-${ROS_DISTRO}-rosidl-default-generators \ + ros-${ROS_DISTRO}-rosidl-default-runtime \ + ros-${ROS_DISTRO}-rot-conv \ + ros-${ROS_DISTRO}-rqt-gui \ + ros-${ROS_DISTRO}-rqt-gui-py \ + ros-${ROS_DISTRO}-rviz-imu-plugin \ + ros-${ROS_DISTRO}-sensor-msgs \ + ros-${ROS_DISTRO}-sensor-msgs-py \ + ros-${ROS_DISTRO}-shape-msgs \ + ros-${ROS_DISTRO}-soccer-vision-2d-msgs \ + ros-${ROS_DISTRO}-soccer-vision-3d-msgs \ + ros-${ROS_DISTRO}-soccer-vision-3d-rviz-markers \ + ros-${ROS_DISTRO}-soccer-vision-attribute-msgs \ + ros-${ROS_DISTRO}-std-msgs \ + ros-${ROS_DISTRO}-std-srvs \ + ros-${ROS_DISTRO}-test-msgs \ + ros-${ROS_DISTRO}-tf-transformations \ + ros-${ROS_DISTRO}-tf2 \ + ros-${ROS_DISTRO}-tf2-eigen \ + ros-${ROS_DISTRO}-tf2-geometry-msgs \ + ros-${ROS_DISTRO}-tf2-kdl \ + ros-${ROS_DISTRO}-tf2-ros \ + ros-${ROS_DISTRO}-tf2-sensor-msgs \ + ros-${ROS_DISTRO}-topic-tools \ + ros-${ROS_DISTRO}-tracetools-acceleration \ + ros-${ROS_DISTRO}-tracetools-analysis \ + ros-${ROS_DISTRO}-tracetools-image-pipeline \ + ros-${ROS_DISTRO}-tracetools-test \ + ros-${ROS_DISTRO}-trajectory-msgs \ + ros-${ROS_DISTRO}-transmission-interface \ + ros-${ROS_DISTRO}-urdf \ + ros-${ROS_DISTRO}-urdfdom-py \ + ros-${ROS_DISTRO}-vision-msgs \ + ros-${ROS_DISTRO}-vision-opencv \ + ros-${ROS_DISTRO}-visualization-msgs \ + ros-${ROS_DISTRO}-xacro \ + && apt clean \ + && rm -rf /var/lib/apt/lists/* # Set up locale -RUN echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen && locale-gen && update-locale LANG=en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 +RUN echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen \ + && locale-gen \ + && update-locale LANG=en_US.UTF-8 -# Add user -ARG UID=150 -RUN useradd -M -d /colcon_ws -s /bin/bash -u $UID robot +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 -# Install sudoers file -ADD sudoers /etc/sudoers +RUN mkdir -p /colcon_ws/src \ + && useradd -M -d /colcon_ws -s /bin/bash -u $UID robot \ + && chown -R robot:robot /colcon_ws \ + && echo "robot ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/robot WORKDIR /colcon_ws -RUN chown robot:robot /colcon_ws USER robot:robot ENV PATH=$PATH:/colcon_ws/.local/bin -RUN . /opt/ros/iron/setup.sh && \ - mkdir src - -# Initialize rosdep -RUN sudo rosdep init +RUN . /opt/ros/${ROS_DISTRO}/setup.sh \ + && sudo rosdep init -# Add some requirements already here so that they are cached -#RUN python3 -m pip install -U pip && \ -# pip3 install -U PyYAML construct defusedxml matplotlib numpy opencv-python \ -# protobuf psutil pytorchyolo setuptools sklearn transforms3d +RUN mkdir -p -m 700 $HOME/.ssh \ + && ssh-keyscan github.com >> $HOME/.ssh/known_hosts -ADD --chown=robot:robot https://raw.githubusercontent.com/bit-bots/bitbots_main/master/requirements/common.txt src/requirements_common.txt - -RUN pip3 install -U -r src/requirements_common.txt --no-cache-dir && \ - pip3 uninstall -y numpy - -RUN cd src && \ - git clone https://github.com/bit-bots/bitbots_main.git && \ - cd bitbots_main && \ - make pull-init +RUN --mount=type=ssh,uid=$UID git clone --branch "$BITBOTS_MAIN_BRANCH" git@github.com:bit-bots/bitbots_main.git src/bitbots_main \ + && cd src/bitbots_main \ + && make pull-init rosdep pip # From here on, we don't want to cache anything. That's achieved by adding the current time. ADD https://www.timeapi.io/api/Time/current/zone?timeZone=UTC /tmp/build-time -RUN cd src/bitbots_main && \ - make pull-all && \ - rm -rf lib/udp_bridge bitbots_misc/bitbots_containers \ - lib/dynamic_stack_decider/dynamic_stack_decider_visualization bitbots_lowlevel \ - bitbots_robot/bitbots_pybullet_sim lib/DynamixelSDK lib/dynamixel-workbench \ - bitbots_misc/bitbots_basler_camera && \ - sed -i '/plotjuggler/d' bitbots_motion/bitbots_quintic_walk/package.xml && \ - sed -i '/run_depend/d' bitbots_robot/wolfgang_moveit_config/package.xml - -# Install ros dependencies with rosdep -RUN sudo apt update && rosdep update -RUN cd src/bitbots_main && rosdep install --rosdistro=iron --from-paths . --ignore-src -r -y - -RUN . /opt/ros/iron/setup.sh && colcon build --cmake-args -DBUILD_TESTING=OFF - -# TODO execute tests - -RUN cp src/bitbots_main/bitbots_robot/bitbots_robocup_api/scripts/start.sh .local/bin/start +RUN --mount=type=ssh,uid=$UID cd src/bitbots_main \ + && make pull-all \ + && rm -rf bitbots_lowlevel \ + bitbots_misc/bitbots_basler_camera \ + bitbots_misc/bitbots_ceiling_cam \ + bitbots_misc/bitbots_containers \ + bitbots_motion/bitbots_animation_rqt \ + bitbots_simulation/bitbots_pybullet_sim \ + bitbots_team_communication/bitbots_team_data_sim_rqt \ + bitbots_wolfgang \ + lib/dynamic_stack_decider/dynamic_stack_decider_visualization \ + lib/dynamixel-workbench \ + lib/pylon-ros-camera \ + lib/soccer_field_map_generator \ + lib/udp_bridge \ + && sed -i '/plotjuggler/d' bitbots_motion/bitbots_quintic_walk/package.xml + +# Install missing ros dependencies with rosdep +RUN sudo apt update \ + && rosdep update \ + && rosdep install --rosdistro=${ROS_DISTRO} --from-paths src/bitbots_main --ignore-src -r -y \ + && . /opt/ros/${ROS_DISTRO}/setup.sh \ + && colcon build --cmake-args -DBUILD_TESTING=OFF + +RUN cp src/bitbots_main/bitbots_simulation/bitbots_robocup_api/scripts/start.sh .local/bin/start # Volume for logs VOLUME /robocup-logs diff --git a/bitbots_misc/bitbots_containers/hlvs/entrypoint.sh b/bitbots_misc/bitbots_containers/hlvs/entrypoint.sh index 4db0c6165..855bbf598 100755 --- a/bitbots_misc/bitbots_containers/hlvs/entrypoint.sh +++ b/bitbots_misc/bitbots_containers/hlvs/entrypoint.sh @@ -1,6 +1,6 @@ #!/bin/bash -source /opt/ros/iron/setup.bash +source /opt/ros/jazzy/setup.bash source /colcon_ws/install/setup.bash exec "$@" diff --git a/bitbots_misc/bitbots_containers/hlvs/sources.list b/bitbots_misc/bitbots_containers/hlvs/sources.list deleted file mode 100644 index 19a2fca7f..000000000 --- a/bitbots_misc/bitbots_containers/hlvs/sources.list +++ /dev/null @@ -1,4 +0,0 @@ -deb http://de.archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse -deb http://de.archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse -deb http://de.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse -deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse diff --git a/bitbots_misc/bitbots_containers/hlvs/sudoers b/bitbots_misc/bitbots_containers/hlvs/sudoers deleted file mode 100644 index b589f942a..000000000 --- a/bitbots_misc/bitbots_containers/hlvs/sudoers +++ /dev/null @@ -1,7 +0,0 @@ -## -## User privilege specification -## -## Uncomment to allow any user to run sudo if they know the password -## of the user they are running the command as (root by default). -# Defaults targetpw # Ask for the password of the target user -ALL ALL=(ALL) NOPASSWD: ALL diff --git a/bitbots_simulation/bitbots_robocup_api/launch/robocup_teamplayer.launch b/bitbots_simulation/bitbots_robocup_api/launch/robocup_teamplayer.launch index 7c145e37a..6e4c2309d 100644 --- a/bitbots_simulation/bitbots_robocup_api/launch/robocup_teamplayer.launch +++ b/bitbots_simulation/bitbots_robocup_api/launch/robocup_teamplayer.launch @@ -4,7 +4,7 @@ - + From 340c50698db6616a56839fced98e17a8b1def8e3 Mon Sep 17 00:00:00 2001 From: texhnolyze Date: Thu, 27 Feb 2025 10:43:05 +0100 Subject: [PATCH 43/65] fix(simulation): naming of `bitbots_robocup_api` package --- .../{wolfgang_robocup_api => bitbots_robocup_api}/__init__.py | 0 .../command_proxy.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename bitbots_simulation/bitbots_robocup_api/{wolfgang_robocup_api => bitbots_robocup_api}/__init__.py (100%) rename bitbots_simulation/bitbots_robocup_api/{wolfgang_robocup_api => bitbots_robocup_api}/command_proxy.py (100%) diff --git a/bitbots_simulation/bitbots_robocup_api/wolfgang_robocup_api/__init__.py b/bitbots_simulation/bitbots_robocup_api/bitbots_robocup_api/__init__.py similarity index 100% rename from bitbots_simulation/bitbots_robocup_api/wolfgang_robocup_api/__init__.py rename to bitbots_simulation/bitbots_robocup_api/bitbots_robocup_api/__init__.py diff --git a/bitbots_simulation/bitbots_robocup_api/wolfgang_robocup_api/command_proxy.py b/bitbots_simulation/bitbots_robocup_api/bitbots_robocup_api/command_proxy.py similarity index 100% rename from bitbots_simulation/bitbots_robocup_api/wolfgang_robocup_api/command_proxy.py rename to bitbots_simulation/bitbots_robocup_api/bitbots_robocup_api/command_proxy.py From b937c9349e8ad61a87a3c5ed7028cf8eea6b1705 Mon Sep 17 00:00:00 2001 From: texhnolyze Date: Thu, 27 Feb 2025 13:13:18 +0100 Subject: [PATCH 44/65] fix(style): allow quoting in type hints for ndarrays which is required for correct typing with jaxtypes and ndarrays (see: https://github.com/astral-sh/ruff/issues/13121). This is done, by disabling ruff rule [UP037]. [UP037]: https://docs.astral.sh/ruff/rules/quoted-annotation/ --- .../localization_dsd/localization_blackboard.py | 6 +++--- pyproject.toml | 10 ++++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/bitbots_navigation/bitbots_localization_handler/bitbots_localization_handler/localization_dsd/localization_blackboard.py b/bitbots_navigation/bitbots_localization_handler/bitbots_localization_handler/localization_dsd/localization_blackboard.py index 27d442cb9..4e85eba1b 100644 --- a/bitbots_navigation/bitbots_localization_handler/bitbots_localization_handler/localization_dsd/localization_blackboard.py +++ b/bitbots_navigation/bitbots_localization_handler/bitbots_localization_handler/localization_dsd/localization_blackboard.py @@ -55,15 +55,15 @@ def __init__(self, node: Node): self.last_state_get_up = False # IMU - self.accel: Float[np.ndarray, 3] = np.array([0.0, 0.0, 0.0]) + self.accel: Float[np.ndarray, "3"] = np.zeros(3) self.imu_orientation = Quaternion(w=1.0) # Falling odometry / imu interpolation during falls self.imu_yaw_before_fall: float = 0.0 # Picked up - self.pickup_accel_buffer: list[Float[np.ndarray, 3]] = [] - self.pickup_accel_buffer_long: list[Float[np.ndarray, 3]] = [] + self.pickup_accel_buffer: list[Float[np.ndarray, "3"]] = [] + self.pickup_accel_buffer_long: list[Float[np.ndarray, "3"]] = [] # Last init action self.last_init_action_type: Optional[type] = None diff --git a/pyproject.toml b/pyproject.toml index b848a36d3..9864c6719 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,8 +2,14 @@ line-length = 120 [tool.ruff.lint] -# Never enforce `E501` (line length violations) -ignore = ["E501", "UP007", "F722"] +# Never enforce +# - `E501` (line length violations) +# - `UP007` (usage of | instead of Union and Optional) +# - `F722` (no forward type references by quoting) +# - `UP037` (non quoted annotations for type hints) +# quotes are required for correct numpy/jax type hinting +# e.g. https://github.com/astral-sh/ruff/issues/13121 +ignore = ["E501", "UP007", "F722", "UP037"] # Additionally enable the following rules # - pycodestyle warnings (`W`) # - flake8-bugbear warnings (`B`) From 5d1cad1185acd43e8f3bd8dacd8ced137ea85dde Mon Sep 17 00:00:00 2001 From: texhnolyze Date: Thu, 27 Feb 2025 15:00:40 +0100 Subject: [PATCH 45/65] test(vcs): temp change of `game_controller_hl` to fork --- workspace.repos | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workspace.repos b/workspace.repos index 672de0f73..b88656896 100644 --- a/workspace.repos +++ b/workspace.repos @@ -37,8 +37,8 @@ repositories: version: master lib/game_controller_hl: type: git - url: git@github.com:ros-sports/game_controller_hl.git - version: rolling + url: git@github.com:texhnolyze/game_controller_hl.git + version: feature/simulation-timeout-issues lib/hlvs_player: type: git url: git@github.com:ros-sports/hlvs_player.git From e9df569021e2e7bafb0e066c152596f213cf6d40 Mon Sep 17 00:00:00 2001 From: Florian Vahl <7vahl@informatik.uni-hamburg.de> Date: Thu, 27 Feb 2025 17:08:01 +0100 Subject: [PATCH 46/65] Revert inclusion of eol distros --- scripts/deploy/tasks/install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/deploy/tasks/install.py b/scripts/deploy/tasks/install.py index 8ce351c2d..3f448cfd8 100644 --- a/scripts/deploy/tasks/install.py +++ b/scripts/deploy/tasks/install.py @@ -134,7 +134,7 @@ def _install_rosdeps(self, connections: Group) -> GroupResult: remote_src_path = os.path.join(self._remote_workspace, "src") print_debug(f"Gathering rosdep install commands in {remote_src_path}") - cmd = f"rosdep update --include-eol-distros && rosdep install --simulate --default-yes --ignore-src --from-paths {remote_src_path}" + cmd = f"rosdep update && rosdep install --simulate --default-yes --ignore-src --from-paths {remote_src_path}" print_debug(f"Calling {cmd}") try: gather_results = connections.run(cmd, hide=hide_output()) From d9191c6f059ee7aa42ed4cb5b3b6da6b1414d34d Mon Sep 17 00:00:00 2001 From: texhnolyze Date: Thu, 27 Feb 2025 20:11:39 +0100 Subject: [PATCH 47/65] Revert "test(vcs): temp change of `game_controller_hl` to fork" This reverts commit 5d1cad1185acd43e8f3bd8dacd8ced137ea85dde. --- workspace.repos | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workspace.repos b/workspace.repos index b88656896..672de0f73 100644 --- a/workspace.repos +++ b/workspace.repos @@ -37,8 +37,8 @@ repositories: version: master lib/game_controller_hl: type: git - url: git@github.com:texhnolyze/game_controller_hl.git - version: feature/simulation-timeout-issues + url: git@github.com:ros-sports/game_controller_hl.git + version: rolling lib/hlvs_player: type: git url: git@github.com:ros-sports/hlvs_player.git From 2860b1a86c2ab1ae2fa467da9e69578f9bc2ed00 Mon Sep 17 00:00:00 2001 From: texhnolyze Date: Thu, 27 Feb 2025 20:29:55 +0100 Subject: [PATCH 48/65] fix(webots): update Wolfgang joint limits in protobuf which was not held consistent with the `robot.urdf` joint limits --- .../protos/robots/Wolfgang/Wolfgang.proto | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/bitbots_simulation/bitbots_webots_sim/protos/robots/Wolfgang/Wolfgang.proto b/bitbots_simulation/bitbots_webots_sim/protos/robots/Wolfgang/Wolfgang.proto index e2d546987..3c287f3ce 100644 --- a/bitbots_simulation/bitbots_webots_sim/protos/robots/Wolfgang/Wolfgang.proto +++ b/bitbots_simulation/bitbots_webots_sim/protos/robots/Wolfgang/Wolfgang.proto @@ -1584,8 +1584,8 @@ PROTO Wolfgang [ RotationalMotor { name "RHipRoll [hip]" maxVelocity IS MX106-vel - minPosition -1.5708 - maxPosition 1.5708 + minPosition -1.9 + maxPosition 1.6 maxTorque IS MX106-torque controlPID IS pid } @@ -1652,8 +1652,8 @@ PROTO Wolfgang [ RotationalMotor { name "RHipPitch" maxVelocity IS MX106-vel - minPosition -2.0944 - maxPosition 1.91986 + minPosition -2.77 + maxPosition 0.79 maxTorque IS MX106-torque controlPID IS pid } @@ -1736,7 +1736,7 @@ PROTO Wolfgang [ RotationalMotor { name "RKnee" maxVelocity IS XH540W270-vel - minPosition -2.96706 + minPosition -2.8 maxPosition 0.2 maxTorque IS XH540W270-torque controlPID IS pid @@ -1828,8 +1828,8 @@ PROTO Wolfgang [ RotationalMotor { name "RAnklePitch" maxVelocity IS MX106-vel - minPosition -1.74533 - maxPosition 1.45 + minPosition -0.37 + maxPosition 1.42 maxTorque IS MX106-torque controlPID IS pid } @@ -1895,8 +1895,8 @@ PROTO Wolfgang [ RotationalMotor { name "RAnkleRoll" maxVelocity IS MX106-vel - minPosition -1.0472 - maxPosition 1.0472 + minPosition -1.4 + maxPosition 1.58 maxTorque IS MX106-torque controlPID IS pid } @@ -3005,8 +3005,8 @@ PROTO Wolfgang [ RotationalMotor { name "LHipRoll [hip]" maxVelocity IS MX106-vel - minPosition -1.5708 - maxPosition 1.5708 + minPosition -1.6 + maxPosition 1.9 maxTorque IS MX106-torque controlPID IS pid } @@ -3073,8 +3073,8 @@ PROTO Wolfgang [ RotationalMotor { name "LHipPitch" maxVelocity IS MX106-vel - minPosition -1.91986 - maxPosition 2.0944 + minPosition -0.79 + maxPosition 2.77 maxTorque IS MX106-torque controlPID IS pid } @@ -3158,7 +3158,7 @@ PROTO Wolfgang [ name "LKnee" maxVelocity IS XH540W270-vel minPosition -0.2 - maxPosition 2.96706 + maxPosition 2.8 maxTorque IS XH540W270-torque controlPID IS pid } @@ -3249,8 +3249,8 @@ PROTO Wolfgang [ RotationalMotor { name "LAnklePitch" maxVelocity IS MX106-vel - minPosition -1.45 - maxPosition 1.74533 + minPosition -1.42 + maxPosition 0.37 maxTorque IS MX106-torque controlPID IS pid } @@ -3316,8 +3316,8 @@ PROTO Wolfgang [ RotationalMotor { name "LAnkleRoll" maxVelocity IS MX106-vel - minPosition -1.0472 - maxPosition 1.0472 + minPosition -1.58 + maxPosition 1.4 maxTorque IS MX106-torque controlPID IS pid } @@ -4428,8 +4428,8 @@ PROTO Wolfgang [ RotationalMotor { name "HeadTilt" maxVelocity IS MX64-vel - minPosition -1.5708 - maxPosition 1.0472 + minPosition -1.923 + maxPosition 1.24 maxTorque IS MX64-torque controlPID IS pid } From 0f646e1e39d17ffaa441875ddd89923aa5da8c25 Mon Sep 17 00:00:00 2001 From: texhnolyze Date: Thu, 27 Mar 2025 11:54:00 +0100 Subject: [PATCH 49/65] Revert "fix(webots): update Wolfgang joint limits in protobuf" This reverts commit 2860b1a86c2ab1ae2fa467da9e69578f9bc2ed00. --- .../protos/robots/Wolfgang/Wolfgang.proto | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/bitbots_simulation/bitbots_webots_sim/protos/robots/Wolfgang/Wolfgang.proto b/bitbots_simulation/bitbots_webots_sim/protos/robots/Wolfgang/Wolfgang.proto index 3c287f3ce..e2d546987 100644 --- a/bitbots_simulation/bitbots_webots_sim/protos/robots/Wolfgang/Wolfgang.proto +++ b/bitbots_simulation/bitbots_webots_sim/protos/robots/Wolfgang/Wolfgang.proto @@ -1584,8 +1584,8 @@ PROTO Wolfgang [ RotationalMotor { name "RHipRoll [hip]" maxVelocity IS MX106-vel - minPosition -1.9 - maxPosition 1.6 + minPosition -1.5708 + maxPosition 1.5708 maxTorque IS MX106-torque controlPID IS pid } @@ -1652,8 +1652,8 @@ PROTO Wolfgang [ RotationalMotor { name "RHipPitch" maxVelocity IS MX106-vel - minPosition -2.77 - maxPosition 0.79 + minPosition -2.0944 + maxPosition 1.91986 maxTorque IS MX106-torque controlPID IS pid } @@ -1736,7 +1736,7 @@ PROTO Wolfgang [ RotationalMotor { name "RKnee" maxVelocity IS XH540W270-vel - minPosition -2.8 + minPosition -2.96706 maxPosition 0.2 maxTorque IS XH540W270-torque controlPID IS pid @@ -1828,8 +1828,8 @@ PROTO Wolfgang [ RotationalMotor { name "RAnklePitch" maxVelocity IS MX106-vel - minPosition -0.37 - maxPosition 1.42 + minPosition -1.74533 + maxPosition 1.45 maxTorque IS MX106-torque controlPID IS pid } @@ -1895,8 +1895,8 @@ PROTO Wolfgang [ RotationalMotor { name "RAnkleRoll" maxVelocity IS MX106-vel - minPosition -1.4 - maxPosition 1.58 + minPosition -1.0472 + maxPosition 1.0472 maxTorque IS MX106-torque controlPID IS pid } @@ -3005,8 +3005,8 @@ PROTO Wolfgang [ RotationalMotor { name "LHipRoll [hip]" maxVelocity IS MX106-vel - minPosition -1.6 - maxPosition 1.9 + minPosition -1.5708 + maxPosition 1.5708 maxTorque IS MX106-torque controlPID IS pid } @@ -3073,8 +3073,8 @@ PROTO Wolfgang [ RotationalMotor { name "LHipPitch" maxVelocity IS MX106-vel - minPosition -0.79 - maxPosition 2.77 + minPosition -1.91986 + maxPosition 2.0944 maxTorque IS MX106-torque controlPID IS pid } @@ -3158,7 +3158,7 @@ PROTO Wolfgang [ name "LKnee" maxVelocity IS XH540W270-vel minPosition -0.2 - maxPosition 2.8 + maxPosition 2.96706 maxTorque IS XH540W270-torque controlPID IS pid } @@ -3249,8 +3249,8 @@ PROTO Wolfgang [ RotationalMotor { name "LAnklePitch" maxVelocity IS MX106-vel - minPosition -1.42 - maxPosition 0.37 + minPosition -1.45 + maxPosition 1.74533 maxTorque IS MX106-torque controlPID IS pid } @@ -3316,8 +3316,8 @@ PROTO Wolfgang [ RotationalMotor { name "LAnkleRoll" maxVelocity IS MX106-vel - minPosition -1.58 - maxPosition 1.4 + minPosition -1.0472 + maxPosition 1.0472 maxTorque IS MX106-torque controlPID IS pid } @@ -4428,8 +4428,8 @@ PROTO Wolfgang [ RotationalMotor { name "HeadTilt" maxVelocity IS MX64-vel - minPosition -1.923 - maxPosition 1.24 + minPosition -1.5708 + maxPosition 1.0472 maxTorque IS MX64-torque controlPID IS pid } From 7f7e816273c793f910465dfdaef9b65e397dea3d Mon Sep 17 00:00:00 2001 From: Valerie Bartel Date: Thu, 27 Mar 2025 12:06:41 +0100 Subject: [PATCH 50/65] change fov to jasper calculations --- .../bitbots_webots_sim/protos/robots/Wolfgang/Wolfgang.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitbots_simulation/bitbots_webots_sim/protos/robots/Wolfgang/Wolfgang.proto b/bitbots_simulation/bitbots_webots_sim/protos/robots/Wolfgang/Wolfgang.proto index e2d546987..6d41cc9b0 100644 --- a/bitbots_simulation/bitbots_webots_sim/protos/robots/Wolfgang/Wolfgang.proto +++ b/bitbots_simulation/bitbots_webots_sim/protos/robots/Wolfgang/Wolfgang.proto @@ -71,7 +71,7 @@ PROTO Wolfgang [ field SFBool enableBoundingObject TRUE # Is `Robot.enableBoundingObject`. field SFBool enablePhysics TRUE # Is `Robot.enablePhysics`. field SFBool enableFootSensors TRUE # Is `Robot.enableFootSensors`. - field SFFloat cameraFOV 1.04 + field SFFloat cameraFOV 1.517 field SFInt32 cameraWidth 800 field SFInt32 cameraHeight 600 field SFFloat MX64-torque 7.3 From 779bd427450b190d85734bf75dec452805fb8519 Mon Sep 17 00:00:00 2001 From: Jan Gutsche Date: Tue, 8 Apr 2025 13:52:00 +0200 Subject: [PATCH 51/65] Make Ruff happy --- .../bitbots_animation_server/resource_manager.py | 10 +++------- .../vision_modules/yoeo/object_manager.py | 4 ++-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/bitbots_motion/bitbots_animation_server/bitbots_animation_server/resource_manager.py b/bitbots_motion/bitbots_animation_server/bitbots_animation_server/resource_manager.py index 315f23466..262d5f775 100644 --- a/bitbots_motion/bitbots_animation_server/bitbots_animation_server/resource_manager.py +++ b/bitbots_motion/bitbots_animation_server/bitbots_animation_server/resource_manager.py @@ -71,12 +71,8 @@ def search(self, path, folders, filename=""): path = next_path if not folders: - return OSError( - "Resource '%s' not found. folders was empty, \ - only filename provided" - % (filename) - ) - return OSError("Resource '%s' not found" % (str(folders) + filename)) + return OSError(f"Resource '{filename}' not found. folders was empty, only filename provided") + return OSError(f"Resource '{str(folders) + filename}' not found") def find(self, name, filename=""): """ @@ -115,7 +111,7 @@ def find_animation(self, name): should be given without ``.json``. path = find_animation('walkready') """ - return self.find(self.animpath, "%s.json" % name) + return self.find(self.animpath, f"{name}.json") def find_resource(self, name): """Finds a resource relative to self.basepath""" diff --git a/bitbots_vision/bitbots_vision/vision_modules/yoeo/object_manager.py b/bitbots_vision/bitbots_vision/vision_modules/yoeo/object_manager.py index aeb9e28d9..3aadfb974 100644 --- a/bitbots_vision/bitbots_vision/vision_modules/yoeo/object_manager.py +++ b/bitbots_vision/bitbots_vision/vision_modules/yoeo/object_manager.py @@ -1,5 +1,5 @@ import os.path as osp -from typing import Optional, Type +from typing import Optional import rclpy @@ -16,7 +16,7 @@ class YOEOObjectManager: This class manages the creation and update of the YOEO handler instance. """ - _HANDLERS_BY_NAME: dict[str, Type[yoeo_handlers.YOEOHandlerTemplate]] = { + _HANDLERS_BY_NAME: dict[str, type[yoeo_handlers.YOEOHandlerTemplate]] = { "openvino": yoeo_handlers.YOEOHandlerOpenVino, "onnx": yoeo_handlers.YOEOHandlerONNX, "pytorch": yoeo_handlers.YOEOHandlerPytorch, From 615b3292a9cc9067d9fe37f4fce4ae5a7a5c0898 Mon Sep 17 00:00:00 2001 From: Jan Gutsche Date: Tue, 8 Apr 2025 13:52:47 +0200 Subject: [PATCH 52/65] Fix deprecation warning in pyproject.toml --- bitbots_msgs/pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bitbots_msgs/pyproject.toml b/bitbots_msgs/pyproject.toml index 3ed6ff7a4..3e23bc6c4 100644 --- a/bitbots_msgs/pyproject.toml +++ b/bitbots_msgs/pyproject.toml @@ -3,6 +3,8 @@ line-length = 120 [tool.ruff] line-length = 120 + +[tool.ruff.lint] # Never enforce `E501` (line length violations), as black takes care of this. ignore = ["E501"] # Additionally enable the following rules From 2594e447df75afb7ed8297a6163ea36b3c50b56c Mon Sep 17 00:00:00 2001 From: Jan Gutsche Date: Tue, 8 Apr 2025 14:01:52 +0200 Subject: [PATCH 53/65] Fix Makefile --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 33a7a8dc3..86500334c 100644 --- a/Makefile +++ b/Makefile @@ -17,8 +17,8 @@ install-no-root: pull-init update-no-root pip: # Install and upgrade pip dependencies - pip install --upgrade pip --user - pip install --upgrade -r requirements/dev.txt --user --break-system-packages -v + pip install --upgrade pip --user --break-system-packages -v + pip install --upgrade -r requirements/dev.txt --user --break-system-packages -v pre-commit: # Install pre-commit hooks for all submodules that have a .pre-commit-config.yaml file From 86b73baa7b82d97cf65f7b1ee6708382441bc7eb Mon Sep 17 00:00:00 2001 From: texhnolyze Date: Thu, 22 May 2025 17:06:38 +0200 Subject: [PATCH 54/65] fix(hlvs): simulation configuration by preventing duplicated rosbag recording as it moved to teamplayer and using IMU data for the walking phase reset. As we do not have foot pressure sensors in the configured devices for hlvs, the robot will not walk otherwise. --- .../config/walking_wolfgang_simulator.yaml | 4 ++-- .../bitbots_robocup_api/launch/robocup_teamplayer.launch | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/bitbots_motion/bitbots_quintic_walk/config/walking_wolfgang_simulator.yaml b/bitbots_motion/bitbots_quintic_walk/config/walking_wolfgang_simulator.yaml index 843c69281..38fd0a5ac 100644 --- a/bitbots_motion/bitbots_quintic_walk/config/walking_wolfgang_simulator.yaml +++ b/bitbots_motion/bitbots_quintic_walk/config/walking_wolfgang_simulator.yaml @@ -75,13 +75,13 @@ walking: phase_reset: min_phase: 0.90 foot_pressure: - active: True + active: False ground_min_pressure: 1.5 effort: active: False joint_min_effort: 30.0 imu: - active: False + active: True y_acceleration_threshold: 1.4 trunk_pid: diff --git a/bitbots_simulation/bitbots_robocup_api/launch/robocup_teamplayer.launch b/bitbots_simulation/bitbots_robocup_api/launch/robocup_teamplayer.launch index 6e4c2309d..f329c938f 100644 --- a/bitbots_simulation/bitbots_robocup_api/launch/robocup_teamplayer.launch +++ b/bitbots_simulation/bitbots_robocup_api/launch/robocup_teamplayer.launch @@ -2,13 +2,6 @@ - - - - - - - @@ -23,5 +16,6 @@ + From 77d2bc8687e37223d829c7fcbc4c9d9fa29ae29b Mon Sep 17 00:00:00 2001 From: texhnolyze Date: Wed, 28 May 2025 13:17:20 +0200 Subject: [PATCH 55/65] fix(setup.sh): update pip install for ubuntu 24.04 --- scripts/setup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/setup.sh b/scripts/setup.sh index 7eefc037d..d4d9de1c2 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -89,6 +89,7 @@ setup_repo() { else if [[ ! -d "$PWD/bitbots_main" ]]; then git clone "$REPO_URL" + git switch feature/jazzy-ubuntu2404-devcontainer fi meta_dir="$(realpath "$PWD/bitbots_main")" @@ -108,7 +109,7 @@ setup_colcon() { echo "Installing/Updating colcon extensions..." # Install/Update colcon extensions / patches - python3 -m pip install --upgrade --user \ + python3 -m pip install --upgrade --user --break-system-packages \ git+https://github.com/timonegk/colcon-core.git@colors \ git+https://github.com/timonegk/colcon-notification.git@colors \ git+https://github.com/timonegk/colcon-output.git@colors From 87c11eec0691c30ac27676419042e882e982216a Mon Sep 17 00:00:00 2001 From: Florian Vahl <7vahl@informatik.uni-hamburg.de> Date: Wed, 28 May 2025 14:57:55 +0200 Subject: [PATCH 56/65] Remove old robot_compile.py --- scripts/robot_compile.py | 533 --------------------------------------- 1 file changed, 533 deletions(-) delete mode 100755 scripts/robot_compile.py diff --git a/scripts/robot_compile.py b/scripts/robot_compile.py deleted file mode 100755 index bf70c7c24..000000000 --- a/scripts/robot_compile.py +++ /dev/null @@ -1,533 +0,0 @@ -#!/usr/bin/env python3 - -import argparse -import ipaddress -import os -import subprocess -import sys - -import yaml - -print( - DeprecationWarning( - "WARNING: This script is deprecated. Use 'deploy_robot.py' instead. Please remove this script in the future." - ) -) - - -class LOGLEVEL: - current = 2 - DEBUG = 3 - INFO = 2 - WARN = 1 - ERR_SUCCESS = 0 - - -BITBOTS_MAIN = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - - -def print_err(msg): - if LOGLEVEL.current >= LOGLEVEL.ERR_SUCCESS: - print("\033[91m\033[1m##" + "".join(["#"] * len(str(msg))) + "##\033[0m") - print("\033[91m\033[1m# " + "".join([" "] * len(str(msg))) + " #\033[0m") - print("\033[91m\033[1m# " + str(msg) + " #\033[0m") - print("\033[91m\033[1m# " + "".join([" "] * len(str(msg))) + " #\033[0m") - print("\033[91m\033[1m##" + "".join(["#"] * len(str(msg))) + "##\033[0m") - - -def print_warn(msg): - if LOGLEVEL.current >= LOGLEVEL.WARN: - print("\033[93m\033[1m# " + "".join([" "] * len(str(msg))) + " #\033[0m") - print("\033[93m\033[1m# " + str(msg) + " #\033[0m") - print("\033[93m\033[1m# " + "".join([" "] * len(str(msg))) + " #\033[0m") - - -def print_success(msg): - if LOGLEVEL.current >= LOGLEVEL.ERR_SUCCESS: - print("\033[92m\033[1m# " + "".join([" "] * len(str(msg))) + " #\033[0m") - print("\033[92m\033[1m# " + str(msg) + " #\033[0m") - print("\033[92m\033[1m# " + "".join([" "] * len(str(msg))) + " #\033[0m") - - -def print_info(msg): - if LOGLEVEL.current >= LOGLEVEL.INFO: - print("\033[96m" + str(msg) + "\033[0m") - - -def print_debug(msg): - if LOGLEVEL.current >= LOGLEVEL.DEBUG: - print(msg) - - -def print_bit_bot(): - print( - """\033[1m - `/shNMoyymmmmmmmmmmys+NmNs/` - `+mmdddmmmddddddddddddmmmdddmm/ - ymdddddddmmmmmmmmmmmmmmdddddddms - .dmdddddddddddmddddddmmddddddddddmy` - .mmdddddddddddmyoooooosddddddddddddms` - .ssshmdddddddddddddmhsooshddddddddddddddmhsss. - -+shysshddddmddddmdddddddddddddddmdhhhhdmdddhssyhs+- - :ddyyyyydddy+/////+shddddddddddddy+//////+sdddyyyyydd: - `mmh/+hdddh///////////sdddddddddd+///++++////hdddh+/hmm` - omdddddmmy///sdNNNmy///omddddddd+//odNMMNmo///hdmdddddmo - `dddddddmm+//yMMMMMMMh///hdddmddh//oNMMMMMMNo//smmddddddd` - .Nddddddmm+//hMMMMMMMd///hdhNNddh//+NMMMMMMNo//ymmddddddN. - .mNNNNNNNdh///yNMMMNd+//sdddddddds//+hmNNmho//oddmmNNNNNm. --ydddmmmmNmdh+///+++////yddddddddddy//////////sddmNmmmmdddy- -:sddddddymNdddyo+////oyddddddddddddddys++++oyddddddydddddds: -/hddddddh::Nddddmdddmdddddddddddddddddddmmdddddmm.:hdddddhh/ -:dhhhhyhh. :dmddddddddddddddddddddddddddddddddmy. .hhyhhhhd: -/mhhhhyo/ `omdddddddddddddddddddddddddddddmmo` /oyhhhhm/ -/hhhhd` `ommddddddddddddddddddddddddmmo` `dhhhh/ -/hhhhd+ `+ymdddddddddddddddddddddy:` +dhhhh/ -mhhhhds +:mhhdhmmmmmddmmmmNmhhhs/: sdhhhhm -mhhhhm. .mNhsshmN.-//:///-hNdyoydMm .mhhhhm -mhhhhs oNNy//ymN` yNho:omNd shhhhm -dhhss` +NMNsyNNN` yNNm+dNNd `sshhd -dhdh/. +NNdyyNNm` yNNdyhNNd ./hdhd -mhssy+ +dddddddm` ydddddddd +ysshm -hy- +dddddddm` ydddddddd -yh - `hmmmmmmmm+ -dmmmmmmmm: - `Nddddddddy :mdddddddm+ - `Nddddddddy :mdddddddm+ - `Ndddddddmy :mdddddddm+ - `mddddddddy :mdddddddd+ - `mddddddddy :mdddddddd+ - `mmNmohNNdy :mmNmohmNm+ - `NNmdhdmNmh /NmmdhddNms - `/mms+-/ymm: ymho-:odmh/. - yo+hsoooshs -hsooosys+y: - h+++++++oo+ `ho+++++++s: - dysssssssy+ `dsssssssyh: -\033[0m""" - ) - - -class Target: - class Workspaces: - amy = "colcon_ws" - rory = "colcon_ws" - jack = "colcon_ws" - donna = "colcon_ws" - melody = "colcon_ws" - rose = "colcon_ws" - - class RobotComputers: - amy = ["nuc1"] - rory = ["nuc2"] - jack = ["nuc3"] - donna = ["nuc4"] - melody = ["nuc5"] - rose = ["nuc6"] - - class IPs: - __prefix__ = "172.20.1." - nuc1 = __prefix__ + "11" - nuc2 = __prefix__ + "12" - nuc3 = __prefix__ + "13" - nuc4 = __prefix__ + "14" - nuc5 = __prefix__ + "15" - nuc6 = __prefix__ + "16" - - def __init__(self, ip, ssh_target, hostname=None, robot_name=None): - """ - :type ip: str - :type ssh_target: str - """ - self.ip = ip # type: str - self.ssh_target = ssh_target # type: str - - # figure out hostname - if hostname: - self.hostname = hostname - else: - for name, iip in self.IPs.__dict__.items(): - if isinstance(ip, str) and iip == ip: - self.hostname = name - - # figure out robot_name - if robot_name: - self.robot_name = robot_name - else: - for name, computers in self.RobotComputers.__dict__.items(): - if isinstance(computers, list) and self.hostname in computers: - self.robot_name = name - - self.workspace = getattr(self.Workspaces, self.robot_name) # type: str - - self.sync_includes_file = os.path.join(BITBOTS_MAIN, f"sync_includes_wolfgang_{self.hostname[:-1]}.yaml") - - -def parse_arguments(): - parser = argparse.ArgumentParser( - description="Compile and configure software for the Wolfgang humanoid robot platform" - ) - parser.add_argument( - "target", - type=str, - help="The target robot or computer you want to compile for. Multiple targets can be specified seperated by ,", - ) - - mode = parser.add_mutually_exclusive_group(required=False) - mode.add_argument("-s", "--sync-only", action="store_true", help="Only sync file from you to the target") - mode.add_argument("-c", "--compile-only", action="store_true", help="Only build on the target") - mode.add_argument("-k", "--configure", action="store_true", help="Configure the target as well as everything else") - mode.add_argument("-K", "--configure-only", action="store_true", help="Only configure the target") - - parser.add_argument("-p", "--package", default="", help="Sync/Compile only the given ROS package") - parser.add_argument("-y", "--yes-to-all", action="store_true", help="Answer yes to all questions") - parser.add_argument( - "--clean-build", - action="store_true", - help="Clean workspace before building. If --package is given, clean only that package", - ) - parser.add_argument("--clean-src", action="store_true", help="Clean source directory before syncing") - parser.add_argument( - "--no-rosdeps", - action="store_false", - default=True, - dest="install_rosdeps", - help="Don't install rosdeps on the target.Might be useful when no internet connection is available.", - ) - parser.add_argument("--print-bit-bot", action="store_true", default=False, help="Print our logo at script start") - parser.add_argument("-v", "--verbose", action="count", default=0, help="More output") - parser.add_argument("-q", "--quiet", action="count", default=0, help="Less output") - return parser.parse_args() - - -def parse_targets(targets): - """ - Parse target argument into usable Targets - - :type targets: str - :rtype: list - """ - res = [] - - for target in targets.split(","): - # this means, a whole robot is meant - if hasattr(Target.RobotComputers, target): - for computer in getattr(Target.RobotComputers, target): - res.append(Target(getattr(Target.IPs, computer), getattr(Target.IPs, computer))) - print_info( - f"Using robot={res[-1].robot_name} hostname={res[-1].hostname} ip={res[-1].ip} for target {target}" - ) - - # this mean, a hostname was specified - elif hasattr(Target.IPs, target): - res.append(Target(getattr(Target.IPs, target), target)) - print_info( - f"Using robot={res[-1].robot_name} hostname={res[-1].hostname} ip={res[-1].ip} for target {target}" - ) - - # this means a known IP address was specified - elif target in Target.IPs.__dict__.values(): - res.append(Target(target, target)) - print_info( - f"Using robot={res[-1].robot_name} hostname={res[-1].hostname} ip={res[-1].ip} for target {target}" - ) - - # this means an arbitrary target (likely an IP) was specified - else: - try: - ipaddress.ip_address(target) - except ValueError: - print_err(f"{target} is neither a known target nor a valid ip address") - sys.exit(1) - - cmd = ["ssh", f"bitbots@{target}", "cat /etc/hostname"] - host_inspect_result = subprocess.run(cmd, stdout=subprocess.PIPE, encoding="utf-8") - - if host_inspect_result.returncode != 0: - print_err(f"Unable to connect to {target}") - sys.exit(1) - - hostname = host_inspect_result.stdout.strip() - robot_name = None - for robot, computers in Target.RobotComputers.__dict__.items(): - if isinstance(computers, list) and hostname in computers: - robot_name = robot - break - - if robot_name is None: - print_err(f"{target} does not seem to be part of a known robot") - sys.exit(1) - - res.append(Target(target, target, hostname=hostname, robot_name=robot_name)) - print_info(f"Using robot={robot_name}, hostname={hostname} ip={target} for target {target}") - - return res - - -def get_includes_from_file(file_path, package=""): - """ - Retrieve a list of file to sync from and includes-file - - :param file_path: Path of the includes-file - :type file_path: str - :param package: Limit to file from this package - :type package: str - :returns: (a list of included files, a list of excluded files) - :rtype: tuple[list, list] - """ - includes = list() - with open(file_path) as file: - data = yaml.safe_load(file) - for entry in data["exclude"]: - # --include is right here. No worries. - includes.append(f"--include=- {entry}") - for entry in data["include"]: - if isinstance(entry, dict): - for folder, subfolders in entry.items(): - if package == "": - includes.append(f"--include=+ {folder}") - for subfolder in subfolders: - includes.append(f"--include=+ {folder}/{subfolder}") - includes.append(f"--include=+ {folder}/{subfolder}/**") - elif package in subfolders: - includes.append(f"--include=+ {folder}") - includes.append(f"--include=+ {folder}/{package}") - includes.append(f"--include=+ {folder}/{package}/**") - elif isinstance(entry, str): - if package == "" or package == entry: - includes.append(f"--include=+ {entry}") - includes.append(f"--include=+ {entry}/**") - includes.append("--include=- *") - return includes - - -def _execute_on_target(target, command, catch_output=False): - """ - Execute a command on the given target over ssh - - :type target: Target - :type command: str - :type catch_output: bool - :rtype: subprocess.CompletedProcess - """ - real_cmd = ["ssh", "-t", f"bitbots@{target.ssh_target}", command] - print_debug("Calling {}".format(" ".join(real_cmd))) - - if not catch_output: - return subprocess.run(real_cmd) - else: - return subprocess.run(real_cmd, text=True, capture_output=True) - - -def _should_run_quietly(): - return LOGLEVEL.current < LOGLEVEL.INFO - - -def sync(target, package="", pre_clean=False): - """ - :type target: Target - :type package: str - :type pre_clean: bool - """ - if pre_clean: - print_info(f"Pre-cleaning on {target.hostname}") - clean_result = _execute_on_target(target, f"rm -rf {target.workspace}/src/*") - if clean_result.returncode != 0: - print_warn(f"Cleaning of source directory on {target.hostname} failed. Continuing anyways") - - print_info(f"Synchronizing {target.hostname}") - cmd = [ - "rsync", - "--checksum", - "--archive", - "--delete", - ] - - if not _should_run_quietly(): - cmd.append("--verbose") - - cmd.extend(get_includes_from_file(target.sync_includes_file, package)) - cmd.extend([BITBOTS_MAIN + "/", f"bitbots@{target.ssh_target}:{target.workspace}/src/"]) - - print_debug("Calling {}".format(" ".join(cmd))) - sync_result = subprocess.run(cmd) - if sync_result.returncode != 0: - print_err(f"Synchronizing {target.hostname} failed with error code {sync_result.returncode}") - sys.exit(sync_result.returncode) - - print_success(f"Synchronization of {target.hostname} successful") - - -def build(target, package="", pre_clean=False): - """ - :type target: Target - :type package: str - :type pre_clean: bool - """ - print_info(f"Building on {target.hostname}") - - if package and pre_clean: - print_err("Cleaning a specific package is not supported! Not cleaning.") - elif pre_clean: - cmd_clean = "rm -rf build install log;" - else: - cmd_clean = "" - - cmd = ( - "sync;" - "cd {workspace};" - "source /opt/ros/jazzy/setup.zsh;" - "source install/setup.zsh;" - "{cmd_clean}" - "ISOLATED_CPUS=\"$(grep -oP 'isolcpus=\\K([\\d-]+)' /proc/cmdline)\";" - "chrt -r 1 taskset -c ${{ISOLATED_CPUS:-0-15}} colcon build --symlink-install {package} --continue-on-error {quiet_option} || exit 1;" - "sync;" - ).format( - **{ - "workspace": target.workspace, - "cmd_clean": cmd_clean, - "quiet_option": "> /dev/null" if LOGLEVEL.current < LOGLEVEL.INFO else "", - "package": "--packages-up-to " + package if package else "", - } - ) - - build_result = _execute_on_target(target, cmd) - if build_result.returncode != 0: - print_err(f"Build on {target.hostname} failed") - sys.exit(build_result.returncode) - - print_success(f"Build on {target.hostname} succeeded") - - -def install_rosdeps(target): - """ - Install dependencies on a target with rosdep - - :type target: Target - """ - if internet_available(target): - print_info(f"Installing rosdeps on {target.hostname}") - target_src_path = os.path.join(target.workspace, "src") - extra_flags = "-q" if _should_run_quietly() else "" - - cmd = f"rosdep install -y {extra_flags} --rosdistro jazzy --ignore-src --from-paths {target_src_path}" - - rosdep_result = _execute_on_target(target, cmd) - if rosdep_result.returncode == 0: - print_success(f"Rosdeps on {target.hostname} installed successfully") - else: - print_warn(f"Rosdep install on {target.hostname} had non-zero exit code. Check its output for more info") - else: - print_info(f"Skipping rosdep install on {target.hostname} as we do not have internet") - - -def configure_game_settings(target): - print_info("Configuring game settings") - _execute_on_target( - target, - "python3 ~/colcon_ws/src/bitbots_misc/bitbots_parameter_blackboard/bitbots_parameter_blackboard/game_settings.py", - ) - print_success(f"Game settings on {target.hostname} configured") - - -def configure_wifi(target): - """ - Configure default wifi network on given target. - - :type target: Target - """ - print_info("Configuring Wifi") - - _execute_on_target(target, "nmcli connection show").check_returncode() - connection_id = input("UUID or name of connection which should be enabled [leave unchanged]: ") - - if connection_id != "": - # disable all other connections - connection_ids = ( - str( - _execute_on_target( - target, "nmcli --fields UUID,TYPE connection show | grep wifi | awk '{print $1}'", catch_output=True - ).stdout - ) - .strip() - .split("\n") - ) - for i in connection_ids: - _execute_on_target( - target, f"sudo nmcli connection modify {i} connection.autoconnect FALSE" - ).check_returncode() - _execute_on_target( - target, f"sudo nmcli connection modify {i} connection.autoconnect-priority 0" - ).check_returncode() - - _execute_on_target(target, f"sudo nmcli connection up {connection_id}").check_returncode() - _execute_on_target( - target, f"sudo nmcli connection modify {connection_id} connection.autoconnect TRUE" - ).check_returncode() - _execute_on_target( - target, f"sudo nmcli connection modify {connection_id} connection.autoconnect-priority 100" - ).check_returncode() - - -def internet_available(target): - """ - Check if target has an internet connection by pinging apt repos. - - :type target: Target - :rtype: bool - """ - print_info(f"Checking internet connection on {target.hostname}") - - apt_mirror = "de.archive.ubuntu.com" - redirect_output = "> /dev/null" if _should_run_quietly() else "" - return ( - _execute_on_target(target, f"timeout --foreground 0.5 curl -sSLI {apt_mirror} {redirect_output}").returncode - == 0 - ) - - -def main(): - args = parse_arguments() - - LOGLEVEL.current = LOGLEVEL.current + args.verbose - args.quiet - - if args.print_bit_bot: - print_bit_bot() - - targets = parse_targets(args.target) - - for target in targets: - # sync - if args.compile_only: - print_info(f"Not syncing to {target.hostname} due to compile-only mode") - elif args.configure_only: - print_info(f"Not syncing to {target.hostname} due to configure-only mode") - else: - sync(target, args.package, pre_clean=args.clean_src) - - # configure - if args.sync_only: - print_info(f"Not configuring {target.hostname} due to sync-only mode") - elif args.compile_only: - print_info(f"Not configuring {target.hostname} due to compile-only mode") - elif not (args.configure or args.configure_only): - print_info(f"Not configuring {target.hostname} due to missing --configure") - else: - print_info(f"Running game-settings script for {target.hostname}") - configure_game_settings(target) - configure_wifi(target) - - # build - if args.sync_only: - print_info(f"Not compiling on {target.hostname} due to sync-only mode") - elif args.configure_only: - print_info(f"Not compiling on {target.hostname} due to configure-only mode") - else: - if args.install_rosdeps: - install_rosdeps(target) - build(target, args.package, pre_clean=args.clean_build) - - -if __name__ == "__main__": - try: - main() - except KeyboardInterrupt: - print_err("Interrupted by user") - sys.exit(1) From d0370a1cce5976144fdf6664e3dfd9732c2236c8 Mon Sep 17 00:00:00 2001 From: Florian Vahl <7vahl@informatik.uni-hamburg.de> Date: Wed, 28 May 2025 15:17:45 +0200 Subject: [PATCH 57/65] List pip packages for debugging during ci --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 86500334c..0a65fb2fc 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,7 @@ install-no-root: pull-init update-no-root pip: # Install and upgrade pip dependencies pip install --upgrade pip --user --break-system-packages -v + pip list pip install --upgrade -r requirements/dev.txt --user --break-system-packages -v pre-commit: From 42055334b061095910eb7e92fe2f52ad21360065 Mon Sep 17 00:00:00 2001 From: Florian Vahl <7vahl@informatik.uni-hamburg.de> Date: Wed, 28 May 2025 16:02:57 +0200 Subject: [PATCH 58/65] Add interactive ssh debug for CI --- .github/workflows/ci.yml | 4 ++++ Makefile | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3af0498b..6119c8d4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,10 @@ jobs: uses: fkirc/skip-duplicate-actions@v5 with: cancel_others: 'true' + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + - name: Set up ROS ecosystem uses: ros-tooling/setup-ros@v0.7 diff --git a/Makefile b/Makefile index 0a65fb2fc..86500334c 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,6 @@ install-no-root: pull-init update-no-root pip: # Install and upgrade pip dependencies pip install --upgrade pip --user --break-system-packages -v - pip list pip install --upgrade -r requirements/dev.txt --user --break-system-packages -v pre-commit: From 6ba141b276acbe7ca656b65f9067eafe951fa26b Mon Sep 17 00:00:00 2001 From: Florian Vahl <7vahl@informatik.uni-hamburg.de> Date: Wed, 28 May 2025 16:06:45 +0200 Subject: [PATCH 59/65] Add detatch interactive CI --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6119c8d4b..a125b38ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,8 @@ jobs: - name: Setup tmate session uses: mxschmitt/action-tmate@v3 + with: + detached: true - name: Set up ROS ecosystem uses: ros-tooling/setup-ros@v0.7 From d5109990e9284843863df12298ed7fca54e00ac4 Mon Sep 17 00:00:00 2001 From: Florian Vahl <7vahl@informatik.uni-hamburg.de> Date: Wed, 28 May 2025 17:07:48 +0200 Subject: [PATCH 60/65] Add fix for pytest-repeat breaking the ci --- .github/workflows/ci.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a125b38ec..6551b5571 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,11 +18,12 @@ jobs: uses: fkirc/skip-duplicate-actions@v5 with: cancel_others: 'true' - - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - with: - detached: true + + # Remove comments to spawn an interactive debigging ssh shell in the ci + #- name: Setup tmate session + # uses: mxschmitt/action-tmate@v3 + # with: + # detached: true - name: Set up ROS ecosystem uses: ros-tooling/setup-ros@v0.7 @@ -39,7 +40,9 @@ jobs: echo "PATH=$PATH:/github/home/.local/bin" >> "$GITHUB_ENV" - name: Pull source code for libraries and install dependencies - run: make install HTTPS=true ARGS="--ci" + run: | + sudo apt-get remove python3-pytest-repeat #TODO remove once the upstream apt package reports the correct version on the newest pip version + make install HTTPS=true ARGS="--ci" - name: Set up colcon workspace run: | From d5e6b9227b81fc0c9a7373d183ab1890e59ac2f6 Mon Sep 17 00:00:00 2001 From: Florian Vahl <7vahl@informatik.uni-hamburg.de> Date: Wed, 28 May 2025 17:11:32 +0200 Subject: [PATCH 61/65] use non interactive command for ci --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6551b5571..e73122e8e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: - name: Pull source code for libraries and install dependencies run: | - sudo apt-get remove python3-pytest-repeat #TODO remove once the upstream apt package reports the correct version on the newest pip version + sudo apt-get remove -y python3-pytest-repeat #TODO remove once the upstream apt package reports the correct version on the newest pip version make install HTTPS=true ARGS="--ci" - name: Set up colcon workspace From 70baaa8332fe48156c75597bb5aa6cc5b6b5aceb Mon Sep 17 00:00:00 2001 From: texhnolyze Date: Thu, 29 May 2025 00:52:39 +0200 Subject: [PATCH 62/65] fix(setup.sh): installation issues - run ros apt key download with `sudo` to access `/usr/share` - add python bins in `~/.local/bin` to `PATH` - add `BRANCH` argument, of `bitbots_main` branch to checkout --- .../docs/manual/tutorials/install_software_ros2.rst | 3 +++ scripts/setup.sh | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/bitbots_misc/bitbots_docs/docs/manual/tutorials/install_software_ros2.rst b/bitbots_misc/bitbots_docs/docs/manual/tutorials/install_software_ros2.rst index eb4799502..176854de0 100644 --- a/bitbots_misc/bitbots_docs/docs/manual/tutorials/install_software_ros2.rst +++ b/bitbots_misc/bitbots_docs/docs/manual/tutorials/install_software_ros2.rst @@ -99,6 +99,9 @@ In case you are not using the bash shell, replace ``~/.bashrc`` and ``bash`` wit # >>> bit-bots initialize >>> + # Add python pip bins to PATH + export PATH="\$HOME/.local/bin:\$PATH" + # Ignore some deprecation warnings export PYTHONWARNINGS="ignore:::setuptools.command.install,ignore:::setuptools.command.easy_install,ignore:::pkg_resources,ignore:easy_install command is deprecated,ignore:setup.py install is deprecated" diff --git a/scripts/setup.sh b/scripts/setup.sh index d4d9de1c2..e3a3ecea3 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -2,14 +2,18 @@ set -eEuo pipefail # static/global variables -ROS_DISTRO=${ROS_DISTRO:-"jazzy"} DIR="$(dirname "$(readlink -f "$0")")" +BRANCH="${1:-main}" +ROS_DISTRO=${ROS_DISTRO:-"jazzy"} COLCON_WS="${COLCON_WS:-"$HOME/colcon_ws"}" REPO_URL="git@github.com:bit-bots/bitbots_main.git" SHELL_CONFIG="$(cat <>> bit-bots initialize >>> +# Add python pip bins to PATH +export PATH="\$HOME/.local/bin:\$PATH" + # Ignore some deprecation warnings export PYTHONWARNINGS="ignore:::setuptools.command.install,ignore:::setuptools.command.easy_install,ignore:::pkg_resources,ignore:easy_install command is deprecated,ignore:setup.py install is deprecated" @@ -59,7 +63,7 @@ setup_ros() { if [[ ! -f /etc/apt/sources.list.d/ros2.list ]]; then echo "Adding ROS 2 repository..." sudo apt install -y curl lsb-release - curl -fsSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key > /usr/share/keyrings/ros-archive-keyring.gpg + sudo sh -c "curl -fsSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key > /usr/share/keyrings/ros-archive-keyring.gpg" sudo sh -c "echo 'deb [signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main' > /etc/apt/sources.list.d/ros2.list" fi @@ -86,10 +90,11 @@ setup_repo() { if (( in_repo )); then cd "$meta_dir" || exit + git checkout "$BRANCH" else if [[ ! -d "$PWD/bitbots_main" ]]; then git clone "$REPO_URL" - git switch feature/jazzy-ubuntu2404-devcontainer + git checkout "$BRANCH" fi meta_dir="$(realpath "$PWD/bitbots_main")" From cd990b068421471baf34ac309738fd6d71df3d7a Mon Sep 17 00:00:00 2001 From: texhnolyze Date: Thu, 29 May 2025 01:06:34 +0200 Subject: [PATCH 63/65] Revert "fix(hlvs): simulation configuration" This reverts commit 86b73baa7b82d97cf65f7b1ee6708382441bc7eb. --- .../config/walking_wolfgang_simulator.yaml | 4 ++-- .../bitbots_robocup_api/launch/robocup_teamplayer.launch | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/bitbots_motion/bitbots_quintic_walk/config/walking_wolfgang_simulator.yaml b/bitbots_motion/bitbots_quintic_walk/config/walking_wolfgang_simulator.yaml index 38fd0a5ac..843c69281 100644 --- a/bitbots_motion/bitbots_quintic_walk/config/walking_wolfgang_simulator.yaml +++ b/bitbots_motion/bitbots_quintic_walk/config/walking_wolfgang_simulator.yaml @@ -75,13 +75,13 @@ walking: phase_reset: min_phase: 0.90 foot_pressure: - active: False + active: True ground_min_pressure: 1.5 effort: active: False joint_min_effort: 30.0 imu: - active: True + active: False y_acceleration_threshold: 1.4 trunk_pid: diff --git a/bitbots_simulation/bitbots_robocup_api/launch/robocup_teamplayer.launch b/bitbots_simulation/bitbots_robocup_api/launch/robocup_teamplayer.launch index f329c938f..90d0d21e2 100644 --- a/bitbots_simulation/bitbots_robocup_api/launch/robocup_teamplayer.launch +++ b/bitbots_simulation/bitbots_robocup_api/launch/robocup_teamplayer.launch @@ -16,6 +16,5 @@ - From 7211a8cdaf9c241e7e39daf47d979f842c99c8f3 Mon Sep 17 00:00:00 2001 From: texhnolyze Date: Thu, 29 May 2025 11:31:52 +0200 Subject: [PATCH 64/65] fix(deploy): pass ros-distro to `rosdep` and fix `pip` install by passing `--break-system-packages` --- scripts/deploy/tasks/install.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/deploy/tasks/install.py b/scripts/deploy/tasks/install.py index f636901a8..2c9c5dac4 100644 --- a/scripts/deploy/tasks/install.py +++ b/scripts/deploy/tasks/install.py @@ -135,7 +135,7 @@ def _install_rosdeps(self, connections: Group) -> GroupResult: remote_src_path = os.path.join(self._remote_workspace, "src") print_debug(f"Gathering rosdep install commands in {remote_src_path}") - cmd = f"rosdep update && rosdep install --simulate --default-yes --ignore-src --from-paths {remote_src_path}" + cmd = f"rosdep update && rosdep install --rosdistro jazzy --simulate --default-yes --ignore-src --from-paths {remote_src_path}" print_debug(f"Calling {cmd}") try: gather_results = connections.run(cmd, hide=hide_output()) @@ -232,7 +232,7 @@ def _pip_upgrade(self, connections: Group) -> GroupResult: """ print_debug("Upgrading pip packages") - cmd = f"pip3 install --upgrade -r {self._remote_workspace}/src/requirements/robot.txt" + cmd = f"pip3 install --user --upgrade --break-system-packages -r {self._remote_workspace}/src/requirements/robot.txt" print_debug(f"Calling {cmd}") try: upgrade_results = connections.run(cmd, hide=hide_output()) From c94eacbf6eab72798eeb14298130ddcda3519113 Mon Sep 17 00:00:00 2001 From: texhnolyze Date: Thu, 29 May 2025 11:56:15 +0200 Subject: [PATCH 65/65] refactor(vscode): add ros jazzy python libs to autocomplete --- .vscode/settings.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 0fc7265f9..ba732efae 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -223,10 +223,10 @@ "ros.distro": "jazzy", "search.useIgnoreFiles": false, "python.autoComplete.extraPaths": [ - "/opt/ros/jazzy/lib/python3.10/site-packages" + "/opt/ros/jazzy/lib/python3.12/site-packages" ], "python.analysis.extraPaths": [ - "/opt/ros/jazzy/lib/python3.10/site-packages" + "/opt/ros/jazzy/lib/python3.12/site-packages" ], "cmake.configureOnOpen": false, "editor.formatOnSave": true,