Implement reset functionality for planning module#8
Open
michaelwestern1 wants to merge 1 commit intomainfrom
Open
Implement reset functionality for planning module#8michaelwestern1 wants to merge 1 commit intomainfrom
michaelwestern1 wants to merge 1 commit intomainfrom
Conversation
Member
|
@michaelwestern1 please resolve merge conflicts before review. |
alyashour
requested changes
Feb 13, 2026
| @@ -1,137 +1,162 @@ | |||
| /** | |||
| * Created: Oct. 10, 2025 | |||
| * Created: Oct. 11, 2025 | |||
Comment on lines
+28
to
+36
| // CONFIG PATH | ||
| config_path_ = | ||
| std::string( | ||
| std::filesystem::path(__FILE__) | ||
| .parent_path() | ||
| .parent_path() | ||
| .parent_path() | ||
| .parent_path() | ||
| ) + "/config.yaml"; |
Member
There was a problem hiding this comment.
Pass this in on launch instead. See https://github.com/WE-Autopilot/control/blob/6fe7ee518dd046b2ba135196c259269cc74542ed/src/main.cpp#L8-L23
Comment on lines
+92
to
+113
| void on_timer() | ||
| { | ||
| // Fake speed increasing | ||
| if (speed_profile_.empty()) | ||
| speed_profile_.push_back(0.0f); | ||
| else | ||
| { | ||
| speed_profile_[0] += 0.5f; | ||
| if (speed_profile_[0] > 30.0f) | ||
| speed_profile_[0] = 0.0f; | ||
| } | ||
|
|
||
| std_msgs::msg::Float32MultiArray speed_msg; | ||
| speed_msg.data = speed_profile_; | ||
| speed_profile_pub_->publish(speed_msg); | ||
|
|
||
| // Fake path: just push target | ||
| std_msgs::msg::Float32MultiArray path_msg; | ||
| path_msg.data.push_back(target_x_); | ||
| path_msg.data.push_back(target_y_); | ||
| target_path_pub_->publish(path_msg); | ||
| } |
Member
There was a problem hiding this comment.
Suggested change
| void on_timer() | |
| { | |
| // Fake speed increasing | |
| if (speed_profile_.empty()) | |
| speed_profile_.push_back(0.0f); | |
| else | |
| { | |
| speed_profile_[0] += 0.5f; | |
| if (speed_profile_[0] > 30.0f) | |
| speed_profile_[0] = 0.0f; | |
| } | |
| std_msgs::msg::Float32MultiArray speed_msg; | |
| speed_msg.data = speed_profile_; | |
| speed_profile_pub_->publish(speed_msg); | |
| // Fake path: just push target | |
| std_msgs::msg::Float32MultiArray path_msg; | |
| path_msg.data.push_back(target_x_); | |
| path_msg.data.push_back(target_y_); | |
| target_path_pub_->publish(path_msg); | |
| } |
Comment on lines
+129
to
+144
| void handle_reset( | ||
| const std::shared_ptr<std_srvs::srv::Trigger::Request>, | ||
| std::shared_ptr<std_srvs::srv::Trigger::Response> response) | ||
| { | ||
| speed_profile_.clear(); | ||
| planned_path_.clear(); | ||
| target_x_ = 0.0; | ||
| target_y_ = 0.0; | ||
|
|
||
| load_config(); // RELOAD CONFIG HERE ✔ | ||
|
|
||
| response->success = true; | ||
| response->message = "Planning reset + config reloaded"; | ||
|
|
||
| RCLCPP_INFO(get_logger(), "Planning reset completed."); | ||
| } |
| <maintainer email="alyashour1@gmail.com">Aly Ashour</maintainer> | ||
| <description>Planning node for AP1 project</description> | ||
|
|
||
| <maintainer email="alyashour1@gmail.com">Aly</maintainer> |
Comment on lines
-1
to
-2
| <?xml version="1.0"?> | ||
| <?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> |
Member
|
Please also pull main and resolve conflicts @michaelwestern1 |
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.
Merge Request / Pull Request
Summary of Changes
Briefly describe what this MR/PR does and which issue/task it addresses.
Type of Change
Checklist (to be completed before review)
Related Issue / Task
Notes / Additional Context
Any context for reviewers (limitations, known issues, future work)