refactor: modernize roborts_base & roborts_decision to C++17#60
Open
SkyPhy wants to merge 2 commits intoRoboMaster:icra2019from
Open
refactor: modernize roborts_base & roborts_decision to C++17#60SkyPhy wants to merge 2 commits intoRoboMaster:icra2019from
SkyPhy wants to merge 2 commits intoRoboMaster:icra2019from
Conversation
## roborts_base (18 files) ### Bug Fixes - Fix DLOG_ERROR mapped to DLOG(WARNING) instead of DLOG(ERROR) (log.h) - Fix impossible null check: port_name_.c_str() == nullptr (serial_device.cpp) - Fix baudrate array bounds mismatch: st_baud[8] vs std_rate[11] (serial_device.cpp) - Fix non-portable sizeof(std_rate)/4 -> sizeof(std_rate)/sizeof(std_rate[0]) - Fix verison_client_ typo -> version_client_ (chassis.h/cpp, gimbal.h/cpp) ### Build System - Upgrade C++ standard from C++14 to C++17 - Bump cmake_minimum_required to 3.10 - Upgrade package.xml to format 2, remove unused rospy dependency ### Modern C++ Updates - Add constexpr conversion constants (mm<->m, decideg<->rad) - Replace raw magic numbers with named constants - Use std::make_shared instead of raw new (dispatch.h) - Replace C-style (MemoryBlock*)0 with nullptr (memory_pool.h) - Fix bool full_ = 0 -> false (circular_buffer.h) - Add missing <cstdint> include (hardware_interface.h) - Use const char* instead of char* (log.h GLogWrapper) - Add signal handling and configurable loop rate (roborts_base_node.cpp) - Expand config with loop_rate and module enable flags ## roborts_decision (13 files) ### Bug Fixes - Fix FastLineIterator using robot_cell_x for both y coords (chase_behavior.h) - Fix whirl_vel_.accel.linear.x initialized twice (escape_behavior.h) - Fix uninitialized new_goal_ member (blackboard.h) - Fix undefined behavior: patrol_count_ = ++patrol_count_ % n (patrol_behavior.h) ### Thread Safety - Add std::mutex protection for enemy_detected_, enemy_pose_ (blackboard.h) - Add std::mutex protection for new_goal_, goal_ (blackboard.h) ### Code Quality - Replace raw new with std::make_unique (behavior_test.cpp) - Replace std::cout with ROS_DEBUG logging (patrol_behavior.h) - Upgrade package.xml to format 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
roborts_base (18 files)
Bug Fixes
Build System
Modern C++ Updates
roborts_decision (13 files)
Bug Fixes
Thread Safety
Code Quality