Skip to content
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

refactor(mrm_comfortable_stop_operator): rework parameter #8936

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions system/mrm_comfortable_stop_operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,7 @@ MRM comfortable stop operator is a node that generates comfortable stop commands

## Parameters

### Node Parameters

| Name | Type | Default value | Explanation |
| ----------- | ---- | ------------- | ----------------------------- |
| update_rate | int | `10` | Timer callback frequency [Hz] |

### Core Parameters

| Name | Type | Default value | Explanation |
| ---------------- | ------ | ------------- | ------------------------------------------------- |
| min_acceleration | double | `-1.0` | Minimum acceleration for comfortable stop [m/s^2] |
| max_jerk | double | `0.3` | Maximum jerk for comfortable stop [m/s^3] |
| min_jerk | double | `-0.3` | Minimum jerk for comfortable stop [m/s^3] |
{{ json_to_markdown("system/mrm_comfortable_stop_operator/schema/mrm_comfortable_stop_operator.schema.json") }}

## Assumptions / Known limits

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**:
ros__parameters:
update_rate: 10
min_acceleration: -1.0
max_jerk: 0.3
min_jerk: -0.3
update_rate: 10 # Node Parameters
min_acceleration: -1.0 # Code Parameters
max_jerk: 0.3 # Code Parameters
min_jerk: -0.3 # Code Parameters
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MRM Comfortable Stop Operator",
"type": "object",
"definitions": {
"mrm_comfortable_stop_operator": {
"type": "object",
"properties": {
"update_rate": {
"type": "integer",
"description": "Timer callback frequency [Hz]",
"default": 10
},
"min_acceleration": {
"type": "number",
"description": "Minimum acceleration for comfortable stop [m/s^2]",
"default": -1.0
},
"max_jerk": {
"type": "number",
"description": "Maximum jerk for comfortable stop [m/s^3]",
"default": 0.3
},
"min_jerk": {
"type": "number",
"description": "Minimum jerk for comfortable stop [m/s^3]",
"default": -0.3
}
},
"required": ["update_rate", "min_acceleration", "max_jerk", "min_jerk"],
"additionalProperties": false
}
},
"properties": {
"/**": {
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/mrm_comfortable_stop_operator"
}
},
"required": ["ros__parameters"],
"additionalProperties": false
}
},
"required": ["/**"],
"additionalProperties": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ MrmComfortableStopOperator::MrmComfortableStopOperator(const rclcpp::NodeOptions
: Node("mrm_comfortable_stop_operator", node_options)
{
// Parameter
params_.update_rate = static_cast<int>(declare_parameter<int>("update_rate", 1));
params_.min_acceleration = declare_parameter<double>("min_acceleration", -1.0);
params_.max_jerk = declare_parameter<double>("max_jerk", 0.3);
params_.min_jerk = declare_parameter<double>("min_jerk", 0.3);
params_.update_rate = static_cast<int>(declare_parameter<int>("update_rate"));
params_.min_acceleration = declare_parameter<double>("min_acceleration");
params_.max_jerk = declare_parameter<double>("max_jerk");
params_.min_jerk = declare_parameter<double>("min_jerk");

// Server
service_operation_ = create_service<tier4_system_msgs::srv::OperateMrm>(
Expand Down
Loading