-
Notifications
You must be signed in to change notification settings - Fork 704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(motion_velocity_smoother): add force acceleration function #7180
feat(motion_velocity_smoother): add force acceleration function #7180
Conversation
Signed-off-by: Go Sakayori <gsakayori@gmail.com>
Signed-off-by: Go Sakayori <go.sakayori@tier4.jp>
Signed-off-by: Go Sakayori <gsakayori@gmail.com>
Signed-off-by: Go Sakayori <gsakayori@gmail.com>
Signed-off-by: Go Sakayori <gsakayori@gmail.com>
void MotionVelocitySmootherNode::onSlow( | ||
const std::shared_ptr<SetBool::Request> request, std::shared_ptr<SetBool::Response> response) | ||
{ | ||
bool success = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to define the variable success
.
{ | ||
bool success = true; | ||
|
||
std::string message = request->data ? "Slow driving" : "Default"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add const
rclcpp::Service<SetBool>::SharedPtr srv_adjust_common_param; | ||
rclcpp::Service<SetBool>::SharedPtr srv_slow_driving; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add _
at the last of the member variables' names.
@@ -72,6 +73,13 @@ MotionVelocitySmootherNode::MotionVelocitySmootherNode(const rclcpp::NodeOptions | |||
"~/input/operation_mode_state", 1, | |||
[this](const OperationModeState::ConstSharedPtr msg) { operation_mode_ = *msg; }); | |||
|
|||
srv_adjust_common_param = create_service<SetBool>( | |||
"~/adjust_common_param", std::bind(&MotionVelocitySmootherNode::onAdjustParam, this, _1, _2)); | |||
adjustParam = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this variable necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought it might not be necessary to set the force acceleration parameter every time when the request is continuously true. The same applies when false is continuous.
What do you think about it?
@go-sakayori
I leave it to you to decide how much to address these points in this PR (at least I want to have a README though), but please keep them in mind. Autoware.ai had many interfaces with unclear and vague names, making maintenance very difficult. |
It would be closed. Would make a PR once the functions are arranged in proper architecture. |
Description
A function to adjust the parameters for the motion velocity smoother is added. The purpose is to realize quick acceleration when needed.
As it is a basic function, std_srvs::srv::SetBool service is implemented to adjust few parameters.
Once there is a request with "true", the parameters would be updated. If the request is "false" or there is no request the default values would be used for the velocity smoothing.
Related links
autowarefoundation/autoware_launch#1010
Tests performed
TIER IV interal evaluator + Psim
Notes for reviewers
Interface changes
ROS Service Changes
/planning/scenario_planning/motion_velocity_smoother/adjust_common_param
std_srvs::srv::SetBool
/planning/scenario_planning/motion_velocity_smoother/slow_driving
std_srvs::srv::SetBool
Effects on system behavior
Pre-review checklist for the PR author
The PR author must check the checkboxes below when creating the PR.
In-review checklist for the PR reviewers
The PR reviewers must check the checkboxes below before approval.
Post-review checklist for the PR author
The PR author must check the checkboxes below before merging.
After all checkboxes are checked, anyone who has write access can merge the PR.