Skip to content

Commit

Permalink
Merge pull request #504 from IMRCLab/issue_teleop
Browse files Browse the repository at this point in the history
Fix regression where teleop node would crash due to missing configuration file
  • Loading branch information
knmcguire committed May 27, 2024
2 parents 97ed0a9 + 1a3a981 commit 9f56069
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
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

0 comments on commit 9f56069

Please sign in to comment.