Skip to content

Commit

Permalink
Added a launch arg that allows you to use vim_fly.
Browse files Browse the repository at this point in the history
  • Loading branch information
iandareid committed Jul 25, 2024
1 parent 86df3b5 commit 851536d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion rosflight_sim/launch/multirotor_sim_io_joy.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,26 @@
"""

import os
import sys

from ament_index_python import get_package_share_directory
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node


def generate_launch_description():
"""This is a launch file that runs the bare minimum requirements fly a multirotor in gazebo"""

use_vimfly = False

for arg in sys.argv:
if arg.startswith("use_vimfly:="):
use_vimfly = arg.split(":=")[1]
use_vimfly = use_vimfly.lower() == 'true'

# Start simulator
simulator_launch_include = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
Expand All @@ -44,6 +53,9 @@ def generate_launch_description():
executable='rc.py',
remappings=[
('/RC', '/multirotor/RC')
],
parameters=[
{'use_vimfly': use_vimfly}
]
)

Expand Down

0 comments on commit 851536d

Please sign in to comment.