Skip to content

Commit dacfb4e

Browse files
committed
Changes according to make format and changed ros distro to jazzy
1 parent 3c0b69c commit dacfb4e

66 files changed

Lines changed: 125 additions & 153 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ jobs:
3939
4040
- name: Build packages
4141
run: |
42-
. /opt/ros/iron/setup.sh
42+
. /opt/ros/jazzy/setup.sh
4343
colcon build --symlink-install
4444
working-directory: /colcon_ws
4545

4646
- name: Test packages
4747
run: |
4848
# Source workspace
49-
. /opt/ros/iron/setup.sh
49+
. /opt/ros/jazzy/setup.sh
5050
. install/setup.sh
5151
# Run tests for all packages
5252
colcon test --event-handlers console_direct+ --return-code-on-test-failure --parallel-workers 1

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repos:
1616
- id: cppcheck
1717
args:
1818
- "--inline-suppr"
19-
- "--suppress=missingInclude"
19+
- "--suppress=missingIncludeSystem"
2020
- "--suppress=unmatchedSuppression"
2121
- "--suppress=unusedFunction"
2222
- "--suppress=unusedStructMember"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![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)
44
[![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)
5-
[![ROS Version Iron](https://img.shields.io/badge/ROS%20Version-Iron-ab8c71)](https://docs.ros.org/en/iron/index.html)
5+
[![ROS Version Jazzy](https://img.shields.io/badge/ROS%20Version-Jazzy-00b8ff)](https://docs.ros.org/en/jazzy/index.html)
66

77
This git repository contains all RoboCup-related code and documentation from the Hamburg Bit-Bots team.
88
All code is written as individual ROS 2 packages targeting Ubuntu.

bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/utils.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#ifndef BITBOTS_ROS_CONTROL_INCLUDE_BITBOTS_ROS_CONTROL_UTILS_H_
22
#define BITBOTS_ROS_CONTROL_INCLUDE_BITBOTS_ROS_CONTROL_UTILS_H_
33

4-
#include "bitbots_msgs/msg/audio.hpp"
5-
#include "rclcpp/rclcpp.hpp"
4+
#include <bitbots_msgs/msg/audio.hpp>
5+
#include <rclcpp/rclcpp.hpp>
66

77
namespace bitbots_ros_control {
88

@@ -13,7 +13,7 @@ void speakError(rclcpp::Publisher<bitbots_msgs::msg::Audio>::SharedPtr speak_pub
1313

1414
uint16_t dxlMakeword(uint64_t a, uint64_t b);
1515
uint32_t dxlMakedword(uint64_t a, uint64_t b);
16-
float dxlMakeFloat(uint8_t* data);
16+
float dxlMakeFloat(const uint8_t* data);
1717

1818
std::string gyroRangeToString(uint8_t range);
1919
std::string accelRangeToString(uint8_t range);

bitbots_lowlevel/bitbots_ros_control/src/dynamixel_servo_hardware_interface.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ void DynamixelServoHardwareInterface::individualTorqueCb(bitbots_msgs::msg::Join
148148
RCLCPP_WARN(nh_->get_logger(), "Couldn't set torque for servo %s ", msg.joint_names[i].c_str());
149149
}
150150
}
151-
for (auto &bus : bus_interfaces_) {
151+
for (const auto &bus : bus_interfaces_) {
152152
bus->switch_individual_torque_ = true;
153153
}
154154
}
@@ -157,7 +157,7 @@ void DynamixelServoHardwareInterface::setTorqueCb(std_msgs::msg::Bool::SharedPtr
157157
/**
158158
* This saves the given required value, so that it can be written to the servos in the write method
159159
*/
160-
for (auto &bus : bus_interfaces_) {
160+
for (const auto &bus : bus_interfaces_) {
161161
bus->goal_torque_ = enabled->data;
162162
}
163163
for (size_t j = 0; j < joint_names_.size(); j++) {
@@ -196,7 +196,7 @@ void DynamixelServoHardwareInterface::write(const rclcpp::Time &t, const rclcpp:
196196
// set all values from controller to the buses
197197
// todo improve performance
198198
int i = 0;
199-
for (auto &bus : bus_interfaces_) {
199+
for (const auto &bus : bus_interfaces_) {
200200
for (int j = 0; j < bus->joint_count_; j++) {
201201
bus->goal_position_[j] = goal_position_[i];
202202
bus->goal_velocity_[j] = goal_velocity_[i];

bitbots_lowlevel/bitbots_ros_control/src/servo_bus_interface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ bool ServoBusInterface::writeROMRAM(bool first_time) {
202202
// Allocate memory for the values in the driver
203203
std::vector<int> values(joint_names_.size());
204204
// Iterate over parameter names
205-
for (auto register_name : parameter_names) {
205+
for (const auto &register_name : parameter_names) {
206206
// Get the value for each joint
207207
for (size_t num = 0; num < joint_names_.size(); num++) {
208208
// Get the value from the cache

bitbots_lowlevel/bitbots_ros_control/src/utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ uint32_t dxlMakedword(uint64_t a, uint64_t b) {
4040
return uint32_t(uint16_t(a & 0xffff) | uint32_t(uint16_t(b & 0xffff) << 16));
4141
}
4242

43-
float dxlMakeFloat(uint8_t* data) {
43+
float dxlMakeFloat(const uint8_t* data) {
4444
float f;
4545
uint32_t b = dxlMakedword(dxlMakeword(data[0], data[1]), dxlMakeword(data[2], data[3]));
4646
memcpy(&f, &b, sizeof(f));

bitbots_lowlevel/bitbots_ros_control/src/wolfgang_hardware_interface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ void WolfgangHardwareInterface::write(const rclcpp::Time &t, const rclcpp::Durat
307307
}
308308
if (!bus_start_time_ || t > bus_start_time_.value()) {
309309
if (bus_first_write_) {
310-
for (std::vector<std::shared_ptr<HardwareInterface>> &port_interfaces : interfaces_) {
310+
for (std::vector<std::shared_ptr<HardwareInterface>> const &port_interfaces : interfaces_) {
311311
for (std::shared_ptr<HardwareInterface> interface : port_interfaces) {
312312
interface->restoreAfterPowerCycle();
313313
}

bitbots_misc/bitbots_basler_camera/src/basler_camera.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@
1212
#include <iostream>
1313
#include <memory>
1414
#include <opencv2/imgproc/imgproc.hpp>
15+
#include <pylon_camera_parameters.hpp>
1516
#include <rclcpp/experimental/executors/events_executor/events_executor.hpp>
1617
#include <rclcpp/logger.hpp>
1718
#include <rclcpp/rclcpp.hpp>
1819
#include <string>
1920
#include <vector>
2021

21-
#include "pylon_camera_parameters.hpp"
22-
2322
using std::placeholders::_1, std::placeholders::_2;
2423
using namespace Pylon;
2524

@@ -271,7 +270,8 @@ class BaslerCamera {
271270
}
272271

273272
// Convert to cv::Mat
274-
cv::Mat image(ptrGrabResult->GetHeight(), ptrGrabResult->GetWidth(), CV_8UC1, (uint8_t*)ptrGrabResult->GetBuffer());
273+
cv::Mat image(ptrGrabResult->GetHeight(), ptrGrabResult->GetWidth(), CV_8UC1,
274+
static_cast<uint8_t*>(ptrGrabResult->GetBuffer()));
275275

276276
// Create cv::Mat for color image
277277
cv::Mat color(image.size(), CV_MAKETYPE(CV_8U, 3));

bitbots_misc/bitbots_docs/docs/manual/testing/testing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Compile (compiles)
4949
------------------
5050

5151
The first step is to test if the package compiles.
52-
Obviously this should preferably be tested on the same system that is used on the robot (Ubuntu 22.04 with the iron distribution).
52+
Obviously this should preferably be tested on the same system that is used on the robot (Ubuntu 24.04 with the jazzy distribution).
5353
A part of this is to check if all dependencies are correct in the package.xml.
5454
This is important so they can be installed with rosdep.
5555

0 commit comments

Comments
 (0)