Skip to content

Commit

Permalink
Merge pull request #484 from IMRCLab/fix-ros2-tutorials
Browse files Browse the repository at this point in the history
Fix ros2 tutorials
  • Loading branch information
knmcguire authored Apr 24, 2024
2 parents bf00cb7 + d5daef3 commit 4e9000c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 3 deletions.
9 changes: 9 additions & 0 deletions crazyflie_examples/launch/keyboard_velmux_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ def generate_launch_description():

server_params = crazyflies

# robot description
urdf = os.path.join(
get_package_share_directory('crazyflie'),
'urdf',
'crazyflie_description.urdf')
with open(urdf, 'r') as f:
robot_desc = f.read()
server_params['robot_description'] = robot_desc

return LaunchDescription([
Node(
package='crazyflie',
Expand Down
9 changes: 9 additions & 0 deletions crazyflie_examples/launch/multiranger_mapping_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ def generate_launch_description():

server_params = crazyflies

# robot description
urdf = os.path.join(
get_package_share_directory('crazyflie'),
'urdf',
'crazyflie_description.urdf')
with open(urdf, 'r') as f:
robot_desc = f.read()
server_params['robot_description'] = robot_desc

return LaunchDescription([
Node(
package='crazyflie',
Expand Down
11 changes: 10 additions & 1 deletion crazyflie_examples/launch/multiranger_nav2_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ def generate_launch_description():

server_params = crazyflies

# robot description
urdf = os.path.join(
get_package_share_directory('crazyflie'),
'urdf',
'crazyflie_description.urdf')
with open(urdf, 'r') as f:
robot_desc = f.read()
server_params['robot_description'] = robot_desc

cf_examples_dir = get_package_share_directory('crazyflie_examples')
bringup_dir = get_package_share_directory('nav2_bringup')
bringup_launch_dir = os.path.join(bringup_dir, 'launch')
Expand Down Expand Up @@ -73,7 +82,7 @@ def generate_launch_description():
'autostart': 'True',
'use_composition': 'True',
'transform_publish_period': '0.02'
}.items()
}.items()
),
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
Expand Down
14 changes: 12 additions & 2 deletions crazyflie_examples/launch/multiranger_simple_mapper_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@


def generate_launch_description():

# load crazyflies
crazyflies_yaml = os.path.join(
get_package_share_directory('crazyflie'),
Expand All @@ -18,6 +19,15 @@ def generate_launch_description():

server_params = crazyflies

# robot description
urdf = os.path.join(
get_package_share_directory('crazyflie'),
'urdf',
'crazyflie_description.urdf')
with open(urdf, 'r') as f:
robot_desc = f.read()
server_params['robot_description'] = robot_desc

crazyflie_name = '/cf231'

return LaunchDescription([
Expand All @@ -26,7 +36,7 @@ def generate_launch_description():
executable='crazyflie_server.py',
name='crazyflie_server',
output='screen',
parameters=[server_params],
parameters=[server_params]
),
Node(
package='crazyflie',
Expand All @@ -43,6 +53,6 @@ def generate_launch_description():
name='simple_mapper_multiranger',
output='screen',
parameters=[
{'robot_prefix': crazyflie_name}]
{'robot_prefix': crazyflie_name}]
),
])

0 comments on commit 4e9000c

Please sign in to comment.