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

Fix regression where teleop node would crash due to missing configuration file #504

Merged
merged 1 commit into from
May 27, 2024
Merged
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
2 changes: 1 addition & 1 deletion crazyflie/config/teleop.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/teleop:
ros__parameters:
frequency: 100 # set to 0, to disable manual flight modes
mode: "cmd_vel_world" # one of cmd_rpy, cmd_vel_world
mode: "none" # one of none, cmd_rpy, cmd_vel_world
cmd_rpy:
roll:
axis: 5
Expand Down
7 changes: 6 additions & 1 deletion crazyflie/launch/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ def generate_launch_description():
with open('tmp_motion_capture.yaml', 'w') as outfile:
yaml.dump(motion_capture_content, outfile, default_flow_style=False, sort_keys=False)

telop_yaml_path = os.path.join(
get_package_share_directory('crazyflie'),
'config',
'teleop.yaml')

return LaunchDescription([
DeclareLaunchArgument('backend', default_value='cpp'),
DeclareLaunchArgument('debug', default_value='False'),
Expand Down Expand Up @@ -102,7 +107,7 @@ def generate_launch_description():
# ('cmd_full_state', 'cf6/cmd_full_state'),
# ('notify_setpoints_stop', 'cf6/notify_setpoints_stop'),
],
parameters= [PythonExpression(["'teleop.yaml' if '", LaunchConfiguration('teleop_yaml_file'), "' == '' else '", LaunchConfiguration('teleop_yaml_file'), "'"])],
parameters= [PythonExpression(["'" + telop_yaml_path +"' if '", LaunchConfiguration('teleop_yaml_file'), "' == '' else '", LaunchConfiguration('teleop_yaml_file'), "'"])],
),
Node(
package='joy',
Expand Down
Loading