Skip to content

Implement reset functionality for planning module#8

Open
michaelwestern1 wants to merge 1 commit intomainfrom
pc-87-reset-update
Open

Implement reset functionality for planning module#8
michaelwestern1 wants to merge 1 commit intomainfrom
pc-87-reset-update

Conversation

@michaelwestern1
Copy link

Merge Request / Pull Request

Summary of Changes

Briefly describe what this MR/PR does and which issue/task it addresses.

Type of Change

  • Bug fix
  • New feature / task
  • Refactor
  • Documentation

Checklist (to be completed before review)

  • Code follows team standards
  • Tested locally
  • Tests added / updated if relevant
  • Documentation updated if relevant
  • CI / checks pass

Related Issue / Task

  • Closes #[issue_number] (if applicable)

Notes / Additional Context

Any context for reviewers (limitations, known issues, future work)

@michaelwestern1 michaelwestern1 requested a review from a team as a code owner November 27, 2025 22:04
@alyashour
Copy link
Member

@michaelwestern1 please resolve merge conflicts before review.

@@ -1,137 +1,162 @@
/**
* Created: Oct. 10, 2025
* Created: Oct. 11, 2025
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* Created: Oct. 10, 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";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.");
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good

<maintainer email="alyashour1@gmail.com">Aly Ashour</maintainer>
<description>Planning node for AP1 project</description>

<maintainer email="alyashour1@gmail.com">Aly</maintainer>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?????

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"?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove this?

@alyashour
Copy link
Member

Please also pull main and resolve conflicts @michaelwestern1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants