UAlbertaFSAE / f1tenth

MIT License
0 stars 0 forks source link

onboarding complete #87

Closed timy-13 closed 3 weeks ago

timy-13 commented 3 weeks ago

Proposed changes

Completed onboarding

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

github-actions[bot] commented 3 weeks ago

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON mypy 1 0 1.23s
✅ PYTHON ruff 1 0 0.01s

See detailed report in MegaLinter reports _Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff_

_MegaLinter is graciously provided by OX Security_

github-actions[bot] commented 3 weeks ago

Cpp-Linter Report :warning:

Some files did not pass the configured checks!

clang-tidy (v18.1.8) reports: 35 concern(s) - **src/onboarding/include/onboarding/odom_publisher.h:1:1:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > included header ackermann_drive_stamped.hpp is not used directly ```h 1 | #include "ackermann_msgs/msg/ackermann_drive_stamped.hpp" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | #include "rclcpp/rclcpp.hpp" ``` - **src/onboarding/include/onboarding/odom_publisher.h:2:1:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > included header rclcpp.hpp is not used directly ```h 2 | #include "rclcpp/rclcpp.hpp" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | ``` - **src/onboarding/include/onboarding/odom_publisher.h:4:38:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "rclcpp::Node" is directly included ```h 1 | #include "ackermann_msgs/msg/ackermann_drive_stamped.hpp" 2 | #include "rclcpp/rclcpp.hpp" 3 | 4 | class OdomPublisher : public rclcpp::Node { | ^ ``` - **src/onboarding/include/onboarding/odom_publisher.h:12:8:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "std::string" is directly included ```h 1 | #include "ackermann_msgs/msg/ackermann_drive_stamped.hpp" 2 | #include "rclcpp/rclcpp.hpp" 3 | 4 | class OdomPublisher : public rclcpp::Node { 5 | public: 6 | OdomPublisher(); 7 | 8 | private: 9 | double v_; 10 | double d_; 11 | 12 | std::string drive_; | ^ ``` - **src/onboarding/include/onboarding/odom_publisher.h:14:11:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "rclcpp::TimerBase" is directly included ```h 1 | #include "ackermann_msgs/msg/ackermann_drive_stamped.hpp" 2 | #include "rclcpp/rclcpp.hpp" 3 | 4 | class OdomPublisher : public rclcpp::Node { 5 | public: 6 | OdomPublisher(); 7 | 8 | private: 9 | double v_; 10 | double d_; 11 | 12 | std::string drive_; 13 | 14 | rclcpp::TimerBase::SharedPtr timer_; | ^ ``` - **src/onboarding/include/onboarding/odom_publisher.h:16:11:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "rclcpp::Publisher" is directly included ```h 1 | #include "ackermann_msgs/msg/ackermann_drive_stamped.hpp" 2 | #include "rclcpp/rclcpp.hpp" 3 | 4 | class OdomPublisher : public rclcpp::Node { 5 | public: 6 | OdomPublisher(); 7 | 8 | private: 9 | double v_; 10 | double d_; 11 | 12 | std::string drive_; 13 | 14 | rclcpp::TimerBase::SharedPtr timer_; 15 | 16 | rclcpp::Publisher::SharedPtr publisher_drive_; | ^ ``` - **src/onboarding/include/onboarding/odom_publisher.h:16:42:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "ackermann_msgs::msg::AckermannDriveStamped" is directly included ```h 1 | #include "ackermann_msgs/msg/ackermann_drive_stamped.hpp" 2 | #include "rclcpp/rclcpp.hpp" 3 | 4 | class OdomPublisher : public rclcpp::Node { 5 | public: 6 | OdomPublisher(); 7 | 8 | private: 9 | double v_; 10 | double d_; 11 | 12 | std::string drive_; 13 | 14 | rclcpp::TimerBase::SharedPtr timer_; 15 | 16 | rclcpp::Publisher::SharedPtr publisher_drive_; | ^ ``` - **src/onboarding/include/onboarding/odom_relay.h:1:1:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > included header ackermann_drive_stamped.hpp is not used directly ```h 1 | #include "ackermann_msgs/msg/ackermann_drive_stamped.hpp" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | #include "rclcpp/rclcpp.hpp" ``` - **src/onboarding/include/onboarding/odom_relay.h:2:1:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > included header rclcpp.hpp is not used directly ```h 2 | #include "rclcpp/rclcpp.hpp" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | ``` - **src/onboarding/include/onboarding/odom_relay.h:4:34:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "rclcpp::Node" is directly included ```h 1 | #include "ackermann_msgs/msg/ackermann_drive_stamped.hpp" 2 | #include "rclcpp/rclcpp.hpp" 3 | 4 | class OdomRelay : public rclcpp::Node { | ^ ``` - **src/onboarding/include/onboarding/odom_relay.h:9:8:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "std::string" is directly included ```h 1 | #include "ackermann_msgs/msg/ackermann_drive_stamped.hpp" 2 | #include "rclcpp/rclcpp.hpp" 3 | 4 | class OdomRelay : public rclcpp::Node { 5 | public: 6 | OdomRelay(); 7 | 8 | private: 9 | std::string drive_topic_; | ^ ``` - **src/onboarding/include/onboarding/odom_relay.h:15:11:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "rclcpp::Subscription" is directly included ```h 1 | #include "ackermann_msgs/msg/ackermann_drive_stamped.hpp" 2 | #include "rclcpp/rclcpp.hpp" 3 | 4 | class OdomRelay : public rclcpp::Node { 5 | public: 6 | OdomRelay(); 7 | 8 | private: 9 | std::string drive_topic_; 10 | std::string drive_relay_; 11 | 12 | double speed_; 13 | double steering_angle_; 14 | 15 | rclcpp::Subscription::SharedPtr subscriber_drive_; | ^ ``` - **src/onboarding/include/onboarding/odom_relay.h:15:45:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "ackermann_msgs::msg::AckermannDriveStamped" is directly included ```h 1 | #include "ackermann_msgs/msg/ackermann_drive_stamped.hpp" 2 | #include "rclcpp/rclcpp.hpp" 3 | 4 | class OdomRelay : public rclcpp::Node { 5 | public: 6 | OdomRelay(); 7 | 8 | private: 9 | std::string drive_topic_; 10 | std::string drive_relay_; 11 | 12 | double speed_; 13 | double steering_angle_; 14 | 15 | rclcpp::Subscription::SharedPtr subscriber_drive_; | ^ ``` - **src/onboarding/include/onboarding/odom_relay.h:17:11:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "rclcpp::Publisher" is directly included ```h 1 | rclcpp::Publisher::SharedPtr publisher_relay_; | ^ ``` - **src/onboarding/src/odom_publisher.cpp:7:34:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "rclcpp::Node" is directly included ```cpp 4 | 5 | using namespace std::chrono_literals; 6 | 7 | OdomPublisher::OdomPublisher() : Node("odom_publisher_node") { | ^ ``` - **src/onboarding/src/odom_publisher.cpp:20:51:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "ackermann_msgs::msg::AckermannDriveStamped" is directly included ```cpp 3 | this->create_publisher(drive_, 25); | ^ ``` - **src/onboarding/src/odom_publisher.cpp:23:21:** warning: [[readability-function-cognitive-complexity](https://clang.llvm.org/extra/clang-tidy/checks/readability/function-cognitive-complexity.html)] > function 'publishMessage' has cognitive complexity of 36 (threshold 25) ```cpp 23 | void OdomPublisher::publishMessage() { | ^ /__w/f1tenth/f1tenth/src/onboarding/src/odom_publisher.cpp:34:3: note: +1, including nesting penalty of 0, nesting level increased to 1 34 | RCLCPP_INFO(this->get_logger(), "Speed: %.2f, Steering Angle: %.2f", drive_msg_obj.drive.speed, | ^ /opt/ros/humble/include/rclcpp/rclcpp/logging.hpp:529:3: note: expanded from macro 'RCLCPP_INFO' 529 | do { \ | ^ /__w/f1tenth/f1tenth/src/onboarding/src/odom_publisher.cpp:34:3: note: +2, including nesting penalty of 1, nesting level increased to 2 34 | RCLCPP_INFO(this->get_logger(), "Speed: %.2f, Steering Angle: %.2f", drive_msg_obj.drive.speed, | ^ /opt/ros/humble/include/rclcpp/rclcpp/logging.hpp:535:5: note: expanded from macro 'RCLCPP_INFO' 535 | RCUTILS_LOG_INFO_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:507:3: note: expanded from macro 'RCUTILS_LOG_INFO_NAMED' 507 | RCUTILS_LOG_COND_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:74:3: note: expanded from macro 'RCUTILS_LOG_COND_NAMED' 74 | do { \ | ^ /__w/f1tenth/f1tenth/src/onboarding/src/odom_publisher.cpp:34:3: note: +3, including nesting penalty of 2, nesting level increased to 3 34 | RCLCPP_INFO(this->get_logger(), "Speed: %.2f, Steering Angle: %.2f", drive_msg_obj.drive.speed, | ^ /opt/ros/humble/include/rclcpp/rclcpp/logging.hpp:535:5: note: expanded from macro 'RCLCPP_INFO' 535 | RCUTILS_LOG_INFO_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:507:3: note: expanded from macro 'RCUTILS_LOG_INFO_NAMED' 507 | RCUTILS_LOG_COND_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:75:5: note: expanded from macro 'RCUTILS_LOG_COND_NAMED' 75 | RCUTILS_LOGGING_AUTOINIT; \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging.h:525:3: note: expanded from macro 'RCUTILS_LOGGING_AUTOINIT' 525 | do { \ | ^ /__w/f1tenth/f1tenth/src/onboarding/src/odom_publisher.cpp:34:3: note: +4, including nesting penalty of 3, nesting level increased to 4 34 | RCLCPP_INFO(this->get_logger(), "Speed: %.2f, Steering Angle: %.2f", drive_msg_obj.drive.speed, | ^ /opt/ros/humble/include/rclcpp/rclcpp/logging.hpp:535:5: note: expanded from macro 'RCLCPP_INFO' 535 | RCUTILS_LOG_INFO_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:507:3: note: expanded from macro 'RCUTILS_LOG_INFO_NAMED' 507 | RCUTILS_LOG_COND_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:75:5: note: expanded from macro 'RCUTILS_LOG_COND_NAMED' 75 | RCUTILS_LOGGING_AUTOINIT; \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging.h:526:5: note: expanded from macro 'RCUTILS_LOGGING_AUTOINIT' 526 | if (RCUTILS_UNLIKELY(!g_rcutils_logging_initialized)) { \ | ^ /__w/f1tenth/f1tenth/src/onboarding/src/odom_publisher.cpp:34:3: note: +5, including nesting penalty of 4, nesting level increased to 5 34 | RCLCPP_INFO(this->get_logger(), "Speed: %.2f, Steering Angle: %.2f", drive_msg_obj.drive.speed, | ^ /opt/ros/humble/include/rclcpp/rclcpp/logging.hpp:535:5: note: expanded from macro 'RCLCPP_INFO' 535 | RCUTILS_LOG_INFO_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:507:3: note: expanded from macro 'RCUTILS_LOG_INFO_NAMED' 507 | RCUTILS_LOG_COND_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:75:5: note: expanded from macro 'RCUTILS_LOG_COND_NAMED' 75 | RCUTILS_LOGGING_AUTOINIT; \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging.h:527:7: note: expanded from macro 'RCUTILS_LOGGING_AUTOINIT' 527 | if (rcutils_logging_initialize() != RCUTILS_RET_OK) { \ | ^ /__w/f1tenth/f1tenth/src/onboarding/src/odom_publisher.cpp:34:3: note: +6, including nesting penalty of 5, nesting level increased to 6 34 | RCLCPP_INFO(this->get_logger(), "Speed: %.2f, Steering Angle: %.2f", drive_msg_obj.drive.speed, | ^ /opt/ros/humble/include/rclcpp/rclcpp/logging.hpp:535:5: note: expanded from macro 'RCLCPP_INFO' 535 | RCUTILS_LOG_INFO_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:507:3: note: expanded from macro 'RCUTILS_LOG_INFO_NAMED' 507 | RCUTILS_LOG_COND_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:75:5: note: expanded from macro 'RCUTILS_LOG_COND_NAMED' 75 | RCUTILS_LOGGING_AUTOINIT; \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging.h:528:9: note: expanded from macro 'RCUTILS_LOGGING_AUTOINIT' 528 | RCUTILS_SAFE_FWRITE_TO_STDERR( \ | ^ /opt/ros/humble/include/rcutils/rcutils/error_handling.h:54:3: note: expanded from macro 'RCUTILS_SAFE_FWRITE_TO_STDERR' 54 | do {fwrite(msg, sizeof(char), strlen(msg), stderr);} while (0) | ^ /__w/f1tenth/f1tenth/src/onboarding/src/odom_publisher.cpp:34:3: note: +6, including nesting penalty of 5, nesting level increased to 6 34 | RCLCPP_INFO(this->get_logger(), "Speed: %.2f, Steering Angle: %.2f", drive_msg_obj.drive.speed, | ^ /opt/ros/humble/include/rclcpp/rclcpp/logging.hpp:535:5: note: expanded from macro 'RCLCPP_INFO' 535 | RCUTILS_LOG_INFO_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:507:3: note: expanded from macro 'RCUTILS_LOG_INFO_NAMED' 507 | RCUTILS_LOG_COND_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:75:5: note: expanded from macro 'RCUTILS_LOG_COND_NAMED' 75 | RCUTILS_LOGGING_AUTOINIT; \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging.h:531:9: note: expanded from macro 'RCUTILS_LOGGING_AUTOINIT' 531 | RCUTILS_SAFE_FWRITE_TO_STDERR(rcutils_get_error_string().str); \ | ^ /opt/ros/humble/include/rcutils/rcutils/error_handling.h:54:3: note: expanded from macro 'RCUTILS_SAFE_FWRITE_TO_STDERR' 54 | do {fwrite(msg, sizeof(char), strlen(msg), stderr);} while (0) | ^ /__w/f1tenth/f1tenth/src/onboarding/src/odom_publisher.cpp:34:3: note: +6, including nesting penalty of 5, nesting level increased to 6 34 | RCLCPP_INFO(this->get_logger(), "Speed: %.2f, Steering Angle: %.2f", drive_msg_obj.drive.speed, | ^ /opt/ros/humble/include/rclcpp/rclcpp/logging.hpp:535:5: note: expanded from macro 'RCLCPP_INFO' 535 | RCUTILS_LOG_INFO_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:507:3: note: expanded from macro 'RCUTILS_LOG_INFO_NAMED' 507 | RCUTILS_LOG_COND_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:75:5: note: expanded from macro 'RCUTILS_LOG_COND_NAMED' 75 | RCUTILS_LOGGING_AUTOINIT; \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging.h:532:9: note: expanded from macro 'RCUTILS_LOGGING_AUTOINIT' 532 | RCUTILS_SAFE_FWRITE_TO_STDERR("\n"); \ | ^ /opt/ros/humble/include/rcutils/rcutils/error_handling.h:54:3: note: expanded from macro 'RCUTILS_SAFE_FWRITE_TO_STDERR' 54 | do {fwrite(msg, sizeof(char), strlen(msg), stderr);} while (0) | ^ /__w/f1tenth/f1tenth/src/onboarding/src/odom_publisher.cpp:34:3: note: +3, including nesting penalty of 2, nesting level increased to 3 34 | RCLCPP_INFO(this->get_logger(), "Speed: %.2f, Steering Angle: %.2f", drive_msg_obj.drive.speed, | ^ /opt/ros/humble/include/rclcpp/rclcpp/logging.hpp:535:5: note: expanded from macro 'RCLCPP_INFO' 535 | RCUTILS_LOG_INFO_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:507:3: note: expanded from macro 'RCUTILS_LOG_INFO_NAMED' 507 | RCUTILS_LOG_COND_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:77:5: note: expanded from macro 'RCUTILS_LOG_COND_NAMED' 77 | if (rcutils_logging_logger_is_enabled_for(name, severity)) { \ | ^ /__w/f1tenth/f1tenth/src/onboarding/src/odom_publisher.cpp:29:31: warning: narrowing conversion from 'double' to '_speed_type' (aka 'float') [bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions] 29 | drive_msg_obj.drive.speed = v_; | ^ /__w/f1tenth/f1tenth/src/onboarding/src/odom_publisher.cpp:30:40: warning: narrowing conversion from 'double' to '_steering_angle_type' (aka 'float') [bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions] 30 | drive_msg_obj.drive.steering_angle = d_; | ^ ``` - **src/onboarding/src/odom_publisher.cpp:34:3:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "RCLCPP_INFO" is directly included ```cpp 4 | RCLCPP_INFO(this->get_logger(), "Speed: %.2f, Steering Angle: %.2f", drive_msg_obj.drive.speed, | ^ ``` - **src/onboarding/src/odom_publisher.cpp:40:5:** warning: [[bugprone-exception-escape](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/exception-escape.html)] > an exception may be thrown in function 'main' which should not throw exceptions ```cpp 40 | int main(int argc, char **argv) { | ^ ``` - **src/onboarding/src/odom_publisher.cpp:41:11:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "rclcpp::init" is directly included ```cpp 4 | rclcpp::init(argc, argv); | ^ ``` - **src/onboarding/src/odom_publisher.cpp:42:24:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "std::make_shared" is directly included ```cpp 4 | auto node_ptr = std::make_shared(); // initialise node pointer | ^ ``` - **src/onboarding/src/odom_publisher.cpp:43:11:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "rclcpp::spin" is directly included ```cpp 4 | rclcpp::spin(node_ptr); | ^ ``` - **src/onboarding/src/odom_publisher.cpp:44:11:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "rclcpp::shutdown" is directly included ```cpp 44 | rclcpp::shutdown(); | ^ ``` - **src/onboarding/src/odom_relay.cpp:3:26:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "std::placeholders::_1" is directly included ```cpp 2 | 3 | using std::placeholders::_1; | ^ /__w/f1tenth/f1tenth/src/onboarding/src/odom_relay.cpp:5:1: warning: constructor does not initialize these fields: speed_, steering_angle_ [cppcoreguidelines-pro-type-member-init,hicpp-member-init] 5 | OdomRelay::OdomRelay() : Node("odom_relay_node") { | ^ ``` - **src/onboarding/src/odom_relay.cpp:5:26:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "rclcpp::Node" is directly included ```cpp 2 | 3 | using std::placeholders::_1; 4 | 5 | OdomRelay::OdomRelay() : Node("odom_relay_node") { | ^ ``` - **src/onboarding/src/odom_relay.cpp:12:70:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "ackermann_msgs::msg::AckermannDriveStamped" is directly included ```cpp 2 | 3 | using std::placeholders::_1; 4 | 5 | OdomRelay::OdomRelay() : Node("odom_relay_node") { 6 | this->declare_parameter("drive_topic", "/drive"); 7 | this->declare_parameter("drive_relay", "/relay"); 8 | 9 | drive_topic_ = this->get_parameter("drive_topic").as_string(); 10 | drive_relay_ = this->get_parameter("drive_relay").as_string(); 11 | 12 | subscriber_drive_ = this->create_subscription( | ^ ``` - **src/onboarding/src/odom_relay.cpp:13:25:** warning: [[modernize-avoid-bind](https://clang.llvm.org/extra/clang-tidy/checks/modernize/avoid-bind.html)] > prefer a lambda to std::bind ```cpp 13 | drive_topic_, 25, std::bind(&OdomRelay::relay, this, _1)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | [this](auto && PH1) { relay(std::forward(PH1)); } ``` - **src/onboarding/src/odom_relay.cpp:13:30:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "std::bind" is directly included ```cpp 13 | drive_topic_, 25, std::bind(&OdomRelay::relay, this, _1)); | ^ ``` - **src/onboarding/src/odom_relay.cpp:25:17:** warning: [[readability-function-cognitive-complexity](https://clang.llvm.org/extra/clang-tidy/checks/readability/function-cognitive-complexity.html)] > function 'publishRelay' has cognitive complexity of 36 (threshold 25) ```cpp 25 | void OdomRelay::publishRelay(double speed, double steering_angle) { | ^ /__w/f1tenth/f1tenth/src/onboarding/src/odom_relay.cpp:30:3: note: +1, including nesting penalty of 0, nesting level increased to 1 30 | RCLCPP_INFO(this->get_logger(), "Speed: %.2f, Steering Angle: %.2f", relay_msg_obj.drive.speed, | ^ /opt/ros/humble/include/rclcpp/rclcpp/logging.hpp:529:3: note: expanded from macro 'RCLCPP_INFO' 529 | do { \ | ^ /__w/f1tenth/f1tenth/src/onboarding/src/odom_relay.cpp:30:3: note: +2, including nesting penalty of 1, nesting level increased to 2 30 | RCLCPP_INFO(this->get_logger(), "Speed: %.2f, Steering Angle: %.2f", relay_msg_obj.drive.speed, | ^ /opt/ros/humble/include/rclcpp/rclcpp/logging.hpp:535:5: note: expanded from macro 'RCLCPP_INFO' 535 | RCUTILS_LOG_INFO_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:507:3: note: expanded from macro 'RCUTILS_LOG_INFO_NAMED' 507 | RCUTILS_LOG_COND_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:74:3: note: expanded from macro 'RCUTILS_LOG_COND_NAMED' 74 | do { \ | ^ /__w/f1tenth/f1tenth/src/onboarding/src/odom_relay.cpp:30:3: note: +3, including nesting penalty of 2, nesting level increased to 3 30 | RCLCPP_INFO(this->get_logger(), "Speed: %.2f, Steering Angle: %.2f", relay_msg_obj.drive.speed, | ^ /opt/ros/humble/include/rclcpp/rclcpp/logging.hpp:535:5: note: expanded from macro 'RCLCPP_INFO' 535 | RCUTILS_LOG_INFO_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:507:3: note: expanded from macro 'RCUTILS_LOG_INFO_NAMED' 507 | RCUTILS_LOG_COND_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:75:5: note: expanded from macro 'RCUTILS_LOG_COND_NAMED' 75 | RCUTILS_LOGGING_AUTOINIT; \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging.h:525:3: note: expanded from macro 'RCUTILS_LOGGING_AUTOINIT' 525 | do { \ | ^ /__w/f1tenth/f1tenth/src/onboarding/src/odom_relay.cpp:30:3: note: +4, including nesting penalty of 3, nesting level increased to 4 30 | RCLCPP_INFO(this->get_logger(), "Speed: %.2f, Steering Angle: %.2f", relay_msg_obj.drive.speed, | ^ /opt/ros/humble/include/rclcpp/rclcpp/logging.hpp:535:5: note: expanded from macro 'RCLCPP_INFO' 535 | RCUTILS_LOG_INFO_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:507:3: note: expanded from macro 'RCUTILS_LOG_INFO_NAMED' 507 | RCUTILS_LOG_COND_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:75:5: note: expanded from macro 'RCUTILS_LOG_COND_NAMED' 75 | RCUTILS_LOGGING_AUTOINIT; \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging.h:526:5: note: expanded from macro 'RCUTILS_LOGGING_AUTOINIT' 526 | if (RCUTILS_UNLIKELY(!g_rcutils_logging_initialized)) { \ | ^ /__w/f1tenth/f1tenth/src/onboarding/src/odom_relay.cpp:30:3: note: +5, including nesting penalty of 4, nesting level increased to 5 30 | RCLCPP_INFO(this->get_logger(), "Speed: %.2f, Steering Angle: %.2f", relay_msg_obj.drive.speed, | ^ /opt/ros/humble/include/rclcpp/rclcpp/logging.hpp:535:5: note: expanded from macro 'RCLCPP_INFO' 535 | RCUTILS_LOG_INFO_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:507:3: note: expanded from macro 'RCUTILS_LOG_INFO_NAMED' 507 | RCUTILS_LOG_COND_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:75:5: note: expanded from macro 'RCUTILS_LOG_COND_NAMED' 75 | RCUTILS_LOGGING_AUTOINIT; \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging.h:527:7: note: expanded from macro 'RCUTILS_LOGGING_AUTOINIT' 527 | if (rcutils_logging_initialize() != RCUTILS_RET_OK) { \ | ^ /__w/f1tenth/f1tenth/src/onboarding/src/odom_relay.cpp:30:3: note: +6, including nesting penalty of 5, nesting level increased to 6 30 | RCLCPP_INFO(this->get_logger(), "Speed: %.2f, Steering Angle: %.2f", relay_msg_obj.drive.speed, | ^ /opt/ros/humble/include/rclcpp/rclcpp/logging.hpp:535:5: note: expanded from macro 'RCLCPP_INFO' 535 | RCUTILS_LOG_INFO_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:507:3: note: expanded from macro 'RCUTILS_LOG_INFO_NAMED' 507 | RCUTILS_LOG_COND_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:75:5: note: expanded from macro 'RCUTILS_LOG_COND_NAMED' 75 | RCUTILS_LOGGING_AUTOINIT; \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging.h:528:9: note: expanded from macro 'RCUTILS_LOGGING_AUTOINIT' 528 | RCUTILS_SAFE_FWRITE_TO_STDERR( \ | ^ /opt/ros/humble/include/rcutils/rcutils/error_handling.h:54:3: note: expanded from macro 'RCUTILS_SAFE_FWRITE_TO_STDERR' 54 | do {fwrite(msg, sizeof(char), strlen(msg), stderr);} while (0) | ^ /__w/f1tenth/f1tenth/src/onboarding/src/odom_relay.cpp:30:3: note: +6, including nesting penalty of 5, nesting level increased to 6 30 | RCLCPP_INFO(this->get_logger(), "Speed: %.2f, Steering Angle: %.2f", relay_msg_obj.drive.speed, | ^ /opt/ros/humble/include/rclcpp/rclcpp/logging.hpp:535:5: note: expanded from macro 'RCLCPP_INFO' 535 | RCUTILS_LOG_INFO_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:507:3: note: expanded from macro 'RCUTILS_LOG_INFO_NAMED' 507 | RCUTILS_LOG_COND_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:75:5: note: expanded from macro 'RCUTILS_LOG_COND_NAMED' 75 | RCUTILS_LOGGING_AUTOINIT; \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging.h:531:9: note: expanded from macro 'RCUTILS_LOGGING_AUTOINIT' 531 | RCUTILS_SAFE_FWRITE_TO_STDERR(rcutils_get_error_string().str); \ | ^ /opt/ros/humble/include/rcutils/rcutils/error_handling.h:54:3: note: expanded from macro 'RCUTILS_SAFE_FWRITE_TO_STDERR' 54 | do {fwrite(msg, sizeof(char), strlen(msg), stderr);} while (0) | ^ /__w/f1tenth/f1tenth/src/onboarding/src/odom_relay.cpp:30:3: note: +6, including nesting penalty of 5, nesting level increased to 6 30 | RCLCPP_INFO(this->get_logger(), "Speed: %.2f, Steering Angle: %.2f", relay_msg_obj.drive.speed, | ^ /opt/ros/humble/include/rclcpp/rclcpp/logging.hpp:535:5: note: expanded from macro 'RCLCPP_INFO' 535 | RCUTILS_LOG_INFO_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:507:3: note: expanded from macro 'RCUTILS_LOG_INFO_NAMED' 507 | RCUTILS_LOG_COND_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:75:5: note: expanded from macro 'RCUTILS_LOG_COND_NAMED' 75 | RCUTILS_LOGGING_AUTOINIT; \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging.h:532:9: note: expanded from macro 'RCUTILS_LOGGING_AUTOINIT' 532 | RCUTILS_SAFE_FWRITE_TO_STDERR("\n"); \ | ^ /opt/ros/humble/include/rcutils/rcutils/error_handling.h:54:3: note: expanded from macro 'RCUTILS_SAFE_FWRITE_TO_STDERR' 54 | do {fwrite(msg, sizeof(char), strlen(msg), stderr);} while (0) | ^ /__w/f1tenth/f1tenth/src/onboarding/src/odom_relay.cpp:30:3: note: +3, including nesting penalty of 2, nesting level increased to 3 30 | RCLCPP_INFO(this->get_logger(), "Speed: %.2f, Steering Angle: %.2f", relay_msg_obj.drive.speed, | ^ /opt/ros/humble/include/rclcpp/rclcpp/logging.hpp:535:5: note: expanded from macro 'RCLCPP_INFO' 535 | RCUTILS_LOG_INFO_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:507:3: note: expanded from macro 'RCUTILS_LOG_INFO_NAMED' 507 | RCUTILS_LOG_COND_NAMED( \ | ^ /opt/ros/humble/include/rcutils/rcutils/logging_macros.h:77:5: note: expanded from macro 'RCUTILS_LOG_COND_NAMED' 77 | if (rcutils_logging_logger_is_enabled_for(name, severity)) { \ | ^ ``` - **src/onboarding/src/odom_relay.cpp:25:30:** warning: [[bugprone-easily-swappable-parameters](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/easily-swappable-parameters.html)] > 2 adjacent parameters of 'publishRelay' of similar type ('double') are easily swapped by mistake ```cpp 25 | void OdomRelay::publishRelay(double speed, double steering_angle) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /__w/f1tenth/f1tenth/src/onboarding/src/odom_relay.cpp:25:37: note: the first parameter in the range is 'speed' 25 | void OdomRelay::publishRelay(double speed, double steering_angle) { | ^~~~~ /__w/f1tenth/f1tenth/src/onboarding/src/odom_relay.cpp:25:51: note: the last parameter in the range is 'steering_angle' 25 | void OdomRelay::publishRelay(double speed, double steering_angle) { | ^~~~~~~~~~~~~~ /__w/f1tenth/f1tenth/src/onboarding/src/odom_relay.cpp:27:31: warning: narrowing conversion from 'double' to '_speed_type' (aka 'float') [bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions] 27 | relay_msg_obj.drive.speed = speed; | ^ /__w/f1tenth/f1tenth/src/onboarding/src/odom_relay.cpp:28:40: warning: narrowing conversion from 'double' to '_steering_angle_type' (aka 'float') [bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions] 28 | relay_msg_obj.drive.steering_angle = steering_angle; | ^ ``` - **src/onboarding/src/odom_relay.cpp:30:3:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "RCLCPP_INFO" is directly included ```cpp 2 | RCLCPP_INFO(this->get_logger(), "Speed: %.2f, Steering Angle: %.2f", relay_msg_obj.drive.speed, | ^ ``` - **src/onboarding/src/odom_relay.cpp:37:11:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "rclcpp::init" is directly included ```cpp 2 | rclcpp::init(argc, argv); | ^ ``` - **src/onboarding/src/odom_relay.cpp:38:11:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "rclcpp::spin" is directly included ```cpp 2 | rclcpp::spin(std::make_shared()); | ^ ``` - **src/onboarding/src/odom_relay.cpp:38:21:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "std::make_shared" is directly included ```cpp 2 | rclcpp::spin(std::make_shared()); | ^ ``` - **src/onboarding/src/odom_relay.cpp:39:11:** warning: [[misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)] > no header providing "rclcpp::shutdown" is directly included ```cpp 39 | rclcpp::shutdown(); | ^ ```

Have any feedback or feature suggestions? Share it here.