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

feat: add control launch xml #2832

Closed
wants to merge 2 commits into from
Closed

feat: add control launch xml #2832

wants to merge 2 commits into from

Conversation

wep21
Copy link
Contributor

@wep21 wep21 commented Feb 7, 2023

Description

add control xml launch to simplify launch.

Related links

Tests performed

Notes for reviewers

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.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.
  • The PR is ready for merge.

After all checkboxes are checked, anyone who has write access can merge the PR.

@github-actions github-actions bot added the component:launch Launch files, scripts and initialization tools. (auto-assigned) label Feb 7, 2023
@wep21 wep21 force-pushed the feat/add-control-xml-launch branch from 3b74e93 to a04032b Compare February 7, 2023 15:15
@wep21 wep21 requested review from kenji-miyake and xmfcx February 7, 2023 15:15
@wep21 wep21 changed the title feat: add control xml launch feat: add control launch xml Feb 7, 2023
Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>
@wep21 wep21 force-pushed the feat/add-control-xml-launch branch from a04032b to 3de16e8 Compare February 7, 2023 15:16
Comment on lines +133 to +171
<!-- external cmd selector -->
<composable_node pkg="external_cmd_selector" plugin="ExternalCmdSelector" name="external_cmd_selector">
<remap from="~/service/select_external_command" to="~/select_external_command"/>
<remap from="~/input/local/control_cmd" to="/api/external/set/command/local/control"/>
<remap from="~/input/local/shift_cmd" to="/api/external/set/command/local/shift"/>
<remap from="~/input/local/turn_signal_cmd" to="/api/external/set/command/local/turn_signal"/>
<remap from="~/input/local/heartbeat" to="/api/external/set/command/local/heartbeat"/>
<remap from="~/input/remote/control_cmd" to="/api/external/set/command/remote/control"/>
<remap from="~/input/remote/shift_cmd" to="/api/external/set/command/remote/shift"/>
<remap from="~/input/remote/turn_signal_cmd" to="/api/external/set/command/remote/turn_signal"/>
<remap from="~/input/remote/heartbeat" to="/api/external/set/command/remote/heartbeat"/>
<remap from="~/output/control_cmd" to="/external/selected/external_control_cmd"/>
<remap from="~/output/gear_cmd" to="/external/selected/gear_cmd"/>
<remap from="~/output/turn_indicators_cmd" to="/external/selected/turn_indicators_cmd"/>
<remap from="~/output/hazard_lights_cmd" to="/external/selected/hazard_lights_cmd"/>
<remap from="~/output/heartbeat" to="/external/selected/heartbeat"/>
<remap from="~/output/current_selector_mode" to="~/current_selector_mode"/>
<param from="$(var external_cmd_selector_param_path)"/>
<extra_arg name="use_intra_process_comms" value="$(var use_intra_process)"/>
</composable_node>

<!-- external cmd converter -->
<composable_node pkg="external_cmd_converter" plugin="external_cmd_converter::ExternalCmdConverterNode" name="external_cmd_converter">
<param from="in/external_control_cmd" to="/external/selected/external_control_cmd"/>
<param from="in/shift_cmd" to="/external/selected/gear_cmd"/>
<param from="in/emergency_stop" to="/external/selected/heartbeat"/>
<param from="in/current_gate_mode" to="/control/current_gate_mode"/>
<param from="in/odometry" to="/localization/kinematic_state"/>
<param from="out/control_cmd" to="/external/selected/control_cmd"/>
<param from="out/latest_external_control_cmd" to="/api/external/get/command/selected/control"/>
<param name="csv_path_accel_map" value="$(find-pkg-share raw_vehicle_cmd_converter)/data/default/accel_map.csv"/>
<param name="csv_path_brake_map" value="$(find-pkg-share raw_vehicle_cmd_converter)/data/default/brake_map.csv"/>
<param name="ref_vel_gain" value="3.0"/>
<param name="wait_for_first_topic" value="true"/>
<param name="control_command_timeout" value="1.0"/>
<param name="emergency_stop_timeout" value="3.0"/>
<extra_arg name="use_intra_process_comms" value="$(var use_intra_process)"/>
</composable_node>
</node_container>
Copy link
Contributor

Choose a reason for hiding this comment

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

[Question] Why did you change here from IncludeLaunchDescription?

# external cmd selector
external_cmd_selector_loader = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
[FindPackageShare("external_cmd_selector"), "/launch/external_cmd_selector.launch.py"]
),
launch_arguments=[
("use_intra_process", LaunchConfiguration("use_intra_process")),
("target_container", "/control/control_container"),
(
"external_cmd_selector_param_path",
LaunchConfiguration("external_cmd_selector_param_path"),
),
],
)
# external cmd converter
external_cmd_converter_loader = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
[FindPackageShare("external_cmd_converter"), "/launch/external_cmd_converter.launch.py"]
),
launch_arguments=[
("use_intra_process", LaunchConfiguration("use_intra_process")),
("target_container", "/control/control_container"),
],
)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because it's more straightforward to write all the contents in xml, I think. There is only one load_composable_nodes in external_cmd_converter/selector python launch file.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's okay to replace it here. (It would be ideal to do it in another PR, though.)
Then, don't you need to remove the old .py files of external_cmd_converter/selector?

Copy link
Contributor

@kenji-miyake kenji-miyake left a comment

Choose a reason for hiding this comment

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

The diff looks good to me. If scenario tests pass, I think it's okay.

@stale
Copy link

stale bot commented Apr 8, 2023

This pull request has been automatically marked as stale because it has not had recent activity.

@stale stale bot added the status:stale Inactive or outdated issues. (auto-assigned) label Apr 8, 2023
@wep21 wep21 closed this Jun 21, 2023
@wep21 wep21 deleted the feat/add-control-xml-launch branch June 21, 2023 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:launch Launch files, scripts and initialization tools. (auto-assigned) status:stale Inactive or outdated issues. (auto-assigned)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants